Changeset 2789121
- Timestamp:
- 09/23/2022 06:29:43 AM (23 months ago)
- Location:
- filterable-portfolio/trunk
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
filterable-portfolio/trunk/assets/js/block.js
r2760212 r2789121 1 (()=>{var e={395:e=>{e.exports=function(e,t){var r,n,o=0;function i(){var i,l,a=r,s=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(l=0;l<s;l++)if(a.args[l]!==arguments[l]){a=a.next;continue e}return a!==r&&(a===n&&(n=a.prev),a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=r,a.prev=null,r.prev=a,r=a),a.val}a=a.next}for(i=new Array(s),l=0;l<s;l++)i[l]=arguments[l];return a={args:i,val:e.apply(null,i)},r?(r.prev=a,a.next=r):n=a,o===t.maxSize?(n=n.prev).next=null:o++,r=a,a.val}return t=t||{},i.clear=function(){r=null,n=null,o=0},i}},588:(e,t,r)=>{var n;!function(){"use strict";var o={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function i(e){return a(c(e),arguments)}function l(e,t){return i.apply(null,[e].concat(t||[]))}function a(e,t){var r,n,l,a,s,c,u,f,p,h=1,d=e.length,m="";for(n=0;n<d;n++)if("string"==typeof e[n])m+=e[n];else if("object"==typeof e[n]){if((a=e[n]).keys)for(r=t[h],l=0;l<a.keys.length;l++){if(null==r)throw new Error(i('[sprintf] Cannot access property "%s" of undefined value "%s"',a.keys[l],a.keys[l-1]));r=r[a.keys[l]]}else r=a.param_no?t[a.param_no]:t[h++];if(o.not_type.test(a.type)&&o.not_primitive.test(a.type)&&r instanceof Function&&(r=r()),o.numeric_arg.test(a.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(i("[sprintf] expecting number but found %T",r));switch(o.number.test(a.type)&&(f=r>=0),a.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,a.width?parseInt(a.width):0);break;case"e":r=a.precision?parseFloat(r).toExponential(a.precision):parseFloat(r).toExponential();break;case"f":r=a.precision?parseFloat(r).toFixed(a.precision):parseFloat(r);break;case"g":r=a.precision?String(Number(r.toPrecision(a.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=a.precision?r.substring(0,a.precision):r;break;case"t":r=String(!!r),r=a.precision?r.substring(0,a.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=a.precision?r.substring(0,a.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=a.precision?r.substring(0,a.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}o.json.test(a.type)?m+=r:(!o.number.test(a.type)||f&&!a.sign?p="":(p=f?"+":"-",r=r.toString().replace(o.sign,"")),c=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",u=a.width-(p+r).length,s=a.width&&u>0?c.repeat(u):"",m+=a.align?p+r+s:"0"===c?p+s+r:s+p+r)}return m}var s=Object.create(null);function c(e){if(s[e])return s[e];for(var t,r=e,n=[],i=0;r;){if(null!==(t=o.text.exec(r)))n.push(t[0]);else if(null!==(t=o.modulo.exec(r)))n.push("%");else{if(null===(t=o.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){i|=1;var l=[],a=t[2],c=[];if(null===(c=o.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(l.push(c[1]);""!==(a=a.substring(c[0].length));)if(null!==(c=o.key_access.exec(a)))l.push(c[1]);else{if(null===(c=o.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");l.push(c[1])}t[2]=l}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return s[e]=n}i,l,"undefined"!=typeof window&&(window.sprintf=i,window.vsprintf=l,void 0===(n=function(){return{sprintf:i,vsprintf:l}}.call(t,r,t,e))||(e.exports=n))}()}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=wp.blocks,t=wp.components,n=wp.blockEditor;var o=r(395),i=r.n(o);r(588);i()(console.error);var l,a,s,c;l={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},a=["(","?"],s={")":["("],":":["?","?:"]},c=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var u={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,r){if(e)throw t;return r}};function f(e){var t=function(e){for(var t,r,n,o,i=[],u=[];t=e.match(c);){for(r=t[0],(n=e.substr(0,t.index).trim())&&i.push(n);o=u.pop();){if(s[r]){if(s[r][0]===o){r=s[r][1]||r;break}}else if(a.indexOf(o)>=0||l[o]<l[r]){u.push(o);break}i.push(o)}s[r]||u.push(r),e=e.substr(t.index+r.length)}return(e=e.trim())&&i.push(e),i.concat(u.reverse())}(e);return function(e){return function(e,t){var r,n,o,i,l,a,s=[];for(r=0;r<e.length;r++){if(l=e[r],i=u[l]){for(n=i.length,o=Array(n);n--;)o[n]=s.pop();try{a=i.apply(null,o)}catch(e){return e}}else a=t.hasOwnProperty(l)?t[l]:+l;s.push(a)}return s[0]}(t,e)}}var p={contextDelimiter:"",onMissingKey:null};function h(e,t){var r;for(r in this.data=e,this.pluralForms={},this.options={},p)this.options[r]=void 0!==t&&r in t?t[r]:p[r]}function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){g(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}h.prototype.getPluralForm=function(e,t){var r,n,o,i=this.pluralForms[e];return i||("function"!=typeof(o=(r=this.data[e][""])["Plural-Forms"]||r["plural-forms"]||r.plural_forms)&&(n=function(e){var t,r,n;for(t=e.split(";"),r=0;r<t.length;r++)if(0===(n=t[r].trim()).indexOf("plural="))return n.substr(7)}(r["Plural-Forms"]||r["plural-forms"]||r.plural_forms),o=function(e){var t=f(e);return function(e){return+t({n:e})}}(n)),i=this.pluralForms[e]=o),i(t)},h.prototype.dcnpgettext=function(e,t,r,n,o){var i,l,a;return i=void 0===o?0:this.getPluralForm(e,o),l=r,t&&(l=t+this.options.contextDelimiter+r),(a=this.data[e][l])&&a[i]?a[i]:(this.options.onMissingKey&&this.options.onMissingKey(r,e),0===i?r:n)};const b={"":{plural_forms:e=>1===e?0:1}},v=/^i18n\.(n?gettext|has_translation)(_|$)/;const y=function(e){return"string"!=typeof e||""===e?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};const x=function(e){return"string"!=typeof e||""===e?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};const _=function(e,t){return function(r,n,o){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;const l=e[t];if(!x(r))return;if(!y(n))return;if("function"!=typeof o)return void console.error("The hook callback must be a function.");if("number"!=typeof i)return void console.error("If specified, the hook priority must be a number.");const a={callback:o,priority:i,namespace:n};if(l[r]){const e=l[r].handlers;let t;for(t=e.length;t>0&&!(i>=e[t-1].priority);t--);t===e.length?e[t]=a:e.splice(t,0,a),l.__current.forEach((e=>{e.name===r&&e.currentIndex>=t&&e.currentIndex++}))}else l[r]={handlers:[a],runs:0};"hookAdded"!==r&&e.doAction("hookAdded",r,n,o,i)}};const w=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n,o){const i=e[t];if(!x(n))return;if(!r&&!y(o))return;if(!i[n])return 0;let l=0;if(r)l=i[n].handlers.length,i[n]={runs:i[n].runs,handlers:[]};else{const e=i[n].handlers;for(let t=e.length-1;t>=0;t--)e[t].namespace===o&&(e.splice(t,1),l++,i.__current.forEach((e=>{e.name===n&&e.currentIndex>=t&&e.currentIndex--})))}return"hookRemoved"!==n&&e.doAction("hookRemoved",n,o),l}};const k=function(e,t){return function(r,n){const o=e[t];return void 0!==n?r in o&&o[r].handlers.some((e=>e.namespace===n)):r in o}};const F=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n){const o=e[t];o[n]||(o[n]={handlers:[],runs:0}),o[n].runs++;const i=o[n].handlers;for(var l=arguments.length,a=new Array(l>1?l-1:0),s=1;s<l;s++)a[s-1]=arguments[s];if(!i||!i.length)return r?a[0]:void 0;const c={name:n,currentIndex:0};for(o.__current.push(c);c.currentIndex<i.length;){const e=i[c.currentIndex].callback.apply(null,a);r&&(a[0]=e),c.currentIndex++}return o.__current.pop(),r?a[0]:void 0}};const E=function(e,t){return function(){var r,n;const o=e[t];return null!==(r=null===(n=o.__current[o.__current.length-1])||void 0===n?void 0:n.name)&&void 0!==r?r:null}};const A=function(e,t){return function(r){const n=e[t];return void 0===r?void 0!==n.__current[0]:!!n.__current[0]&&r===n.__current[0].name}};const O=function(e,t){return function(r){const n=e[t];if(x(r))return n[r]&&n[r].runs?n[r].runs:0}};class C{constructor(){this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=_(this,"actions"),this.addFilter=_(this,"filters"),this.removeAction=w(this,"actions"),this.removeFilter=w(this,"filters"),this.hasAction=k(this,"actions"),this.hasFilter=k(this,"filters"),this.removeAllActions=w(this,"actions",!0),this.removeAllFilters=w(this,"filters",!0),this.doAction=F(this,"actions"),this.applyFilters=F(this,"filters",!0),this.currentAction=E(this,"actions"),this.currentFilter=E(this,"filters"),this.doingAction=A(this,"actions"),this.doingFilter=A(this,"filters"),this.didAction=O(this,"actions"),this.didFilter=O(this,"filters")}}const S=function(){return new C}(),{addAction:j,addFilter:P,removeAction:D,removeFilter:T,hasAction:I,hasFilter:W,removeAllActions:L,removeAllFilters:R,doAction:z,applyFilters:B,currentAction:N,currentFilter:$,doingAction:M,doingFilter:Z,didAction:K,didFilter:X,actions:G,filters:J}=S,U=((e,t,r)=>{const n=new h({}),o=new Set,i=()=>{o.forEach((e=>e()))},l=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";n.data[r]=m(m({},n.data[r]),e),n.data[r][""]=m(m({},b[""]),null===(t=n.data[r])||void 0===t?void 0:t[""]),delete n.pluralForms[r]},a=(e,t)=>{l(e,t),i()},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return n.data[e]||l(void 0,e),n.dcnpgettext(e,t,r,o,i)},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return e},u=(e,t,n)=>{let o=s(n,t,e);return r?(o=r.applyFilters("i18n.gettext_with_context",o,e,t,n),r.applyFilters("i18n.gettext_with_context_"+c(n),o,e,t,n)):o};if(e&&a(e,t),r){const e=e=>{v.test(e)&&i()};r.addAction("hookAdded","core/i18n",e),r.addAction("hookRemoved","core/i18n",e)}return{getLocaleData:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return n.data[e]},setLocaleData:a,addLocaleData:function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";n.data[r]=m(m(m({},n.data[r]),e),{},{"":m(m(m({},b[""]),null===(t=n.data[r])||void 0===t?void 0:t[""]),null==e?void 0:e[""])}),delete n.pluralForms[r],i()},resetLocaleData:(e,t)=>{n.data={},n.pluralForms={},a(e,t)},subscribe:e=>(o.add(e),()=>o.delete(e)),__:(e,t)=>{let n=s(t,void 0,e);return r?(n=r.applyFilters("i18n.gettext",n,e,t),r.applyFilters("i18n.gettext_"+c(t),n,e,t)):n},_x:u,_n:(e,t,n,o)=>{let i=s(o,void 0,e,t,n);return r?(i=r.applyFilters("i18n.ngettext",i,e,t,n,o),r.applyFilters("i18n.ngettext_"+c(o),i,e,t,n,o)):i},_nx:(e,t,n,o,i)=>{let l=s(i,o,e,t,n);return r?(l=r.applyFilters("i18n.ngettext_with_context",l,e,t,n,o,i),r.applyFilters("i18n.ngettext_with_context_"+c(i),l,e,t,n,o,i)):l},isRTL:()=>"rtl"===u("ltr","text direction"),hasTranslation:(e,t,o)=>{var i,l;const a=t?t+""+e:e;let s=!(null===(i=n.data)||void 0===i||null===(l=i[null!=o?o:"default"])||void 0===l||!l[a]);return r&&(s=r.applyFilters("i18n.has_translation",s,e,t,o),s=r.applyFilters("i18n.has_translation_"+c(o),s,e,t,o)),s}}})(void 0,void 0,S),V=(U.getLocaleData.bind(U),U.setLocaleData.bind(U),U.resetLocaleData.bind(U),U.subscribe.bind(U),U.__.bind(U)),q=(U._x.bind(U),U._n.bind(U),U._nx.bind(U),U.isRTL.bind(U),U.hasTranslation.bind(U),React);var H=r.n(q);const Q=H().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",shapeRendering:"geometricPrecision"},H().createElement("rect",{width:"512",height:"512",rx:"8",fill:"#fff7ed"}),H().createElement("g",{transform:"translate(0 28)"},H().createElement("g",null,H().createElement("rect",{width:"120",height:"90",rx:"0",ry:"0",transform:"translate(38 100)",fill:"#D32F2F",strokeWidth:"0"}),H().createElement("rect",{width:"120",height:"90",rx:"0",ry:"0",transform:"translate(196 100)",fill:"#757575",strokeWidth:"0"}),H().createElement("rect",{width:"120",height:"90",rx:"0",ry:"0",transform:"translate(354 100)",fill:"#D32F2F",strokeWidth:"0"})),H().createElement("g",{transform:"translate(0 128)"},H().createElement("rect",{width:"120",height:"90",rx:"0",ry:"0",transform:"translate(38 100)",fill:"#757575",strokeWidth:"0"}),H().createElement("rect",{width:"120",height:"90",rx:"0",ry:"0",transform:"translate(196 100)",fill:"#2E7D32",strokeWidth:"0"}),H().createElement("rect",{width:"120",height:"90",rx:"0",ry:"0",transform:"translate(354 100)",fill:"#757575",strokeWidth:"0"})),H().createElement("g",{transform:"translate(0 256)"},H().createElement("rect",{width:"120",height:"90",rx:"0",ry:"0",transform:"translate(38 100)",fill:"#1976D2",strokeWidth:"0"}),H().createElement("rect",{width:"120",height:"90",rx:"0",ry:"0",transform:"translate(196 100)",fill:"#757575",strokeWidth:"0"}),H().createElement("rect",{width:"120",height:"90",rx:"0",ry:"0",transform:"translate(354 100)",fill:"#1976D2",strokeWidth:"0"}))),H().createElement("g",{transform:"translate(6 15)"},H().createElement("rect",{width:"60",height:"20",rx:"0",ry:"0",transform:"translate(100 55)",fill:"#757575",strokeWidth:"0"}),H().createElement("rect",{width:"60",height:"20",rx:"0",ry:"0",transform:"translate(180 55)",fill:"#D32F2F",strokeWidth:"0"}),H().createElement("rect",{width:"60",height:"20",rx:"0",ry:"0",transform:"translate(260 55)",fill:"#2E7D32",strokeWidth:"0"}),H().createElement("rect",{width:"60",height:"20",rx:"0",ry:"0",transform:"translate(340 55)",fill:"#1976D2",strokeWidth:"0"}))),Y=[{label:V("Default (as Global Settings)","filterable-portfolio"),value:"0"},{label:V("1 Column","filterable-portfolio"),value:"12"},{label:V("2 Columns","filterable-portfolio"),value:"6"},{label:V("3 Columns","filterable-portfolio"),value:"4"},{label:V("4 Columns","filterable-portfolio"),value:"3"},{label:V("6 Columns","filterable-portfolio"),value:"2"}];(0,e.registerBlockType)("filterable-portfolio/projects",{apiVersion:2,title:V("Filterable Portfolio","filterable-portfolio"),icon:Q,category:"widgets",edit(e){let{attributes:r,setAttributes:o}=e;const{isFeatured:i,showFilter:l,theme:a,buttonsAlignment:s,limit:c,columnsPhone:u,columnsTablet:f,columnsDesktop:p,columnsWidescreen:h}=r,d=(0,n.useBlockProps)(),m=H().createElement(n.InspectorControls,{key:"setting"},H().createElement(t.PanelBody,{title:V("Portfolio Options","filterable-portfolio"),initialOpen:!0},H().createElement("div",{className:"filterable-portfolio-select-control"},H().createElement(t.SelectControl,{label:V("Theme","filterable-portfolio"),value:a,options:[{label:"One",value:"one"},{label:"Two",value:"two"}],onChange:e=>o({theme:e})})),H().createElement(t.RangeControl,{label:V("Limit","filterable-portfolio"),help:V("Limit total items to show. To show all set -1.","filterable-portfolio"),value:c,onChange:e=>o({limit:e}),min:-1,max:100}),H().createElement(t.ToggleControl,{label:V("Only show featured projects.","filterable-portfolio"),checked:i,onChange:()=>o({isFeatured:!i})})),H().createElement(t.PanelBody,{title:V("Filter Settings","filterable-portfolio"),initialOpen:!1},H().createElement(t.ToggleControl,{label:V("Show filter buttons.","filterable-portfolio"),checked:l,onChange:()=>o({showFilter:!l})}),H().createElement("div",{className:"filterable-portfolio-select-control"},H().createElement(t.SelectControl,{label:V("Filter buttons alignment","filterable-portfolio"),value:s,options:[{label:"Left",value:"start"},{label:"Center",value:"center"},{label:"Right",value:"end"}],onChange:e=>o({buttonsAlignment:e})}))),H().createElement(t.PanelBody,{title:V("Responsive Settings","filterable-portfolio"),initialOpen:!1},H().createElement(t.SelectControl,{label:V("Columns:Phone","filterable-portfolio"),value:u,onChange:e=>o({columnsPhone:e}),options:Y}),H().createElement(t.SelectControl,{label:V("Columns:Tablet","filterable-portfolio"),value:f,onChange:e=>o({columnsTablet:e}),options:Y}),H().createElement(t.SelectControl,{label:V("Columns:Desktop","filterable-portfolio"),value:p,onChange:e=>o({columnsDesktop:e}),options:Y}),H().createElement(t.SelectControl,{label:V("Columns:Widescreen","filterable-portfolio"),value:h,onChange:e=>o({columnsWidescreen:e}),options:Y})));return H().createElement("div",d,m,H().createElement(t.ServerSideRender,{block:"filterable-portfolio/projects",attributes:r}))},save:()=>null})})()})();1 (()=>{var e={395:e=>{e.exports=function(e,t){var r,n,o=0;function i(){var i,l,a=r,s=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(l=0;l<s;l++)if(a.args[l]!==arguments[l]){a=a.next;continue e}return a!==r&&(a===n&&(n=a.prev),a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=r,a.prev=null,r.prev=a,r=a),a.val}a=a.next}for(i=new Array(s),l=0;l<s;l++)i[l]=arguments[l];return a={args:i,val:e.apply(null,i)},r?(r.prev=a,a.next=r):n=a,o===t.maxSize?(n=n.prev).next=null:o++,r=a,a.val}return t=t||{},i.clear=function(){r=null,n=null,o=0},i}},588:(e,t,r)=>{var n;!function(){"use strict";var o={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function i(e){return a(c(e),arguments)}function l(e,t){return i.apply(null,[e].concat(t||[]))}function a(e,t){var r,n,l,a,s,c,u,f,p,h=1,d=e.length,m="";for(n=0;n<d;n++)if("string"==typeof e[n])m+=e[n];else if("object"==typeof e[n]){if((a=e[n]).keys)for(r=t[h],l=0;l<a.keys.length;l++){if(null==r)throw new Error(i('[sprintf] Cannot access property "%s" of undefined value "%s"',a.keys[l],a.keys[l-1]));r=r[a.keys[l]]}else r=a.param_no?t[a.param_no]:t[h++];if(o.not_type.test(a.type)&&o.not_primitive.test(a.type)&&r instanceof Function&&(r=r()),o.numeric_arg.test(a.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(i("[sprintf] expecting number but found %T",r));switch(o.number.test(a.type)&&(f=r>=0),a.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,a.width?parseInt(a.width):0);break;case"e":r=a.precision?parseFloat(r).toExponential(a.precision):parseFloat(r).toExponential();break;case"f":r=a.precision?parseFloat(r).toFixed(a.precision):parseFloat(r);break;case"g":r=a.precision?String(Number(r.toPrecision(a.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=a.precision?r.substring(0,a.precision):r;break;case"t":r=String(!!r),r=a.precision?r.substring(0,a.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=a.precision?r.substring(0,a.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=a.precision?r.substring(0,a.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}o.json.test(a.type)?m+=r:(!o.number.test(a.type)||f&&!a.sign?p="":(p=f?"+":"-",r=r.toString().replace(o.sign,"")),c=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",u=a.width-(p+r).length,s=a.width&&u>0?c.repeat(u):"",m+=a.align?p+r+s:"0"===c?p+s+r:s+p+r)}return m}var s=Object.create(null);function c(e){if(s[e])return s[e];for(var t,r=e,n=[],i=0;r;){if(null!==(t=o.text.exec(r)))n.push(t[0]);else if(null!==(t=o.modulo.exec(r)))n.push("%");else{if(null===(t=o.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){i|=1;var l=[],a=t[2],c=[];if(null===(c=o.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(l.push(c[1]);""!==(a=a.substring(c[0].length));)if(null!==(c=o.key_access.exec(a)))l.push(c[1]);else{if(null===(c=o.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");l.push(c[1])}t[2]=l}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return s[e]=n}i,l,"undefined"!=typeof window&&(window.sprintf=i,window.vsprintf=l,void 0===(n=function(){return{sprintf:i,vsprintf:l}}.call(t,r,t,e))||(e.exports=n))}()}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=wp.blocks,t=wp.components,n=wp.blockEditor;var o=r(395),i=r.n(o);r(588);i()(console.error);var l,a,s,c;l={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},a=["(","?"],s={")":["("],":":["?","?:"]},c=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var u={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,r){if(e)throw t;return r}};function f(e){var t=function(e){for(var t,r,n,o,i=[],u=[];t=e.match(c);){for(r=t[0],(n=e.substr(0,t.index).trim())&&i.push(n);o=u.pop();){if(s[r]){if(s[r][0]===o){r=s[r][1]||r;break}}else if(a.indexOf(o)>=0||l[o]<l[r]){u.push(o);break}i.push(o)}s[r]||u.push(r),e=e.substr(t.index+r.length)}return(e=e.trim())&&i.push(e),i.concat(u.reverse())}(e);return function(e){return function(e,t){var r,n,o,i,l,a,s=[];for(r=0;r<e.length;r++){if(l=e[r],i=u[l]){for(n=i.length,o=Array(n);n--;)o[n]=s.pop();try{a=i.apply(null,o)}catch(e){return e}}else a=t.hasOwnProperty(l)?t[l]:+l;s.push(a)}return s[0]}(t,e)}}var p={contextDelimiter:"",onMissingKey:null};function h(e,t){var r;for(r in this.data=e,this.pluralForms={},this.options={},p)this.options[r]=void 0!==t&&r in t?t[r]:p[r]}function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){g(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}h.prototype.getPluralForm=function(e,t){var r,n,o,i=this.pluralForms[e];return i||("function"!=typeof(o=(r=this.data[e][""])["Plural-Forms"]||r["plural-forms"]||r.plural_forms)&&(n=function(e){var t,r,n;for(t=e.split(";"),r=0;r<t.length;r++)if(0===(n=t[r].trim()).indexOf("plural="))return n.substr(7)}(r["Plural-Forms"]||r["plural-forms"]||r.plural_forms),o=function(e){var t=f(e);return function(e){return+t({n:e})}}(n)),i=this.pluralForms[e]=o),i(t)},h.prototype.dcnpgettext=function(e,t,r,n,o){var i,l,a;return i=void 0===o?0:this.getPluralForm(e,o),l=r,t&&(l=t+this.options.contextDelimiter+r),(a=this.data[e][l])&&a[i]?a[i]:(this.options.onMissingKey&&this.options.onMissingKey(r,e),0===i?r:n)};const b={"":{plural_forms:e=>1===e?0:1}},v=/^i18n\.(n?gettext|has_translation)(_|$)/;const y=function(e){return"string"!=typeof e||""===e?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};const x=function(e){return"string"!=typeof e||""===e?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};const _=function(e,t){return function(r,n,o){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;const l=e[t];if(!x(r))return;if(!y(n))return;if("function"!=typeof o)return void console.error("The hook callback must be a function.");if("number"!=typeof i)return void console.error("If specified, the hook priority must be a number.");const a={callback:o,priority:i,namespace:n};if(l[r]){const e=l[r].handlers;let t;for(t=e.length;t>0&&!(i>=e[t-1].priority);t--);t===e.length?e[t]=a:e.splice(t,0,a),l.__current.forEach((e=>{e.name===r&&e.currentIndex>=t&&e.currentIndex++}))}else l[r]={handlers:[a],runs:0};"hookAdded"!==r&&e.doAction("hookAdded",r,n,o,i)}};const w=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n,o){const i=e[t];if(!x(n))return;if(!r&&!y(o))return;if(!i[n])return 0;let l=0;if(r)l=i[n].handlers.length,i[n]={runs:i[n].runs,handlers:[]};else{const e=i[n].handlers;for(let t=e.length-1;t>=0;t--)e[t].namespace===o&&(e.splice(t,1),l++,i.__current.forEach((e=>{e.name===n&&e.currentIndex>=t&&e.currentIndex--})))}return"hookRemoved"!==n&&e.doAction("hookRemoved",n,o),l}};const k=function(e,t){return function(r,n){const o=e[t];return void 0!==n?r in o&&o[r].handlers.some((e=>e.namespace===n)):r in o}};const F=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(n){const o=e[t];o[n]||(o[n]={handlers:[],runs:0}),o[n].runs++;const i=o[n].handlers;for(var l=arguments.length,a=new Array(l>1?l-1:0),s=1;s<l;s++)a[s-1]=arguments[s];if(!i||!i.length)return r?a[0]:void 0;const c={name:n,currentIndex:0};for(o.__current.push(c);c.currentIndex<i.length;){const e=i[c.currentIndex].callback.apply(null,a);r&&(a[0]=e),c.currentIndex++}return o.__current.pop(),r?a[0]:void 0}};const E=function(e,t){return function(){var r,n;const o=e[t];return null!==(r=null===(n=o.__current[o.__current.length-1])||void 0===n?void 0:n.name)&&void 0!==r?r:null}};const A=function(e,t){return function(r){const n=e[t];return void 0===r?void 0!==n.__current[0]:!!n.__current[0]&&r===n.__current[0].name}};const ,H().createElement(t.ServerSideRender,{block:"filterable-portfolio/projects",attributes:r}))},save:()=>null})})()})(); -
filterable-portfolio/trunk/filterable-portfolio.php
r2760212 r2789121 4 4 * Plugin URI: https://sayfulislam.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash 5 5 * Description: A WordPress plugin to display portfolio images with filtering. 6 * Version: 1.6. 16 * Version: 1.6. 7 7 * Author: Sayful Islam 8 8 * Author URI: https://sayfulislam.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash … … 12 12 * Domain Path: /languages 13 13 * Requires at least: 5.5 14 * Tested up to: 6. 014 * Tested up to: 6. 15 15 * Requires PHP: 7.0 16 16 */ … … 47 47 * @var string 48 48 */ 49 private $version = '1.6. 1';49 private $version = '1.6.'; 50 50 51 51 /** -
filterable-portfolio/trunk/includes/class-filterable-portfolio-gutenberg-block.php
r2760212 r2789121 43 43 'isFeatured' => [ 'type' => 'boolean', 'default' => false ], 44 44 'showFilter' => [ 'type' => 'boolean', 'default' => true ], 45 45 46 'limit' => [ 46 47 'type' => 'number', … … 82 83 'featured' => $featured ? 'yes' : 'no', 83 84 'show_filter' => $show_filter ? 'yes' : 'no', 85 84 86 'responsive_classes' => [ 85 87 'columns_phone' => $columnsPhone, -
filterable-portfolio/trunk/includes/class-filterable-portfolio-helper.php
r2757596 r2789121 37 37 if ( empty( static::$options ) ) { 38 38 $defaults = [ 39 'columns' => 'l4', 40 'columns_desktop' => 'm4', 41 'columns_tablet' => 's6', 42 'columns_phone' => 'xs12', 43 'portfolio_theme' => 'two', 44 'image_size' => 'filterable-portfolio', 45 'button_color' => '#4cc1be', 46 'filter_buttons_alignment' => 'end', 47 'orderby' => 'ID', 48 'order' => 'DESC', 49 'posts_per_page' => 100, 50 'project_date_as_post_date' => 0, 51 'all_categories_text' => __( 'All', 'filterable-portfolio' ), 52 'details_button_text' => __( 'Details', 'filterable-portfolio' ), 53 'project_image_size' => 'full', 54 'show_related_projects' => 1, 55 'related_projects_number' => 4, 56 'project_description_text' => __( 'Project Description', 'filterable-portfolio' ), 57 'project_details_text' => __( 'Project Details', 'filterable-portfolio' ), 58 'project_skills_text' => __( 'Skills Needed:', 'filterable-portfolio' ), 59 'project_categories_text' => __( 'Categories:', 'filterable-portfolio' ), 60 'project_url_text' => __( 'Project URL:', 'filterable-portfolio' ), 61 'project_date_text' => __( 'Project Date:', 'filterable-portfolio' ), 62 'project_client_text' => __( 'Client:', 'filterable-portfolio' ), 63 'related_projects_text' => __( 'Related Projects', 'filterable-portfolio' ), 39 'columns' => 'l4', 40 'columns_desktop' => 'm4', 41 'columns_tablet' => 's6', 42 'columns_phone' => 'xs12', 43 'portfolio_theme' => 'two', 44 'image_size' => 'filterable-portfolio', 45 'button_color' => '#4cc1be', 46 'filter_buttons_alignment' => 'end', 47 'orderby' => 'ID', 48 'order' => 'DESC', 49 'posts_per_page' => 100, 50 'project_date_as_post_date' => 0, 51 'all_categories_text' => __( 'All', 'filterable-portfolio' ), 52 'details_button_text' => __( 'Details', 'filterable-portfolio' ), 53 'project_image_size' => 'full', 54 'category_disable_archive_link' => 0, 55 'skill_disable_archive_link' => 0, 56 'show_related_projects' => 1, 57 'related_projects_number' => 4, 58 'project_description_text' => __( 'Project Description', 'filterable-portfolio' ), 59 'project_details_text' => __( 'Project Details', 'filterable-portfolio' ), 60 'project_skills_text' => __( 'Skills Needed:', 'filterable-portfolio' ), 61 'project_categories_text' => __( 'Categories:', 'filterable-portfolio' ), 62 'project_url_text' => __( 'Project URL:', 'filterable-portfolio' ), 63 'project_date_text' => __( 'Project Date:', 'filterable-portfolio' ), 64 'project_client_text' => __( 'Client:', 'filterable-portfolio' ), 65 'related_projects_text' => __( 'Related Projects', 'filterable-portfolio' ), 64 66 ]; 65 67 $options = get_option( 'filterable_portfolio' ); … … 203 205 204 206 return wp_get_object_terms( $ids, self::CATEGORY ); 207 208 209 210 211 212 213 214 215 216 217 218 219 205 220 } 206 221 … … 443 458 if ( $prepend_lorem_text ) { 444 459 $out = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' . 445 446 460 'sed do eiusmod tempor incididunt ut labore et dolore magna ' . 461 'aliqua.'; 447 462 } 448 463 $rnd = explode( ' ', … … 525 540 return $images; 526 541 } 542 543 544 545 546 547 548 549 550 551 552 553 527 554 } -
filterable-portfolio/trunk/includes/class-filterable-portfolio-setting.php
r2757596 r2789121 252 252 ) ); 253 253 $settings->add_field( array( 254 255 256 257 258 259 260 261 262 263 264 265 266 267 254 268 'id' => 'related_projects_number', 255 269 'type' => 'number', -
filterable-portfolio/trunk/includes/class-filterable-portfolio-shapla-theme.php
r2746801 r2789121 23 23 self::$instance = new self(); 24 24 25 if ( ! Filterable_Portfolio_Helper::is_shapla_theme_activate() ) {26 return self::$instance;27 }28 29 25 // Provide single portfolio template via filter. 30 26 add_filter( 'single_template', array( self::$instance, 'single_portfolio_template' ) ); 31 27 // Provide archive portfolio template via filter. 32 28 add_filter( 'archive_template', array( self::$instance, 'archive_portfolio_template' ) ); 29 30 33 31 } 34 32 35 33 return self::$instance; 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 36 72 } 37 73 … … 44 80 */ 45 81 public function single_portfolio_template( $single_template ) { 46 if ( Filterable_Portfolio_Helper::is_single_portfolio() ) { 47 // Include template file from the theme if it exists. 48 if ( Filterable_Portfolio_Helper::has_single_template() ) { 49 return locate_template( 'single-portfolio.php' ); 50 } 82 if ( ! Filterable_Portfolio_Helper::is_single_portfolio() ) { 83 return $single_template; 84 } 51 85 52 // Include template file from the plugin. 53 $single_portfolio_template = FILTERABLE_PORTFOLIO_TEMPLATES . '/shapla/single-portfolio.php'; 54 if ( file_exists( $single_portfolio_template ) ) { 55 return $single_portfolio_template; 56 } 86 // Include template file from the theme if it exists. 87 if ( Filterable_Portfolio_Helper::has_single_template() ) { 88 return locate_template( 'single-portfolio.php' ); 89 } 90 91 if ( Filterable_Portfolio_Helper::is_shapla_theme_activate() ) { 92 return FILTERABLE_PORTFOLIO_TEMPLATES . '/shapla/single-portfolio.php'; 57 93 } 58 94 … … 68 104 */ 69 105 public function archive_portfolio_template( $archive_template ) { 70 if ( Filterable_Portfolio_Helper::is_portfolio_archive() ) { 71 if ( Filterable_Portfolio_Helper::has_archive_template() ) { 72 $templates = array( 73 'archive-portfolio.php', 74 'taxonomy-portfolio_cat.php', 75 'taxonomy-portfolio_skill.php' 76 ); 77 78 return locate_template( $templates ); 79 } else { 80 $archive_portfolio_template = FILTERABLE_PORTFOLIO_TEMPLATES . '/shapla/archive-portfolio.php'; 81 if ( file_exists( $archive_portfolio_template ) ) { 82 return $archive_portfolio_template; 83 } 84 } 106 // Exit if not portfolio archive 107 if ( ! Filterable_Portfolio_Helper::is_portfolio_archive() ) { 108 return $archive_template; 85 109 } 86 110 87 return $archive_template; 111 // Load template from theme if exists 112 if ( Filterable_Portfolio_Helper::has_archive_template() ) { 113 $templates = array( 114 'archive-portfolio.php', 115 'taxonomy-portfolio_cat.php', 116 'taxonomy-portfolio_skill.php' 117 ); 118 119 return locate_template( $templates ); 120 } 121 122 if ( Filterable_Portfolio_Helper::is_shapla_theme_activate() ) { 123 return FILTERABLE_PORTFOLIO_TEMPLATES . '/shapla/archive-portfolio.php'; 124 } 125 126 // Load default archive template 127 return FILTERABLE_PORTFOLIO_TEMPLATES . '/archive-portfolio.php'; 128 } 129 130 /** 131 * Show archive page title 132 * 133 * @return void 134 */ 135 public function do_page_title() { 136 if ( ! apply_filters( 'filterable_portfolio/show_page_title', true ) ) { 137 return; 138 } 139 ?> 140 <header class="page-header"> 141 <?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?> 142 </header><?php 143 } 144 145 /** 146 * Load loop content 147 * 148 * @return void 149 */ 150 public function do_loop_content() { 151 $_fp_class = [ 'grids', 'portfolio-items' ]; 152 $_fp_class[] = sprintf( 'fp-theme-%s', Filterable_Portfolio_Helper::get_option( 'portfolio_theme' ) ); 153 if ( have_posts() ) : ?> 154 <div class="<?php echo join( ' ', $_fp_class ); ?>"> 155 <?php 156 while ( have_posts() ) { 157 the_post(); 158 if ( ! has_post_thumbnail() ) { 159 continue; 160 } 161 Filterable_Portfolio_Helper::load_template( 'content-portfolio.php', false ); 162 } 163 ?> 164 </div> 165 <?php endif; 166 } 167 168 /** 169 * Show pagination 170 * 171 * @return void 172 */ 173 public function do_pagination() { 174 the_posts_pagination( array( 175 'type' => 'list', 176 'next_text' => _x( 'Next', 'Next post', 'storefront' ), 177 'prev_text' => _x( 'Previous', 'Previous post', 'storefront' ), 178 ) ); 88 179 } 89 180 } -
filterable-portfolio/trunk/includes/class-filterable-portfolio-shortcode.php
r2760212 r2789121 41 41 'featured' => 'no', 42 42 'show_filter' => 'yes', 43 43 44 'responsive_classes' => [], 44 45 'theme' => Filterable_Portfolio_Helper::get_option( 'portfolio_theme', 'two' ), … … 59 60 $args['featured'] = true; 60 61 } 62 63 61 64 62 65 $portfolios = Filterable_Portfolio_Helper::get_portfolios( $args ); 63 $categories = Filterable_Portfolio_Helper::get_categories_from_portfolios( $portfolios ); 66 if ( 'skills' === $filter_by ) { 67 $categories = Filterable_Portfolio_Helper::get_skills_from_portfolios( $portfolios ); 68 } else { 69 $categories = Filterable_Portfolio_Helper::get_categories_from_portfolios( $portfolios ); 70 } 64 71 65 72 ob_start(); -
filterable-portfolio/trunk/readme.txt
r2760212 r2789121 3 3 Tags: portfolio, filterable portfolio, images portfolio, portfolio gallery, portfolio plugin, filtrable portfolio, responsive portfolio, wordpress portfolio, wp portfolio, wordpress portfolio plugin, sortable portfolio, project portfolio 4 4 Requires at least: 5.5 5 Tested up to: 6. 05 Tested up to: 6. 6 6 Requires PHP: 7.0 7 Stable tag: 1.6. 17 Stable tag: 1.6. 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.txt … … 40 40 * `featured`: Default value `no`. Value can be `yes` or `no`. 41 41 * `show_filter`: Default value `yes`. Value can be `yes` or `no`. 42 42 43 * `theme`: Default value `one`. Value can be `one` or `two`. 43 44 * `buttons_alignment`: Default value `center`. Value can be `start` or `center` or `end`. … … 103 104 104 105 == Changelog == 106 107 108 109 110 105 111 106 112 = version 1.6.1 - 2022-07-22 = -
filterable-portfolio/trunk/templates/content-portfolio.php
r2760212 r2789121 23 23 24 24 $categories_slug = array(); 25 $categories = get_the_terms( get_the_ID(), 'portfolio_cat' ); 25 if ( isset( $attributes['filter_by'] ) && $attributes['filter_by'] === 'skills' ) { 26 $categories = get_the_terms( get_the_ID(), 'portfolio_skill' ); 27 } else { 28 $categories = get_the_terms( get_the_ID(), 'portfolio_cat' ); 29 } 26 30 if ( $categories && ! is_wp_error( $categories ) ) { 27 31 $categories_slug = wp_list_pluck( $categories, 'slug' ); -
filterable-portfolio/trunk/templates/portfolio-meta.php
r2746801 r2789121 7 7 $option = Filterable_Portfolio_Helper::get_options(); 8 8 9 $id 10 $client_name 11 $project_url 12 $project_date 9 $id = get_the_ID(); 10 $client_name = get_post_meta( $id, '_client_name', true ); 11 $project_url = get_post_meta( $id, '_project_url', true ); 12 $project_date = get_post_meta( $id, '_project_date', true ); 13 13 if ( $project_date ) { 14 14 $project_date = date_i18n( get_option( 'date_format' ), strtotime( $project_date ) ); … … 22 22 <div class="portfolio-meta"> 23 23 <?php if ( ! empty( $option['project_details_text'] ) ) { ?> 24 24 <h4 class="portfolio-meta-title"><?php echo esc_html( $option['project_details_text'] ); ?></h4> 25 25 <?php } ?> 26 26 <div class="portfolio-meta-list"> 27 27 <?php if ( count( $skills_names ) ) { ?> 28 29 30 28 <div class="portfolio-meta-list-item"> 29 <strong><?php echo esc_html( $option['project_skills_text'] ); ?></strong> 30 <p> 31 31 <?php 32 if ( $support_archive) {32 if ( ) { 33 33 $skills = get_the_term_list( $id, 'portfolio_skill', '', '<br>', '' ); 34 34 echo $skills; … … 39 39 } 40 40 ?> 41 42 41 </p> 42 </div> 43 43 <?php } ?> 44 44 <?php if ( count( $categories_names ) ) { ?> 45 46 47 45 <div class="portfolio-meta-list-item"> 46 <strong><?php echo esc_html( $option['project_categories_text'] ); ?></strong> 47 <p> 48 48 <?php 49 if ( $support_archive) {49 if ( ) { 50 50 $skills = get_the_term_list( $id, 'portfolio_cat', '', '<br>', '' ); 51 51 echo $skills; … … 56 56 } 57 57 ?> 58 59 58 </p> 59 </div> 60 60 <?php } ?> 61 61 <?php if ( ! empty( $client_name ) ) { ?> 62 63 64 65 62 <div class="portfolio-meta-list-item"> 63 <strong><?php echo esc_html( $option['project_client_text'] ); ?></strong> 64 <p><?php echo esc_html( $client_name ) ?></p> 65 </div> 66 66 <?php } ?> 67 67 <?php if ( ! empty( $project_date ) ) { ?> 68 69 70 71 68 <div class="portfolio-meta-list-item"> 69 <strong><?php echo esc_html( $option['project_date_text'] ); ?></strong> 70 <p><?php echo esc_html( $project_date ) ?></p> 71 </div> 72 72 <?php } ?> 73 73 <?php if ( ! empty( $project_url ) ) { ?> 74 75 76 77 74 <div class="portfolio-meta-list-item"> 75 <strong><?php echo esc_html( $option['project_url_text'] ); ?></strong> 76 <p> 77 <a target="_blank" href="<?php echo esc_url( $project_url ) ?>" rel="nofollow"> 78 78 <?php echo esc_url( $project_url ) ?> 79 80 81 79 </a> 80 </p> 81 </div> 82 82 <?php } ?> 83 83 </div> 84 84 </div> -
filterable-portfolio/trunk/templates/single-portfolio.php
r2746801 r2789121 5 5 } 6 6 7 $options = Filterable_Portfolio_Helper::get_options(); 7 $options = Filterable_Portfolio_Helper::get_options(); 8 $id = get_the_ID(); 9 $project_images = get_post_meta( $id, '_project_images', true ); 10 $project_images = array_filter( explode( ',', rtrim( $project_images, ',' ) ) ); 8 11 ?> 9 12 <div class="single-portfolio-content"> 10 13 <?php 11 $template = FILTERABLE_PORTFOLIO_TEMPLATES . '/portfolio-slider.php'; 12 load_template( $template, false ); 14 if ( count( $project_images ) > 0 ) { 15 load_template( FILTERABLE_PORTFOLIO_TEMPLATES . '/portfolio-slider.php' ); 16 } elseif ( has_post_thumbnail() ) { 17 the_post_thumbnail(); 18 } 13 19 ?> 14 <div class="grids"> 15 <div class="project-content grid s8"> 16 <h4><?php echo esc_attr( $options['project_description_text'] ); ?></h4> 17 <?php do_action( 'filterable_portfolio_before_single_portfolio_content' ); ?> 18 <?php echo do_shortcode( get_the_content() ); ?> 19 <?php do_action( 'filterable_portfolio_after_single_portfolio_content' ); ?> 20 </div> 21 <div class="project-meta grid s4"> 22 <?php do_action( 'filterable_portfolio_before_single_portfolio_meta' ); ?> 23 <?php 24 $template = FILTERABLE_PORTFOLIO_TEMPLATES . '/portfolio-meta.php'; 25 load_template( $template, false ); 26 ?> 27 <?php do_action( 'filterable_portfolio_after_single_portfolio_meta' ); ?> 28 </div> 29 </div> 20 <div class="grids"> 21 <div class="project-content grid s8"> 22 <h4><?php echo esc_attr( $options['project_description_text'] ); ?></h4> 23 <?php do_action( 'filterable_portfolio_before_single_portfolio_content' ); ?> 24 <?php echo do_shortcode( get_the_content() ); ?> 25 <?php do_action( 'filterable_portfolio_after_single_portfolio_content' ); ?> 26 </div> 27 <div class="project-meta grid s4"> 28 <?php do_action( 'filterable_portfolio_before_single_portfolio_meta' ); ?> 29 <?php 30 load_template( FILTERABLE_PORTFOLIO_TEMPLATES . '/portfolio-meta.php' ); 31 ?> 32 <?php do_action( 'filterable_portfolio_after_single_portfolio_meta' ); ?> 33 </div> 34 </div> 30 35 <?php 31 36 if ( isset( $options['show_related_projects'] ) && $options['show_related_projects'] ) { 32 $template = FILTERABLE_PORTFOLIO_TEMPLATES . '/related-portfolio.php'; 33 load_template( $template, false ); 37 load_template( FILTERABLE_PORTFOLIO_TEMPLATES . '/related-portfolio.php' ); 34 38 } 35 39 ?>
Note: See TracChangeset
for help on using the changeset viewer.