1930795f by Jeremy Groot

CPT UI

1 parent 7e7ce19d
Showing 32 changed files with 2048 additions and 0 deletions
1 postboxes.add_postbox_toggles(pagenow);
2
3 (function($) {
4 $("#cptui_select_post_type_submit").hide();
5 $("#cptui_select_taxonomy_submit").hide();
6 if ("edit" === getParameterByName("action")) {
7 var original_slug = $("#name").val();
8 }
9 $("#hierarchical").on("change", function() {
10 var hierarchical = $(this).val();
11 if ("1" === hierarchical) {
12 $("#page-attributes").prop("checked", true);
13 } else {
14 $("#page-attributes").prop("checked", false);
15 }
16 });
17 $("#post_type").on("change", function() {
18 $("#cptui_select_post_type").submit();
19 });
20 $("#taxonomy").on("change", function() {
21 $("#cptui_select_taxonomy").submit();
22 });
23 $(".cptui-delete-top, .cptui-delete-bottom").on("click", function(e) {
24 e.preventDefault();
25 var msg = "";
26 if (typeof cptui_type_data !== "undefined") {
27 msg = cptui_type_data.confirm;
28 } else if (typeof cptui_tax_data !== "undefined") {
29 msg = cptui_tax_data.confirm;
30 }
31 var submit_delete_warning = $('<div class="cptui-submit-delete-dialog">' + msg + "</div>").appendTo("#poststuff").dialog({
32 dialogClass: "wp-dialog",
33 modal: true,
34 autoOpen: true,
35 buttons: {
36 OK: function() {
37 var form = $(e.target).closest("form");
38 $(e.target).off("click").click();
39 },
40 Cancel: function() {
41 $(this).dialog("close");
42 }
43 }
44 });
45 });
46 $("#support .question").each(function() {
47 var tis = $(this), state = false, answer = tis.next("div").slideUp();
48 tis.on("click keydown", function(e) {
49 if (e.type === "keydown" && e.keyCode !== 32 && e.keyCode !== 13) {
50 return;
51 }
52 e.preventDefault();
53 state = !state;
54 answer.slideToggle(state);
55 tis.toggleClass("active", state);
56 tis.attr("aria-expanded", state.toString());
57 tis.focus();
58 });
59 });
60 $("#name").on("keyup", function(e) {
61 var value, original_value;
62 value = original_value = $(this).val();
63 if (e.keyCode !== 9 && e.keyCode !== 37 && e.keyCode !== 38 && e.keyCode !== 39 && e.keyCode !== 40) {
64 value = value.replace(/ /g, "_");
65 value = value.toLowerCase();
66 value = replaceDiacritics(value);
67 value = transliterate(value);
68 value = replaceSpecialCharacters(value);
69 if (value !== original_value) {
70 $(this).prop("value", value);
71 }
72 }
73 if (typeof original_slug !== "undefined") {
74 var $slugchanged = $("#slugchanged");
75 if (value != original_slug) {
76 $slugchanged.removeClass("hidemessage");
77 } else {
78 $slugchanged.addClass("hidemessage");
79 }
80 }
81 var $slugexists = $("#slugexists");
82 if (typeof cptui_type_data != "undefined") {
83 if (cptui_type_data.existing_post_types.hasOwnProperty(value) && value !== original_slug) {
84 $slugexists.removeClass("hidemessage");
85 } else {
86 $slugexists.addClass("hidemessage");
87 }
88 }
89 if (typeof cptui_tax_data != "undefined") {
90 if (cptui_tax_data.existing_taxonomies.hasOwnProperty(value) && value !== original_slug) {
91 $slugexists.removeClass("hidemessage");
92 } else {
93 $slugexists.addClass("hidemessage");
94 }
95 }
96 });
97 function replaceDiacritics(s) {
98 var diacritics = [ /[\300-\306]/g, /[\340-\346]/g, /[\310-\313]/g, /[\350-\353]/g, /[\314-\317]/g, /[\354-\357]/g, /[\322-\330]/g, /[\362-\370]/g, /[\331-\334]/g, /[\371-\374]/g, /[\321]/g, /[\361]/g, /[\307]/g, /[\347]/g ];
99 var chars = [ "A", "a", "E", "e", "I", "i", "O", "o", "U", "u", "N", "n", "C", "c" ];
100 for (var i = 0; i < diacritics.length; i++) {
101 s = s.replace(diacritics[i], chars[i]);
102 }
103 return s;
104 }
105 function replaceSpecialCharacters(s) {
106 s = s.replace(/[^a-z0-9\s-]/gi, "_");
107 return s;
108 }
109 function composePreviewContent(value) {
110 var re = /(http|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/;
111 var is_url = re.test(value);
112 if (!value) {
113 return "";
114 } else if (0 === value.indexOf("dashicons-")) {
115 return $('<div class="dashicons-before"><br></div>').addClass(htmlEncode(value));
116 } else if (is_url) {
117 var imgsrc = encodeURI(value);
118 var theimg = document.createElement("IMG");
119 theimg.src = imgsrc;
120 return theimg;
121 }
122 }
123 function htmlEncode(str) {
124 return String(str).replace(/[^-\w. ]/gi, function(c) {
125 return "&#" + c.charCodeAt(0) + ";";
126 });
127 }
128 var cyrillic = {
129 "Ё": "YO",
130 "Й": "I",
131 "Ц": "TS",
132 "У": "U",
133 "К": "K",
134 "Е": "E",
135 "Н": "N",
136 "Г": "G",
137 "Ш": "SH",
138 "Щ": "SCH",
139 "З": "Z",
140 "Х": "H",
141 "Ъ": "'",
142 "ё": "yo",
143 "й": "i",
144 "ц": "ts",
145 "у": "u",
146 "к": "k",
147 "е": "e",
148 "н": "n",
149 "г": "g",
150 "ш": "sh",
151 "щ": "sch",
152 "з": "z",
153 "х": "h",
154 "ъ": "'",
155 "Ф": "F",
156 "Ы": "I",
157 "В": "V",
158 "А": "a",
159 "П": "P",
160 "Р": "R",
161 "О": "O",
162 "Л": "L",
163 "Д": "D",
164 "Ж": "ZH",
165 "Э": "E",
166 "ф": "f",
167 "ы": "i",
168 "в": "v",
169 "а": "a",
170 "п": "p",
171 "р": "r",
172 "о": "o",
173 "л": "l",
174 "д": "d",
175 "ж": "zh",
176 "э": "e",
177 "Я": "Ya",
178 "Ч": "CH",
179 "С": "S",
180 "М": "M",
181 "И": "I",
182 "Т": "T",
183 "Ь": "'",
184 "Б": "B",
185 "Ю": "YU",
186 "я": "ya",
187 "ч": "ch",
188 "с": "s",
189 "м": "m",
190 "и": "i",
191 "т": "t",
192 "ь": "'",
193 "б": "b",
194 "ю": "yu"
195 };
196 function transliterate(word) {
197 return word.split("").map(function(char) {
198 return cyrillic[char] || char;
199 }).join("");
200 }
201 if (undefined != wp.media) {
202 var _custom_media = true, _orig_send_attachment = wp.media.editor.send.attachment;
203 }
204 function getParameterByName(name, url) {
205 if (!url) url = window.location.href;
206 name = name.replace(/[\[\]]/g, "\\$&");
207 var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url);
208 if (!results) return null;
209 if (!results[2]) return "";
210 return decodeURIComponent(results[2].replace(/\+/g, " "));
211 }
212 $("#cptui_choose_icon").on("click", function(e) {
213 e.preventDefault();
214 var button = $(this);
215 var id = jQuery("#menu_icon").attr("id");
216 _custom_media = true;
217 wp.media.editor.send.attachment = function(props, attachment) {
218 if (_custom_media) {
219 $("#" + id).val(attachment.url).change();
220 } else {
221 return _orig_send_attachment.apply(this, [ props, attachment ]);
222 }
223 };
224 wp.media.editor.open(button);
225 return false;
226 });
227 $("#menu_icon").on("change", function() {
228 var value = $(this).val();
229 value = value.trim();
230 $("#menu_icon_preview").html(composePreviewContent(value));
231 });
232 $(".cptui-help").on("click", function(e) {
233 e.preventDefault();
234 });
235 $(".cptui-taxonomy-submit").on("click", function(e) {
236 if ($(".cptui-table :checkbox:checked").length == 0) {
237 e.preventDefault();
238 var no_associated_type_warning = $('<div class="cptui-taxonomy-empty-types-dialog">' + cptui_tax_data.no_associated_type + "</div>").appendTo("#poststuff").dialog({
239 dialogClass: "wp-dialog",
240 modal: true,
241 autoOpen: true,
242 buttons: {
243 OK: function() {
244 $(this).dialog("close");
245 }
246 }
247 });
248 }
249 });
250 $("#auto-populate").on("click tap", function(e) {
251 e.preventDefault();
252 var slug = $("#name").val();
253 var plural = $("#label").val();
254 var singular = $("#singular_label").val();
255 var fields = $('.cptui-labels input[type="text"]');
256 if ("" === slug) {
257 return;
258 }
259 if ("" === plural) {
260 plural = slug;
261 }
262 if ("" === singular) {
263 singular = slug;
264 }
265 $(fields).each(function(i, el) {
266 var newval = $(el).data("label");
267 var plurality = $(el).data("plurality");
268 if ("undefined" !== newval) {
269 if ("plural" === plurality) {
270 newval = newval.replace(/item/gi, plural);
271 } else {
272 newval = newval.replace(/item/gi, singular);
273 }
274 if ($(el).val() === "") {
275 $(el).val(newval);
276 }
277 }
278 });
279 });
280 $("#auto-clear").on("click tap", function(e) {
281 e.preventDefault();
282 var fields = $('.cptui-labels input[type="text"]');
283 $(fields).each(function(i, el) {
284 $(el).val("");
285 });
286 });
287 })(jQuery);
...\ No newline at end of file ...\ No newline at end of file
1 postboxes.add_postbox_toggles(pagenow),function(c){var i;function t(e){var t=/(http|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/.test(e);return e?0===e.indexOf("dashicons-")?c('<div class="dashicons-before"><br></div>').addClass(String(e).replace(/[^-\w. ]/gi,function(e){return"&#"+e.charCodeAt(0)+";"})):t?(t=encodeURI(e),(e=document.createElement("IMG")).src=t,e):void 0:""}c("#cptui_select_post_type_submit").hide(),c("#cptui_select_taxonomy_submit").hide(),"edit"===function(e,t){t=t||window.location.href;e=e.replace(/[\[\]]/g,"\\$&");e=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return e?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null}("action")&&(i=c("#name").val()),c("#hierarchical").on("change",function(){"1"===c(this).val()?c("#page-attributes").prop("checked",!0):c("#page-attributes").prop("checked",!1)}),c("#post_type").on("change",function(){c("#cptui_select_post_type").submit()}),c("#taxonomy").on("change",function(){c("#cptui_select_taxonomy").submit()}),c(".cptui-delete-top, .cptui-delete-bottom").on("click",function(e){e.preventDefault();var t="";"undefined"!=typeof cptui_type_data?t=cptui_type_data.confirm:"undefined"!=typeof cptui_tax_data&&(t=cptui_tax_data.confirm),c('<div class="cptui-submit-delete-dialog">'+t+"</div>").appendTo("#poststuff").dialog({dialogClass:"wp-dialog",modal:!0,autoOpen:!0,buttons:{OK:function(){c(e.target).closest("form");c(e.target).off("click").click()},Cancel:function(){c(this).dialog("close")}}})}),c("#support .question").each(function(){var t=c(this),a=!1,i=t.next("div").slideUp();t.on("click keydown",function(e){"keydown"===e.type&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),a=!a,i.slideToggle(a),t.toggleClass("active",a),t.attr("aria-expanded",a.toString()),t.focus())})}),c("#name").on("keyup",function(e){var t=a=c(this).val(),a=(9!==e.keyCode&&37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&40!==e.keyCode&&(t=(t=function(e){for(var t=[/[\300-\306]/g,/[\340-\346]/g,/[\310-\313]/g,/[\350-\353]/g,/[\314-\317]/g,/[\354-\357]/g,/[\322-\330]/g,/[\362-\370]/g,/[\331-\334]/g,/[\371-\374]/g,/[\321]/g,/[\361]/g,/[\307]/g,/[\347]/g],a=["A","a","E","e","I","i","O","o","U","u","N","n","C","c"],i=0;i<t.length;i++)e=e.replace(t[i],a[i]);return e}(t=(t=t.replace(/ /g,"_")).toLowerCase())).split("").map(function(e){return s[e]||e}).join(""),(t=t.replace(/[^a-z0-9\s-]/gi,"_"))!==a&&c(this).prop("value",t)),void 0!==i&&(e=c("#slugchanged"),t!=i?e.removeClass("hidemessage"):e.addClass("hidemessage")),c("#slugexists"));"undefined"!=typeof cptui_type_data&&(cptui_type_data.existing_post_types.hasOwnProperty(t)&&t!==i?a.removeClass("hidemessage"):a.addClass("hidemessage")),"undefined"!=typeof cptui_tax_data&&(cptui_tax_data.existing_taxonomies.hasOwnProperty(t)&&t!==i?a.removeClass("hidemessage"):a.addClass("hidemessage"))});var n,o,s={"Ё":"YO","Й":"I","Ц":"TS","У":"U","К":"K","Е":"E","Н":"N","Г":"G","Ш":"SH","Щ":"SCH","З":"Z","Х":"H","Ъ":"'","ё":"yo","й":"i","ц":"ts","у":"u","к":"k","е":"e","н":"n","г":"g","ш":"sh","щ":"sch","з":"z","х":"h","ъ":"'","Ф":"F","Ы":"I","В":"V","А":"a","П":"P","Р":"R","О":"O","Л":"L","Д":"D","Ж":"ZH","Э":"E","ф":"f","ы":"i","в":"v","а":"a","п":"p","р":"r","о":"o","л":"l","д":"d","ж":"zh","э":"e","Я":"Ya","Ч":"CH","С":"S","М":"M","И":"I","Т":"T","Ь":"'","Б":"B","Ю":"YU","я":"ya","ч":"ch","с":"s","м":"m","и":"i","т":"t","ь":"'","б":"b","ю":"yu"};null!=wp.media&&(n=!0,o=wp.media.editor.send.attachment),c("#cptui_choose_icon").on("click",function(e){e.preventDefault();var e=c(this),a=jQuery("#menu_icon").attr("id");return n=!0,wp.media.editor.send.attachment=function(e,t){if(!n)return o.apply(this,[e,t]);c("#"+a).val(t.url).change()},wp.media.editor.open(e),!1}),c("#menu_icon").on("change",function(){var e=(e=c(this).val()).trim();c("#menu_icon_preview").html(t(e))}),c(".cptui-help").on("click",function(e){e.preventDefault()}),c(".cptui-taxonomy-submit").on("click",function(e){0==c(".cptui-table :checkbox:checked").length&&(e.preventDefault(),c('<div class="cptui-taxonomy-empty-types-dialog">'+cptui_tax_data.no_associated_type+"</div>").appendTo("#poststuff").dialog({dialogClass:"wp-dialog",modal:!0,autoOpen:!0,buttons:{OK:function(){c(this).dialog("close")}}}))}),c("#auto-populate").on("click tap",function(e){e.preventDefault();var e=c("#name").val(),n=c("#label").val(),o=c("#singular_label").val(),t=c('.cptui-labels input[type="text"]');""!==e&&(""===n&&(n=e),""===o&&(o=e),c(t).each(function(e,t){var a=c(t).data("label"),i=c(t).data("plurality");"undefined"!==a&&(a="plural"===i?a.replace(/item/gi,n):a.replace(/item/gi,o),""===c(t).val()&&c(t).val(a))}))}),c("#auto-clear").on("click tap",function(e){e.preventDefault();e=c('.cptui-labels input[type="text"]');c(e).each(function(e,t){c(t).val("")})})}(jQuery);
...\ No newline at end of file ...\ No newline at end of file
1 {"version":3,"sources":["src/js/cptui-scripts.js"],"names":["postboxes","add_postbox_toggles","pagenow","$","original_slug","composePreviewContent","value","is_url","test","indexOf","addClass","String","replace","c","charCodeAt","imgsrc","encodeURI","theimg","document","createElement","src","hide","name","url","window","location","href","results","RegExp","exec","decodeURIComponent","getParameterByName","val","on","this","prop","submit","e","preventDefault","msg","cptui_type_data","confirm","cptui_tax_data","appendTo","dialog","dialogClass","modal","autoOpen","buttons","OK","target","closest","off","click","Cancel","each","tis","state","answer","next","slideUp","type","keyCode","slideToggle","toggleClass","attr","toString","focus","original_value","$slugexists","s","diacritics","chars","i","length","replaceDiacritics","toLowerCase","split","map","char","cyrillic","join","$slugchanged","removeClass","existing_post_types","hasOwnProperty","existing_taxonomies","_custom_media","_orig_send_attachment","Ё","Й","Ц","У","К","Е","Н","Г","Ш","Щ","З","Х","Ъ","ё","й","ц","у","к","е","н","г","ш","щ","з","х","ъ","Ф","Ы","В","А","П","Р","О","Л","Д","Ж","Э","ф","ы","в","а","п","р","о","л","д","ж","э","Я","Ч","С","М","И","Т","Ь","Б","Ю","я","ч","с","м","и","т","ь","б","ю","undefined","wp","media","editor","send","attachment","button","id","jQuery","props","apply","change","open","trim","html","no_associated_type","slug","plural","singular","fields","el","newval","data","plurality"],"mappings":"AAGAA,UAAUC,oBAAoBC,SAK9B,SAAUC,GAKT,IAEKC,EAqIL,SAASC,EAAsBC,GAE9B,IACIC,EADK,4EACOC,KAAKF,GAErB,OAAKA,EAEM,IAAMA,EAAMG,QAAQ,cACvBN,EAAE,4CAA4CO,SAU/CC,OAVmEL,GAUvDM,QAAQ,aAAc,SAAUC,GAClD,MAAO,KAAOA,EAAEC,WAAW,GAAK,OAVrBP,GACPQ,EAASC,UAAUV,IACnBW,EAASC,SAASC,cAAc,QAC7BC,IAAML,EACNE,QAJD,EAHC,GAhJTd,EAAE,kCAAkCkB,OACpClB,EAAE,iCAAiCkB,OAE/B,SA6KJ,SAA4BC,EAAMC,GACvBA,EAALA,GAAWC,OAAOC,SAASC,KAChCJ,EAAOA,EAAKV,QAAQ,UAAW,QAE9Be,EADW,IAAIC,OAAO,OAASN,EAAO,qBACtBO,KAAKN,GACtB,OAAKI,EACAA,EAAQ,GACNG,mBAAmBH,EAAQ,GAAGf,QAAQ,MAAO,MAD5B,GADH,KAlLPmB,CAAmB,YAE7B3B,EAAgBD,EAAE,SAAS6B,OAKhC7B,EAAE,iBAAiB8B,GAAG,SAAU,WAE3B,MADe9B,EAAE+B,MAAMF,MAE1B7B,EAAE,oBAAoBgC,KAAK,WAAW,GAEtChC,EAAE,oBAAoBgC,KAAK,WAAW,KAKxChC,EAAE,cAAc8B,GAAG,SAA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,CAClKC,YAAkB,YAClBC,OAAkB,EAClBC,UAAkB,EAClBC,QAAkB,CACjBC,GAAM,WACL9C,EAAE+B,MAAMU,OAAO,gBAOpBzC,EAAE,kBAAkB8B,GAAI,YAAa,SAASI,GAC7CA,EAAEC,iBAEF,IAAIqI,EAAWxK,EAAE,SAAS6B,MACtB4I,EAAWzK,EAAE,UAAU6B,MACvB6I,EAAW1K,EAAE,mBAAmB6B,MAChC8I,EAAW3K,EAAE,oCAEZ,KAAOwK,IAGP,KAAOC,IACXA,EAASD,GAEL,KAAOE,IACXA,EAAWF,GAGZxK,EAAE2K,GAAQvH,KAAM,SAAUkB,EAAGsG,GAC5B,IAAIC,EAAS7K,EAAG4K,GAAKE,KAAM,SACvBC,EAAY/K,EAAG4K,GAAKE,KAAM,aACzB,cAAgBD,IAGnBA,EADI,WAAaE,EACRF,EAAOpK,QAAQ,SAAUgK,GAEzBI,EAAOpK,QAAQ,SAAUiK,GAEZ,KAAlB1K,EAAG4K,GAAK/I,OACZ7B,EAAE4K,GAAI/I,IAAIgJ,SAMd7K,EAAE,eAAe8B,GAAI,YAAa,SAASI,GAC1CA,EAAEC,iBAEEwI,EAAS3K,EAAE,oCAEfA,EAAE2K,GAAQvH,KAAM,SAAUkB,EAAGsG,GAC5B5K,EAAE4K,GAAI/I,IAAI,QAjRb,CAqRGmI"}
...\ No newline at end of file ...\ No newline at end of file
1 .posttypesui, .taxonomiesui {
2 width: calc(100% - 300px); }
3 .posttypesui .cptui-section:first-child, .taxonomiesui .cptui-section:first-child {
4 margin-top: 30px; }
5 .posttypesui .postbox-container, .taxonomiesui .postbox-container {
6 width: 100%; }
7 .posttypesui .postbox .toggle-indicator:before, .taxonomiesui .postbox .toggle-indicator:before {
8 content: "\f142";
9 display: inline-block;
10 font: normal 20px/1 dashicons;
11 speak: none;
12 -webkit-font-smoothing: antialiased;
13 -moz-osx-font-smoothing: grayscale;
14 text-decoration: none !important; }
15 .posttypesui .postbox.closed .handlediv .toggle-indicator::before, .taxonomiesui .postbox.closed .handlediv .toggle-indicator::before {
16 content: "\f140"; }
17 .posttypesui .postbox .hndle, .taxonomiesui .postbox .hndle {
18 cursor: pointer; }
19 .posttypesui .required, .taxonomiesui .required {
20 color: red; }
21
22 .cptui-table td.outer {
23 vertical-align: top;
24 width: 50%; }
25
26 .cptui-table input[type="text"] {
27 width: 75%; }
28
29 .cptui-table .question:hover {
30 cursor: pointer; }
31
32 .cptui-table th p {
33 font-weight: 400;
34 font-size: 12px; }
35
36 .cptui-table .cptui-slug-details {
37 margin-top: 15px; }
38
39 .cptui-table #slugchanged, .cptui-table #slugexists {
40 color: red;
41 font-weight: bold; }
42 .cptui-table #slugchanged.hidemessage, .cptui-table #slugexists.hidemessage {
43 display: none; }
44
45 .cptui-support #support .question {
46 font-size: 18px;
47 font-weight: bold; }
48 .cptui-support #support .question:before {
49 content: "\f139";
50 display: inline-block;
51 font: normal 25px/1 'dashicons';
52 margin-left: -25px;
53 position: absolute;
54 -webkit-font-smoothing: antialiased; }
55 .cptui-support #support .question.active:before {
56 content: "\f140"; }
57
58 .cptui-support #support .answer {
59 margin: 10px 0 0 20px; }
60
61 .cptui-support #support ol li {
62 list-style: none; }
63
64 .cptui-support #support li {
65 position: relative; }
66
67 .cptui-field-description {
68 font-style: italic; }
69
70 #cptui_select_post_type,
71 #cptui_select_taxonomy {
72 margin-top: 15px; }
73
74 .cptui_post_import,
75 .cptui_tax_import {
76 height: 200px;
77 margin-bottom: 10px;
78 resize: vertical;
79 width: 100%; }
80
81 .cptui_post_type_get_code,
82 .cptui_tax_get_code {
83 height: 300px;
84 resize: vertical; }
85
86 .about-wrap .cptui-feature {
87 overflow: visible !important;
88 *zoom: 1; }
89 .about-wrap .cptui-feature:before, .about-wrap .cptui-feature:after {
90 content: " ";
91 display: table; }
92 .about-wrap .cptui-feature:after {
93 clear: both; }
94
95 .about-wrap h3 + .cptui-feature {
96 margin-top: 0; }
97
98 .about-wrap .changelog h2 {
99 text-align: center; }
100
101 .about-wrap .feature-rest div {
102 width: 50% !important;
103 padding-right: 100px;
104 -moz-box-sizing: border-box;
105 box-sizing: border-box;
106 margin: 0 !important; }
107 .about-wrap .feature-rest div.last-feature {
108 padding-left: 100px;
109 padding-right: 0; }
110 .about-wrap .feature-rest div.icon {
111 width: 0 !important;
112 padding: 0;
113 margin: 0; }
114 .about-wrap .feature-rest div.icon:before {
115 font-weight: normal;
116 width: 100%;
117 font-size: 170px;
118 line-height: 125px;
119 color: #9c5d90;
120 display: inline-block;
121 position: relative;
122 text-align: center;
123 speak: none;
124 margin: 0 0 0 -100px;
125 content: "\e01d";
126 -webkit-font-smoothing: antialiased;
127 -moz-osx-font-smoothing: grayscale; }
128
129 .about-wrap .about-integrations {
130 background: #fff;
131 margin: 20px 0;
132 padding: 1px 20px 10px; }
133
134 .about-wrap .changelog h4 {
135 line-height: 1.4; }
136
137 .about-wrap .cptui-about-text {
138 margin-bottom: 1em !important;
139 margin-right: 0;
140 max-width: calc(100% - 173px); }
141
142 .email-octopus-form-row input::placeholder {
143 color: #cccccc; }
144
145 .email-octopus-form-row-hp {
146 visibility: hidden; }
147
148 .cptui-intro-devblock {
149 display: flex;
150 flex-direction: row; }
151
152 .cptui-help {
153 color: #424242;
154 margin-left: 4px;
155 opacity: 0.5;
156 text-decoration: none;
157 width: 16px; }
158 fieldset .cptui-help {
159 position: relative;
160 top: 4px; }
161 .cptui-help:hover {
162 color: #0074a2;
163 opacity: 1; }
164 .cptui-help:focus {
165 box-shadow: none; }
166
167 #menu_icon_preview {
168 float: right;
169 padding-left: 8px; }
170 #menu_icon_preview img {
171 display: block;
172 height: 20px;
173 width: 20px; }
174
175 .visuallyhidden {
176 position: absolute;
177 left: -10000px;
178 top: auto;
179 width: 1px;
180 height: 1px;
181 overflow: hidden; }
182
183 .cptui-spacer {
184 display: block;
185 margin-top: 25px; }
186
187 .email-octopus-form-wrapper {
188 background: #fff;
189 margin-bottom: 10px;
190 padding: 20px; }
191 .email-octopus-form-wrapper label {
192 margin-bottom: 10px; }
193
194 .wdsoctosignup h2 {
195 text-align: left; }
196
197 .wdspromos {
198 float: right;
199 margin-left: 20px;
200 margin-top: 10px;
201 width: 275px; }
202
203 .wdspromos-about {
204 display: -ms-flexbox;
205 display: -webkit-flex;
206 display: flex;
207 -webkit-flex-direction: row;
208 -ms-flex-direction: row;
209 flex-direction: row;
210 -webkit-flex-wrap: nowrap;
211 -ms-flex-wrap: nowrap;
212 flex-wrap: nowrap;
213 -webkit-justify-content: space-between;
214 -ms-flex-pack: justify;
215 justify-content: space-between;
216 -webkit-align-content: stretch;
217 align-content: stretch;
218 -webkit-align-items: flex-start;
219 -ms-flex-align: start;
220 align-items: flex-start;
221 margin: 20px 0; }
222 .wdspromos-about a:nth-child(1) {
223 -ms-flex-order: 0;
224 order: 0;
225 -webkit-flex: 0 1 auto;
226 -ms-flex: 0 1 auto;
227 flex: 0 1 auto;
228 -webkit-align-self: auto;
229 align-self: auto; }
230 .wdspromos-about a:nth-child(2) {
231 -ms-flex-order: 0;
232 order: 0;
233 -webkit-flex: 0 1 auto;
234 -ms-flex: 0 1 auto;
235 flex: 0 1 auto;
236 -webkit-align-self: auto;
237 align-self: auto; }
238 .wdspromos-about a:nth-child(3) {
239 -ms-flex-order: 0;
240 order: 0;
241 -webkit-flex: 0 1 auto;
242 -ms-flex: 0 1 auto;
243 flex: 0 1 auto;
244 -webkit-align-self: auto;
245 align-self: auto; }
246 .wdspromos-about p {
247 padding: 0 5px; }
248 .wdspromos-about p:nth-child(1) {
249 padding-left: 0; }
250 .wdspromos-about p:nth-child(4) {
251 padding-right: 0; }
252
253 .no-js #cptui_choose_icon {
254 display: none; }
255
256 .cptui-listings th {
257 font-weight: bold; }
258
259 .cptui-listings .post-type-listing th {
260 width: 16.66667%; }
261
262 .cptui-listings .taxonomy-listing th {
263 width: 20%; }
264
265 #poststuff {
266 min-width: 463px; }
267
268 .dashicon-picker-container {
269 position: absolute;
270 width: 220px;
271 height: 252px;
272 font-size: 14px;
273 background-color: #fff;
274 box-shadow: -1px 2px 5px 3px rgba(0, 0, 0, 0.41);
275 overflow: hidden;
276 padding: 5px;
277 box-sizing: border-box; }
278 .dashicon-picker-container ul {
279 margin: 0 0 10px;
280 padding: 0; }
281 .dashicon-picker-container ul .dashicons {
282 width: 20px;
283 height: 20px;
284 font-size: 20px; }
285 .dashicon-picker-container ul li {
286 display: inline-block;
287 margin: 5px;
288 float: left; }
289 .dashicon-picker-container ul li a {
290 display: block;
291 text-decoration: none;
292 color: #373737;
293 padding: 5px 5px;
294 border: 1px solid #dfdfdf; }
295 .dashicon-picker-container ul li a:hover {
296 border-color: #999;
297 background: #efefef; }
298
299 .dashicon-picker-control {
300 height: 32px; }
301 .dashicon-picker-control a {
302 padding: 5px;
303 text-decoration: none;
304 line-height: 32px;
305 width: 25px; }
306 .dashicon-picker-control a span {
307 display: inline;
308 vertical-align: middle; }
309 .dashicon-picker-control input {
310 font-size: 12px;
311 width: 140px; }
312
313 @media screen and (min-width: 769px) {
314 .cptui-badge {
315 margin-top: -42px;
316 height: 173px;
317 width: 173px;
318 color: #fafafa;
319 font-weight: bold;
320 font-size: 14px;
321 text-align: center;
322 margin-bottom: 10px;
323 background: url(../images/cptui-icon-173x173.png) no-repeat;
324 background-size: contain; } }
325
326 @media screen and (max-width: 768px) {
327 .cptui-table #description {
328 width: 100%; }
329 .wdspromos-about {
330 flex-wrap: wrap; }
331 .wdspromos-about p {
332 margin: 5px auto; }
333 .wdspromos-about p:nth-child(1) {
334 padding-left: 5px; }
335 .wdspromos-about p:nth-child(4) {
336 padding-right: 5px; }
337 .cptui-table td.outer {
338 width: 100%; }
339 #cptui_debug_info_email {
340 width: 100%; } }
341
342 /*# sourceMappingURL=cptui-styles.css.map */
...\ No newline at end of file ...\ No newline at end of file
1 {
2 "version": 3,
3 "file": "cptui-styles.css",
4 "sources": [
5 "../src/scss/cptui-styles.scss"
6 ],
7 "names": [],
8 "mappings": "AAGA,AAAA,YAAY,EAAE,aAAa,CAAC;EAI3B,KA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esui{width:calc(100% - 300px)}.posttypesui .cptui-section:first-child,.taxonomiesui .cptui-section:first-child{margin-top:30px}.posttypesui .postbox-container,.taxonomiesui .postbox-container{width:100%}.posttypesui .postbox .toggle-indicator:before,.taxonomiesui .postbox .toggle-indicator:before{content:"\f142";display:inline-block;font:normal 20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none !important}.posttypesui .postbox.closed .handlediv .toggle-indicator::before,.taxonomiesui .postbox.closed .handlediv .toggle-indicator::before{content:"\f140"}.posttypesui .postbox .hndle,.taxonomiesui .postbox .hndle{cursor:pointer}.posttypesui .required,.taxonomiesui .required{color:red}.cptui-table td.outer{vertical-align:top;width:50%}.cptui-table input[type="text"]{width:75%}.cptui-table .question:hover{cursor:pointer}.cptui-table th p{font-weight:400;font-size:12px}.cptui-table .cptui-slug-details{margin-top:15px}.cptui-table #slugchanged,.cptui-table #slugexists{color:red;font-weight:bold}.cptui-table #slugchanged.hidemessage,.cptui-table #slugexists.hidemessage{display:none}.cptui-support #support .question{font-size:18px;font-weight:bold}.cptui-support #support .question:before{content:"\f139";display:inline-block;font:normal 25px/1 'dashicons';margin-left:-25px;position:absolute;-webkit-font-smoothing:antialiased}.cptui-support #support .question.active:before{content:"\f140"}.cptui-support #support .answer{margin:10px 0 0 20px}.cptui-support #support ol li{list-style:none}.cptui-support #support li{position:relative}.cptui-field-description{font-style:italic}#cptui_select_post_type,#cptui_select_taxonomy{margin-top:15px}.cptui_post_import,.cptui_tax_import{height:200px;margin-bottom:10px;resize:vertical;width:100%}.cptui_post_type_get_code,.cptui_tax_get_code{height:300px;resize:vertical}.about-wrap .cptui-feature{overflow:visible !important;*zoom:1}.about-wrap .cptui-feature:before,.about-wrap .cptui-feature:after{content:" ";display:table}.about-wrap .cptui-feature:after{clear:both}.about-wrap h3+.cptui-feature{margin-top:0}.about-wrap .changelog h2{text-align:center}.about-wrap .feature-rest div{width:50% !important;padding-right:100px;-moz-box-sizing:border-box;box-sizing:border-box;margin:0 !important}.about-wrap .feature-rest div.last-feature{padding-left:100px;padding-right:0}.about-wrap .feature-rest div.icon{width:0 !important;padding:0;margin:0}.about-wrap .feature-rest div.icon:before{font-weight:normal;width:100%;font-size:170px;line-height:125px;color:#9c5d90;display:inline-block;position:relative;text-align:center;speak:none;margin:0 0 0 -100px;content:"\e01d";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.about-wrap .about-integrations{background:#fff;margin:20px 0;padding:1px 20px 10px}.about-wrap .changelog h4{line-height:1.4}.about-wrap .cptui-about-text{margin-bottom:1em !important;margin-right:0;max-width:calc(100% - 173px)}.email-octopus-form-row input::placeholder{color:#cccccc}.email-octopus-form-row-hp{visibility:hidden}.cptui-intro-devblock{display:flex;flex-direction:row}.cptui-help{color:#424242;margin-left:4px;opacity:0.5;text-decoration:none;width:16px}fieldset .cptui-help{position:relative;top:4px}.cptui-help:hover{color:#0074a2;opacity:1}.cptui-help:focus{box-shadow:none}#menu_icon_preview{float:right;padding-left:8px}#menu_icon_preview img{display:block;height:20px;width:20px}.visuallyhidden{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.cptui-spacer{display:block;margin-top:25px}.email-octopus-form-wrapper{background:#fff;margin-bottom:10px;padding:20px}.email-octopus-form-wrapper label{margin-bottom:10px}.wdsoctosignup h2{text-align:left}.wdspromos{float:right;margin-left:20px;margin-top:10px;width:275px}.wdspromos-about{display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-content:stretch;align-content:stretch;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;margin:20px 0}.wdspromos-about a:nth-child(1){-ms-flex-order:0;order:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-align-self:auto;align-self:auto}.wdspromos-about a:nth-child(2){-ms-flex-order:0;order:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-align-self:auto;align-self:auto}.wdspromos-about a:nth-child(3){-ms-flex-order:0;order:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-align-self:auto;align-self:auto}.wdspromos-about p{padding:0 5px}.wdspromos-about p:nth-child(1){padding-left:0}.wdspromos-about p:nth-child(4){padding-right:0}.no-js #cptui_choose_icon{display:none}.cptui-listings th{font-weight:bold}.cptui-listings .post-type-listing th{width:16.66667%}.cptui-listings .taxonomy-listing th{width:20%}#poststuff{min-width:463px}.dashicon-picker-container{position:absolute;width:220px;height:252px;font-size:14px;background-color:#fff;box-shadow:-1px 2px 5px 3px rgba(0,0,0,0.41);overflow:hidden;padding:5px;box-sizing:border-box}.dashicon-picker-container ul{margin:0 0 10px;padding:0}.dashicon-picker-container ul .dashicons{width:20px;height:20px;font-size:20px}.dashicon-picker-container ul li{display:inline-block;margin:5px;float:left}.dashicon-picker-container ul li a{display:block;text-decoration:none;color:#373737;padding:5px 5px;border:1px solid #dfdfdf}.dashicon-picker-container ul li a:hover{border-color:#999;background:#efefef}.dashicon-picker-control{height:32px}.dashicon-picker-control a{padding:5px;text-decoration:none;line-height:32px;width:25px}.dashicon-picker-control a span{display:inline;vertical-align:middle}.dashicon-picker-control input{font-size:12px;width:140px}@media screen and (min-width: 769px){.cptui-badge{margin-top:-42px;height:173px;width:173px;color:#fafafa;font-weight:bold;font-size:14px;text-align:center;margin-bottom:10px;background:url(../images/cptui-icon-173x173.png) no-repeat;background-size:contain}}@media screen and (max-width: 768px){.cptui-table #description{width:100%}.wdspromos-about{flex-wrap:wrap}.wdspromos-about p{margin:5px auto}.wdspromos-about p:nth-child(1){padding-left:5px}.wdspromos-about p:nth-child(4){padding-right:5px}.cptui-table td.outer{width:100%}#cptui_debug_info_email{width:100%}}
1 (function($) {
2 "use strict";
3 $.fn.dashiconsPicker = function() {
4 var icons = [ "menu", "admin-site", "dashboard", "admin-media", "admin-page", "admin-comments", "admin-appearance", "admin-plugins", "admin-users", "admin-tools", "admin-settings", "admin-network", "admin-generic", "admin-home", "admin-collapse", "filter", "admin-customizer", "admin-multisite", "admin-links", "format-links", "admin-post", "format-standard", "format-image", "format-gallery", "format-audio", "format-video", "format-chat", "format-status", "format-aside", "format-quote", "welcome-write-blog", "welcome-edit-page", "welcome-add-page", "welcome-view-site", "welcome-widgets-menus", "welcome-comments", "welcome-learn-more", "image-crop", "image-rotate", "image-rotate-left", "image-rotate-right", "image-flip-vertical", "image-flip-horizontal", "image-filter", "undo", "redo", "editor-bold", "editor-italic", "editor-ul", "editor-ol", "editor-quote", "editor-alignleft", "editor-aligncenter", "editor-alignright", "editor-insertmore", "editor-spellcheck", "editor-distractionfree", "editor-expand", "editor-contract", "editor-kitchensink", "editor-underline", "editor-justify", "editor-textcolor", "editor-paste-word", "editor-paste-text", "editor-removeformatting", "editor-video", "editor-customchar", "editor-outdent", "editor-indent", "editor-help", "editor-strikethrough", "editor-unlink", "editor-rtl", "editor-break", "editor-code", "editor-paragraph", "editor-table", "align-left", "align-right", "align-center", "align-none", "lock", "unlock", "calendar", "calendar-alt", "visibility", "hidden", "post-status", "edit", "post-trash", "trash", "sticky", "external", "arrow-up", "arrow-down", "arrow-left", "arrow-right", "arrow-up-alt", "arrow-down-alt", "arrow-left-alt", "arrow-right-alt", "arrow-up-alt2", "arrow-down-alt2", "arrow-left-alt2", "arrow-right-alt2", "leftright", "sort", "randomize", "list-view", "excerpt-view", "grid-view", "hammer", "art", "migrate", "performance", "universal-access", "universal-access-alt", "tickets", "nametag", "clipboard", "heart", "megaphone", "schedule", "wordpress", "wordpress-alt", "pressthis", "update", "screenoptions", "cart", "feedback", "cloud", "translation", "tag", "category", "archive", "tagcloud", "text", "media-archive", "media-audio", "media-code", "media-default", "media-document", "media-interactive", "media-spreadsheet", "media-text", "media-video", "playlist-audio", "playlist-video", "controls-play", "controls-pause", "controls-forward", "controls-skipforward", "controls-back", "controls-skipback", "controls-repeat", "controls-volumeon", "controls-volumeoff", "yes", "no", "no-alt", "plus", "plus-alt", "plus-alt2", "minus", "dismiss", "marker", "star-filled", "star-half", "star-empty", "flag", "info", "warning", "share", "share1", "share-alt", "share-alt2", "twitter", "rss", "email", "email-alt", "facebook", "facebook-alt", "networking", "googleplus", "location", "location-alt", "camera", "images-alt", "images-alt2", "video-alt", "video-alt2", "video-alt3", "vault", "shield", "shield-alt", "sos", "search", "slides", "analytics", "chart-pie", "chart-bar", "chart-line", "chart-area", "groups", "businessman", "id", "id-alt", "products", "awards", "forms", "testimonial", "portfolio", "book", "book-alt", "download", "upload", "backup", "clock", "lightbulb", "microphone", "desktop", "tablet", "smartphone", "phone", "smiley", "index-card", "carrot", "building", "store", "album", "palmtree", "tickets-alt", "money", "thumbs-up", "thumbs-down", "layout", "align-pull-left", "align-pull-right", "block-default", "cloud-saved", "cloud-upload", "columns", "cover-image", "embed-audio", "embed-generic", "embed-photo", "embed-post", "embed-video", "exit", "html", "info-outline", "insert-after", "insert-before", "insert", "remove", "shortcode", "table-col-after", "table-col-before", "table-col-delete", "table-row-after", "table-row-before", "table-row-delete", "saved", "amazon", "google", "linkedin", "pinterest", "podio", "reddit", "spotify", "twitch", "whatsapp", "xing", "youtube", "database-add", "database-export", "database-import", "database-remove", "database-view", "database", "bell", "airplane", "car", "calculator", "ames", "printer", "beer", "coffee", "drumstick", "food", "bank", "hourglass", "money-alt", "open-folder", "pdf", "pets", "privacy", "superhero", "superhero-alt", "edit-page", "fullscreen-alt", "fullscreen-exit-alt" ];
5 return this.each(function() {
6 var button = $(this), offsetTop, offsetLeft;
7 button.on("click.dashiconsPicker", function(e) {
8 offsetTop = $(e.currentTarget).offset().top;
9 offsetLeft = $(e.currentTarget).offset().left;
10 createPopup(button);
11 });
12 function createPopup(button) {
13 var target = $("#menu_icon"), preview = $(button.data("preview")), popup = $('<div class="dashicon-picker-container">' + '<div class="dashicon-picker-control"></div>' + '<ul class="dashicon-picker-list"></ul>' + "</div>").css({
14 top: offsetTop,
15 left: offsetLeft
16 }), list = popup.find(".dashicon-picker-list");
17 for (var i in icons) {
18 if (icons.hasOwnProperty(i)) {
19 list.append('<li data-icon="' + icons[i] + '"><a href="#" title="' + icons[i] + '"><span class="dashicons dashicons-' + icons[i] + '"></span></a></li>');
20 }
21 }
22 $("a", list).on("click", function(e) {
23 e.preventDefault();
24 var title = $(this).attr("title");
25 target.val("dashicons-" + title).change();
26 preview.prop("class", "dashicons").addClass("dashicons-" + title);
27 removePopup();
28 });
29 var control = popup.find(".dashicon-picker-control");
30 control.html('<a data-direction="back" href="#">' + '<span class="dashicons dashicons-arrow-left-alt2"></span></a>' + '<input type="text" class="" placeholder="Search" />' + '<a data-direction="forward" href="#"><span class="dashicons dashicons-arrow-right-alt2"></span></a>');
31 $("a", control).on("click", function(e) {
32 e.preventDefault();
33 if ($(this).data("direction") === "back") {
34 $("li:gt(" + (icons.length - 26) + ")", list).prependTo(list);
35 } else {
36 $("li:lt(25)", list).appendTo(list);
37 }
38 });
39 popup.appendTo("body").show();
40 $("input", control).on("keyup", function(e) {
41 var search = $(this).val();
42 if (search === "") {
43 $("li:lt(25)", list).show();
44 } else {
45 $("li", list).each(function() {
46 if ($(this).data("icon").toLowerCase().indexOf(search.toLowerCase()) !== -1) {
47 $(this).show();
48 } else {
49 $(this).hide();
50 }
51 });
52 }
53 });
54 $(document).on("mouseup.dashicons-picker", function(e) {
55 if (!popup.is(e.target) && popup.has(e.target).length === 0) {
56 removePopup();
57 }
58 });
59 }
60 function removePopup() {
61 $(".dashicon-picker-container").remove();
62 $(document).off(".dashicons-picker");
63 }
64 });
65 };
66 $(function() {
67 $(".dashicons-picker").dashiconsPicker();
68 });
69 })(jQuery);
...\ No newline at end of file ...\ No newline at end of file
1 !function(m){"use strict";m.fn.dashiconsPicker=function(){var c=["menu","admin-site","dashboard","admin-media","admin-page","admin-comments","admin-appearance","admin-plugins","admin-users","admin-tools","admin-settings","admin-network","admin-generic","admin-home","admin-collapse","filter","admin-customizer","admin-multisite","admin-links","format-links","admin-post","format-standard","format-image","format-gallery","format-audio","format-video","format-chat","format-status","format-aside","format-quote","welcome-write-blog","welcome-edit-page","welcome-add-page","welcome-view-site","welcome-widgets-menus","welcome-comments","welcome-learn-more","image-crop","image-rotate","image-rotate-left","image-rotate-right","image-flip-vertical","image-flip-horizontal","image-filter","undo","redo","editor-bold","editor-italic","editor-ul","editor-ol","editor-quote","editor-alignleft","editor-aligncenter","editor-alignright","editor-insertmore","editor-spellcheck","editor-distractionfree","editor-expand","editor-contract","editor-kitchensink","editor-underline","editor-justify","editor-textcolor","editor-paste-word","editor-paste-text","editor-removeformatting","editor-video","editor-customchar","editor-outdent","editor-indent","editor-help","editor-strikethrough","editor-unlink","editor-rtl","editor-break","editor-code","editor-paragraph","editor-table","align-left","align-right","align-center","align-none","lock","unlock","calendar","calendar-alt","visibility","hidden","post-status","edit","post-trash","trash","sticky","external","arrow-up","arrow-down","arrow-left","arrow-right","arrow-up-alt","arrow-down-alt","arrow-left-alt","arrow-right-alt","arrow-up-alt2","arrow-down-alt2","arrow-left-alt2","arrow-right-alt2","leftright","sort","randomize","list-view","excerpt-view","grid-view","hammer","art","migrate","performance","universal-access","universal-access-alt","tickets","nametag","clipboard","heart","megaphone","schedule","wordpress","wordpress-alt","pressthis","update","screenoptions","cart","feedback","cloud","translation","tag","category","archive","tagcloud","text","media-archive","media-audio","media-code","media-default","media-document","media-interactive","media-spreadsheet","media-text","media-video","playlist-audio","playlist-video","controls-play","controls-pause","controls-forward","controls-skipforward","controls-back","controls-skipback","controls-repeat","controls-volumeon","controls-volumeoff","yes","no","no-alt","plus","plus-alt","plus-alt2","minus","dismiss","marker","star-filled","star-half","star-empty","flag","info","warning","share","share1","share-alt","share-alt2","twitter","rss","email","email-alt","facebook","facebook-alt","networking","googleplus","location","location-alt","camera","images-alt","images-alt2","video-alt","video-alt2","video-alt3","vault","shield","shield-alt","sos","search","slides","analytics","chart-pie","chart-bar","chart-line","chart-area","groups","businessman","id","id-alt","products","awards","forms","testimonial","portfolio","book","book-alt","download","upload","backup","clock","lightbulb","microphone","desktop","tablet","smartphone","phone","smiley","index-card","carrot","building","store","album","palmtree","tickets-alt","money","thumbs-up","thumbs-down","layout","align-pull-left","align-pull-right","block-default","cloud-saved","cloud-upload","columns","cover-image","embed-audio","embed-generic","embed-photo","embed-post","embed-video","exit","html","info-outline","insert-after","insert-before","insert","remove","shortcode","table-col-after","table-col-before","table-col-delete","table-row-after","table-row-before","table-row-delete","saved","amazon","google","linkedin","pinterest","podio","reddit","spotify","twitch","whatsapp","xing","youtube","database-add","database-export","database-import","database-remove","database-view","database","bell","airplane","car","calculator","ames","printer","beer","coffee","drumstick","food","bank","hourglass","money-alt","open-folder","pdf","pets","privacy","superhero","superhero-alt","edit-page","fullscreen-alt","fullscreen-exit-alt"];return this.each(function(){var s,l,n=m(this);function d(){m(".dashicon-picker-container").remove(),m(document).off(".dashicons-picker")}n.on("click.dashiconsPicker",function(e){s=m(e.currentTarget).offset().top,l=m(e.currentTarget).offset().left;var a,e=n,t=m("#menu_icon"),o=m(e.data("preview")),i=m('<div class="dashicon-picker-container"><div class="dashicon-picker-control"></div><ul class="dashicon-picker-list"></ul></div>').css({top:s,left:l}),r=i.find(".dashicon-picker-list");for(a in c)c.hasOwnProperty(a)&&r.append('<li data-icon="'+c[a]+'"><a href="#" title="'+c[a]+'"><span class="dashicons dashicons-'+c[a]+'"></span></a></li>');m("a",r).on("click",function(e){e.preventDefault();e=m(this).attr("title");t.val("dashicons-"+e).change(),o.prop("class","dashicons").addClass("dashicons-"+e),d()}),(e=i.find(".dashicon-picker-control")).html('<a data-direction="back" href="#"><span class="dashicons dashicons-arrow-left-alt2"></span></a><input type="text" class="" placeholder="Search" /><a data-direction="forward" href="#"><span class="dashicons dashicons-arrow-right-alt2"></span></a>'),m("a",e).on("click",function(e){e.preventDefault(),"back"===m(this).data("direction")?m("li:gt("+(c.length-26)+")",r).prependTo(r):m("li:lt(25)",r).appendTo(r)}),i.appendTo("body").show(),m("input",e).on("keyup",function(e){var a=m(this).val();""===a?m("li:lt(25)",r).show():m("li",r).each(function(){-1!==m(this).data("icon").toLowerCase().indexOf(a.toLowerCase())?m(this).show():m(this).hide()})}),m(document).on("mouseup.dashicons-picker",function(e){i.is(e.target)||0!==i.has(e.target).length||d()})})})},m(function(){m(".dashicons-picker").dashiconsPicker()})}(jQuery);
...\ No newline at end of file ...\ No newline at end of file
1 {"version":3,"sources":["src/js/dashicons-picker.js"],"names":["$","fn","dashiconsPicker","icons","this","each","offsetTop","offsetLeft","button","removePopup","remove","document","off","on","e","currentTarget","offset","top","left","createPopup","i","target","preview","data","popup","css","list","find","hasOwnProperty","append","preventDefault","title","attr","val","change","prop","addClass","control","html","length","prependTo","appendTo","show","search","toLowerCase","indexOf","hide","is","has","jQuery"],"mappings":"CAMG,SAAWA,gBAMbA,EAAEC,GAAGC,gBAAkB,WAOtB,IAAIC,EAAQ,CACX,OACA,aACA,YACA,cACA,aACA,iBACA,mBACA,gBACA,cACA,cACA,iBACA,gBACA,gBACA,aACA,iBACA,SACA,mBACA,kBACA,cACA,eACA,aACA,kBACA,eACA,iBACA,eACA,eACA,cACA,gBACA,eACA,eACA,qBACA,oBACA,mBACA,oBACA,wBACA,mBACA,qBACA,aACA,eACA,oBACA,qBACA,sBACA,wBACA,eACA,OACA,OACA,cACA,gBACA,YACA,YACA,eACA,mBACA,qBACA,oBACA,oBACA,oBACA,yBACA,gBACA,kBACA,qBACA,mBACA,iBACA,mBACA,oBACA,oBACA,0BACA,eACA,oBACA,iBACA,gBACA,cACA,uBACA,gBACA,aACA,eACA,cACA,mBACA,eACA,aACA,cACA,eACA,aACA,OACA,SACA,WACA,eACA,aACA,SACA,cACA,OACA,aACA,QACA,SACA,WACA,WACA,aACA,aACA,cACA,eACA,iBACA,iBACA,kBACA,gBACA,kBACA,kBACA,mBACA,YACA,OACA,YACA,YACA,eACA,YACA,SACA,MACA,UACA,cACA,mBACA,uBACA,UACA,UACA,YACA,QACA,YACA,WACA,YACA,gBACA,YACA,SACA,gBACA,OACA,WACA,QACA,cACA,MACA,WACA,UACA,WACA,OACA,gBACA,cACA,aACA,gBACA,iBACA,oBACA,oBACA,aACA,cACA,iBACA,iBACA,gBACA,iBACA,mBACA,uBACA,gBACA,oBACA,kBACA,oBACA,qBACA,MACA,KACA,SACA,OACA,WACA,YACA,QACA,UACA,SACA,cACA,YACA,aACA,OACA,OACA,UACA,QACA,SACA,YACA,aACA,UACA,MACA,QACA,YACA,WACA,eACA,aACA,aACA,WACA,eACA,SACA,aACA,cACA,YACA,aACA,aACA,QACA,SACA,aACA,MACA,SACA,SACA,YACA,YACA,YACA,aACA,aACA,SACA,cACA,KACA,SACA,WACA,SACA,QACA,cACA,YACA,OACA,WACA,WACA,SACA,SACA,QACA,YACA,aACA,UACA,SACA,aACA,QACA,SACA,aACA,SACA,WACA,QACA,QACA,WACA,cACA,QACA,YACA,cACA,SACA,kBACA,mBACA,gBACA,cACA,eACA,UACA,cACA,cACA,gBACA,cACA,aACA,cACA,OACA,OACA,eACA,eACA,gBACA,SACA,SACA,YACA,kBACA,mBACA,mBACA,kBACA,mBACA,mBACA,QACA,SACA,SACA,WACA,YACA,QACA,SACA,UACA,SACA,WACA,OACA,UACA,eACA,kBACA,kBACA,kBACA,gBACA,WACA,OACA,WACA,MACA,aACA,OACA,UACA,OACA,SACA,YACA,OACA,OACA,YACA,YACA,cACA,MACA,OACA,UACA,YACA,gBACA,YACA,iBACA,uBAGD,OAAOC,KAAKC,KAAM,WAEjB,IACCC,EACAC,EAFGC,EAASR,EAAGI,MAgFhB,SAASK,IACRT,EAAG,8BAA+BU,SAClCV,EAAGW,UAAWC,IAAK,qBA9EpBJ,EAAOK,GAAI,wBAAyB,SAAWC,GAC9CR,EAAYN,EAAGc,EAAEC,eAAgBC,SAASC,IAC1CV,EAAaP,EAAGc,EAAEC,eAAgBC,SAASE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WACFA,EAAG,qBAAsBE,oBAzZ1B,CA4ZE+C"}
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2 /**
3 * Custom Post Type UI Debug Information.
4 *
5 * @package CPTUI
6 * @subpackage Debugging
7 * @author WebDevStudios
8 * @since 1.2.0
9 * @license GPL-2.0+
10 */
11
12 /**
13 * Custom Post Type UI Debug Info
14 */
15 class CPTUI_Debug_Info {
16
17 /**
18 * Tab content for the debug info tab.
19 *
20 * @since 1.2.0
21 */
22 public function tab_site_info() {
23 ?>
24 <p><?php esc_html_e( 'If you have sought support for Custom Post Type UI on the forums, you may be requested to send the information below to the plugin developer. Simply insert the email they provided in the input field at the bottom and click the "Send debug info" button. Only the data below will be sent to them.', 'custom-post-type-ui' ); ?></p>
25 <label for="cptui_audit_textarea">
26 <textarea readonly="readonly" aria-readonly="true" id="cptui-audit-textarea" name="cptui_audit_textarea" rows="20" cols="100" class="large-text code">
27 <?php echo esc_html( $this->system_status() ); ?>
28 </textarea></label>
29 <?php
30 }
31
32 /**
33 * Generate the debug information content.
34 *
35 * @since 1.2.0
36 *
37 * @return string
38 */
39 private function system_status() {
40 if ( ! current_user_can( 'manage_options' ) ) {
41 return '';
42 }
43
44 global $wpdb;
45
46 $theme_data = wp_get_theme();
47 $theme = $theme_data->Name . ' ' . $theme_data->Version; // phpcs:ignore.
48
49 ob_start();
50 ?>
51
52 ### Begin Custom Post Type UI Debug Info ###
53
54 Multisite: <?php echo is_multisite() ? 'Yes' . "\n" : 'No' . "\n"; ?>
55
56 SITE_URL: <?php echo esc_url( site_url() ) . "\n"; ?>
57 HOME_URL: <?php echo esc_url( home_url() ) . "\n"; ?>
58
59 WordPress Version: <?php echo get_bloginfo( 'version' ) . "\n"; // phpcs:ignore. ?>
60 Permalink Structure: <?php echo get_option( 'permalink_structure' ) . "\n"; // phpcs:ignore. ?>
61 Active Theme: <?php echo $theme . "\n"; // phpcs:ignore. ?>
62
63 Registered Post Types: <?php echo implode( ', ', get_post_types( '', 'names' ) ) . "\n"; // phpcs:ignore. ?>
64
65 PHP Version: <?php echo PHP_VERSION . "\n"; ?>
66 MySQL Version: <?php echo $wpdb->db_version() . "\n"; // phpcs:ignore. ?>
67 Web Server Info: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; // phpcs:ignore. ?>
68
69 Show On Front: <?php echo get_option( 'show_on_front' ) . "\n"; // phpcs:ignore. ?>
70 Page On Front: <?php $id = get_option( 'page_on_front' ); // phpcs:ignore.
71 echo get_the_title( $id ) . ' (#' . $id . ')' . "\n"; // phpcs:ignore. ?>
72 Page For Posts: <?php $id = get_option( 'page_for_posts' ); // phpcs:ignore.
73 echo get_the_title( $id ) . ' (#' . $id . ')' . "\n"; // phpcs:ignore. ?>
74
75 WordPress Memory Limit: <?php echo ( $this->num_convt( WP_MEMORY_LIMIT ) / ( 1024 ) ) . 'MB'; ?><?php echo "\n"; // phpcs:ignore. ?>
76
77 <?php
78 $plugins = get_plugins();
79 $pg_count = count( $plugins );
80 echo 'TOTAL PLUGINS: ' . $pg_count . "\n\n"; // phpcs:ignore.
81 // MU plugins.
82 $mu_plugins = get_mu_plugins();
83
84 if ( $mu_plugins ) :
85 echo "\t\t" . 'MU PLUGINS: (' . count( $mu_plugins ) . ')' . "\n\n";
86
87 foreach ( $mu_plugins as $mu_path => $mu_plugin ) {
88
89 echo "\t\t" . esc_html( $mu_plugin['Name'] ) . ': ' . esc_html( $mu_plugin['Version'] ) . "\n";
90 }
91 endif;
92 // Standard plugins - active.
93 echo "\n";
94
95 $active = get_option( 'active_plugins', [] );
96 $ac_count = count( $active );
97 $ic_count = $pg_count - $ac_count;
98
99 echo "\t\t" . 'ACTIVE PLUGINS: (' . $ac_count . ')' . "\n\n"; // phpcs:ignore.
100
101 foreach ( $plugins as $plugin_path => $plugin ) {
102 // If the plugin isn't active, don't show it.
103 if ( ! in_array( $plugin_path, $active, true ) ) {
104 continue;
105 }
106
107 echo "\t\t" . esc_html( $plugin['Name'] ) . ': ' . esc_html( $plugin['Version'] ) . "\n";
108 }
109 // Standard plugins - inactive.
110 echo "\n";
111 echo "\t\t" , 'INACTIVE PLUGINS: (' . $ic_count . ')' . "\n\n"; // phpcs:ignore.
112
113 foreach ( $plugins as $plugin_path => $plugin ) {
114 // If the plugin isn't active, show it here.
115 if ( in_array( $plugin_path, $active, true ) ) {
116 continue;
117 }
118
119 echo "\t\t" . esc_html( $plugin['Name'] ) . ': ' . esc_html( $plugin['Version'] ) . "\n";
120 }
121
122 // If multisite, grab network as well.
123 if ( is_multisite() ) :
124
125 $net_plugins = wp_get_active_network_plugins();
126 $net_active = get_site_option( 'active_sitewide_plugins', [] );
127
128 echo "\n";
129 echo 'NETWORK ACTIVE PLUGINS: (' . count( $net_plugins ) . ')' . "\n\n";
130
131 foreach ( $net_plugins as $plugin_path ) {
132 $plugin_base = plugin_basename( $plugin_path );
133
134 // If the plugin isn't active, don't show it.
135 if ( ! array_key_exists( $plugin_base, $net_active ) ) {
136 continue;
137 }
138
139 $plugin = get_plugin_data( $plugin_path );
140
141 echo esc_html( $plugin['Name'] ) . ' :' . esc_html( $plugin['Version'] ) . "\n";
142 }
143
144 endif;
145
146 echo "\n";
147 $cptui_post_types = cptui_get_post_type_data();
148 echo "\t\t" . 'Post Types: ' . "\n";
149 echo "\t\t" . wp_json_encode( $cptui_post_types ) . "\n";
150
151 echo "\n\n";
152
153 $cptui_taxonomies = cptui_get_taxonomy_data();
154 echo "\t\t" . 'Taxonomies: ' . "\n";
155 echo "\t\t" . wp_json_encode( $cptui_taxonomies ) . "\n";
156 echo "\n";
157
158 if ( has_action( 'cptui_custom_debug_info' ) ) {
159 echo "\t\t" . 'EXTRA DEBUG INFO';
160 }
161
162 /**
163 * Fires at the end of the debug info output.
164 *
165 * @since 1.3.0
166 */
167 do_action( 'cptui_custom_debug_info' );
168
169 echo "\n";
170 ?>
171 ### End Debug Info ###
172 <?php
173
174 return ob_get_clean();
175 }
176
177 /**
178 * Helper function for number conversions.
179 *
180 * @since 1.2.0
181 * @access public
182 *
183 * @param mixed $v Value.
184 * @return int
185 */
186 public function num_convt( $v ) {
187 $l = substr( $v, - 1 );
188 $ret = substr( $v, 0, - 1 );
189
190 switch ( strtoupper( $l ) ) {
191 case 'P': // Fall-through.
192 case 'T': // Fall-through.
193 case 'G': // Fall-through.
194 case 'M': // Fall-through.
195 case 'K': // Fall-through.
196 $ret *= 1024;
197 break;
198 default:
199 break;
200 }
201
202 return $ret;
203 }
204
205 /**
206 * Sends an email to the specified address, with the system status as the message.
207 *
208 * @since 1.2.0
209 *
210 * @param array $args Array of arguments for the method. Optional.
211 * @return bool
212 */
213 public function send_email( $args = [] ) {
214
215 if ( ! isset( $args['email'] ) || ! is_email( $args['email'] ) ) {
216 return false;
217 }
218
219 stripslashes_deep( $args );
220
221 $args['email'] = sanitize_email( $args['email'] );
222
223 $message = $this->system_status();
224
225 /**
226 * Filters the debug email subject.
227 *
228 * @since 1.3.0
229 *
230 * @param string $value Intended email subject.
231 */
232 $subject = apply_filters(
233 'cptui_debug_email_subject',
234 sprintf(
235 // translators: Placeholder will hold site home_url.
236 esc_html__( 'Custom Post Type UI debug information for %s', 'custom-post-type-ui' ),
237 esc_url( home_url( '/' ) )
238 )
239 );
240
241 $result = wp_mail( $args['email'], $subject, $message );
242
243 /**
244 * Fires after the debug email has been sent.
245 *
246 * @since 1.3.0
247 */
248 do_action( 'cptui_after_debug_email_sent' );
249
250 return $result;
251 }
252 }
1 <?php
2 /**
3 * Custom Post Type UI About Page.
4 *
5 * @package CPTUI
6 * @subpackage About
7 * @author WebDevStudios
8 * @since 1.3.0
9 * @license GPL-2.0+
10 */
11
12 // phpcs:disable WebDevStudios.All.RequireAuthor
13
14 // Exit if accessed directly.
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 /**
20 * Enqueue our Custom Post Type UI assets.
21 *
22 * @since 1.6.0
23 */
24 function cptui_about_assets() {
25 $current_screen = get_current_screen();
26
27 if ( ! is_object( $current_screen ) || 'toplevel_page_cptui_main_menu' !== $current_screen->base ) {
28 return;
29 }
30
31 if ( wp_doing_ajax() ) {
32 return;
33 }
34
35 wp_enqueue_style( 'cptui-css' );
36 }
37 add_action( 'admin_enqueue_scripts', 'cptui_about_assets' );
38
39 /**
40 * Display our primary menu page.
41 *
42 * @since 0.3.0
43 *
44 * @internal
45 */
46 function cptui_settings() {
47 ?>
48 <div class="wrap about-wrap">
49 <?php
50
51 /**
52 * Fires inside and at the top of the wrapper for the main plugin landing page.
53 *
54 * @since 1.0.0
55 */
56 do_action( 'cptui_main_page_start' );
57 ?>
58 <h1><?php esc_html_e( 'Custom Post Type UI', 'custom-post-type-ui' ); ?> <?php echo esc_html( CPTUI_VERSION ); ?></h1>
59
60 <?php
61
62 /**
63 * Fires after the main page `<h1>` heading tag.
64 *
65 * @since 1.3.0
66 */
67 do_action( 'cptui_main_page_after_header' );
68 ?>
69 <div class="cptui-intro-devblock">
70 <p class="about-text cptui-about-text">
71 <?php esc_html_e( 'Thank you for choosing Custom Post Type UI! We hope that your experience with our plugin makes creating post types and taxonomies and organizing your content quick and easy.', 'custom-post-type-ui' ); ?>
72 </p>
73 <div class="cptui-badge"></div>
74 </div>
75 <?php
76 /**
77 * Fires before the About Page changelog.
78 *
79 * @since 1.4.0
80 */
81 do_action( 'cptui_main_page_before_changelog' );
82 ?>
83
84 <h2>
85 <?php
86 printf(
87 // translators: Placeholder will hold the plugin version.
88 esc_html__( "What's new in version %s", 'custom-post-type-ui' ),
89 esc_html( CPTUI_VERSION )
90 );
91 ?>
92 </h2>
93 <div class="changelog about-integrations">
94 <div class="cptui-feature feature-section col three-col">
95 <div class="col">
96 <h2><?php esc_html_e( 'Post type descriptions', 'custom-post-type-ui' ); ?></h2>
97 <p><?php esc_html_e( 'We have updated a number of details around the post type description field. First we addressed issues with the Tools area when descriptions included quotes. Second we fixed an issue around stripping HTML from the field from previous security updates.', 'custom-post-type-ui' ); ?></p>
98 <h2><?php esc_html_e( 'Miscellaneous code cleanup and separation.', 'custom-post-type-ui' ); ?></h2>
99 <p><?php esc_html_e( 'Largely under the hood, but we have done some separation of our code and done more to help ensure code quality.', 'custom-post-type-ui' ); ?></p>
100 <h2><?php esc_html_e( 'Branding.', 'custom-post-type-ui' ); ?></h2>
101 <p><?php esc_html_e( 'We updated our branding for the plugin. Both within our UI but also on WordPress.org', 'custom-post-type-ui' ); ?></p>
102 <h2><?php esc_html_e( 'Miscellaneous.', 'custom-post-type-ui' ); ?></h2>
103 <p><?php esc_html_e( 'Added notes about some post type features also needing theme support declared for them to work. Fixed a pluralization issue with our UI and forms.', 'custom-post-type-ui' ); ?></p>
104 </div>
105 </div>
106 </div>
107
108 <div class="extranotes">
109 <?php
110
111 /**
112 * Fires inside a div for extra notes.
113 *
114 * @since 1.3.0
115 */
116 do_action( 'cptui_main_page_extra_notes' );
117 ?>
118 </div>
119 </div>
120 <?php
121 }
122
123 /**
124 * Display Pluginize-based content.
125 *
126 * @since 1.4.0
127 */
128 function cptui_pluginize_content() {
129 // translators: Placeholder will hold the name of the author of the plugin.
130 echo '<h1>' . sprintf( esc_html__( 'More from %s', 'custom-post-type-ui' ), 'WebDevStudios' ) . '</h1>';
131 echo '<div class="wdspromos-about">';
132 $ads = cptui_get_ads();
133 if ( ! empty( $ads ) ) {
134
135 foreach ( $ads as $ad ) {
136
137 $the_ad = sprintf(
138 '<img src="%s" alt="%s">',
139 esc_attr( $ad['image'] ),
140 esc_attr( $ad['text'] )
141 );
142
143 // Escaping $the_ad breaks the html.
144 printf(
145 '<p><a href="%s">%s</a></p>',
146 esc_url( $ad['url'] ),
147 $the_ad // phpcs:ignore
148 );
149 }
150 }
151 echo '</div>';
152 }
153 add_action( 'cptui_main_page_extra_notes', 'cptui_pluginize_content', 9 );
154
155 /**
156 * Render our newsletter form for the about page.
157 *
158 * @since 1.4.0
159 */
160 function cptui_about_page_newsletter() {
161
162 if ( cptui_is_new_install() ) {
163 return '';
164 }
165
166 ?>
167 <div class='wdsoctosignup'>
168 <?php
169 cptui_newsletter_form();
170 ?>
171 </div>
172
173 <?php
174
175 return '';
176 }
177 add_action( 'cptui_main_page_before_changelog', 'cptui_about_page_newsletter' );
178
179 /**
180 * Marks site as not new at the end of the about/main page.
181 *
182 * Can't be done on activation or else cptui_is_new_install() will immediately start
183 * returning false. So we'll do it at the end of the redirected landing page.
184 *
185 * @since 1.5.0
186 */
187 function cptui_mark_not_new() {
188 if ( cptui_is_new_install() ) {
189 cptui_set_not_new_install();
190 }
191 }
192 add_action( 'cptui_main_page_extra_notes', 'cptui_mark_not_new', 999 );
1 <?php
2
3 // Exit if accessed directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 /**
9 * Content for the Debug Info tab.
10 * @since 1.2.0
11 * @internal
12 */
13 function cptui_render_debuginfo_section() {
14
15 $debuginfo = new CPTUI_Debug_Info();
16
17 echo '<form id="cptui_debug_info" method="post">';
18 $debuginfo->tab_site_info();
19
20 wp_nonce_field( 'cptui_debuginfo_nonce_action', 'cptui_debuginfo_nonce_field' );
21
22 if ( ! empty( $_POST ) && isset( $_POST['cptui_debug_info_email'] ) && isset( $_POST['cptui_debuginfo_nonce_field'] ) ) {
23 if ( wp_verify_nonce( 'cptui_debuginfo_nonce_field', 'cptui_debuginfo_nonce_action' ) ) {
24 $email_args = [];
25 $email_args['email'] = sanitize_text_field( $_POST['cptui_debug_info_email'] );
26 $debuginfo->send_email( $email_args );
27 }
28 }
29
30 echo '<p><label for="cptui_debug_info_email">' . esc_html__( 'Please provide an email address to send debug information to: ', 'custom-post-type-ui' ) . '</label><input type="email" id="cptui_debug_info_email" name="cptui_debug_info_email" value="" /></p>';
31
32 /**
33 * Filters the text value to use on the button when sending debug information.
34 *
35 * @param string $value Text to use for the button.
36 *
37 * @since 1.2.0
38 */
39 echo '<p><input type="submit" class="button-primary" name="cptui_send_debug_email" value="' . esc_attr( apply_filters( 'cptui_debug_email_submit_button', __( 'Send debug info', 'custom-post-type-ui' ) ) ) . '" /></p>';
40 echo '</form>';
41
42 /**
43 * Fires after the display of the site information.
44 * @since 1.3.0
45 */
46 do_action( 'cptui_after_site_info' );
47 }
1 <?php
2
3 // Exit if accessed directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 /**
9 * Content for the Get Code tab.
10 * @since 1.2.0
11 * @internal
12 */
13 function cptui_render_getcode_section() {
14 ?>
15 <h1><?php esc_html_e( 'Get Post Type and Taxonomy Code', 'custom-post-type-ui' ); ?></h1>
16
17 <h2><?php esc_html_e( 'All Custom Post Type UI Post Types', 'custom-post-type-ui' ); ?></h2>
18
19 <p><?php esc_html_e( 'All of the selectable code snippets below are useful if you wish to migrate away from Custom Post Type UI and retain your existing registered post types or taxonomies.', 'custom-post-type-ui' ); ?></p>
20
21 <?php $cptui_post_types = cptui_get_post_type_data(); ?>
22 <p>
23 <label for="cptui_post_type_get_code"><?php esc_html_e( 'Copy/paste the code below into your functions.php file.', 'custom-post-type-ui' ); ?></label>
24 </p>
25 <textarea name="cptui_post_type_get_code" id="cptui_post_type_get_code" class="large-text cptui_post_type_get_code" onclick="this.focus();this.select()" onfocus="this.focus();this.select();" readonly="readonly" aria-readonly="true"><?php cptui_get_post_type_code( $cptui_post_types ); ?></textarea>
26
27 <?php
28 if ( ! empty( $cptui_post_types ) ) {
29 foreach ( $cptui_post_types as $post_type ) {
30 ?>
31 <h2 id="<?php echo esc_attr( $post_type['name'] ); ?>">
32 <?php
33 $type = ! empty( $post_type['label'] ) ? esc_html( $post_type['label'] ) : esc_html( $post_type['name'] );
34 printf( esc_html__( '%s Post Type', 'custom-post-type-ui' ), esc_html( $type ) ); ?></h2>
35 <p>
36 <label for="cptui_post_type_get_code_<?php echo esc_attr( $post_type['name'] ); ?>"><?php esc_html_e( 'Copy/paste the code below into your functions.php file.', 'custom-post-type-ui' ); ?></label>
37 </p>
38 <textarea name="cptui_post_type_get_code_<?php echo esc_attr( $post_type['name'] ); ?>" id="cptui_post_type_get_code_<?php echo esc_attr( $post_type['name'] ); ?>" class="large-text cptui_post_type_get_code" onclick="this.focus();this.select()" onfocus="this.focus();this.select();" readonly="readonly" aria-readonly="true"><?php cptui_get_post_type_code( [ $post_type ], true ); ?></textarea>
39 <?php
40 }
41 }
42 ?>
43
44 <h2><?php esc_html_e( 'All Custom Post Type UI Taxonomies', 'custom-post-type-ui' ); ?></h2>
45
46 <?php $cptui_taxonomies = cptui_get_taxonomy_data(); ?>
47 <p>
48 <label for="cptui_tax_get_code"><?php esc_html_e( 'Copy/paste the code below into your functions.php file.', 'custom-post-type-ui' ); ?></label>
49 </p>
50 <textarea name="cptui_tax_get_code" id="cptui_tax_get_code" class="large-text cptui_tax_get_code" onclick="this.focus();this.select()" onfocus="this.focus();this.select();" readonly="readonly" aria-readonly="true"><?php cptui_get_taxonomy_code( $cptui_taxonomies ); ?></textarea>
51
52 <?php
53 if ( ! empty( $cptui_taxonomies ) ) {
54 foreach ( $cptui_taxonomies as $taxonomy ) {
55 ?>
56 <h2 id="<?php echo esc_attr( $taxonomy['name'] ); ?>">
57 <?php
58 $tax = ! empty( $taxonomy['label'] ) ? esc_html( $taxonomy['label'] ) : esc_html( $taxonomy['name'] );
59 printf( esc_html__( '%s Taxonomy', 'custom-post-type-ui' ), esc_html( $tax ) );
60 ?>
61 </h2>
62 <p>
63 <label for="cptui_tax_get_code_<?php echo esc_attr( $taxonomy['name'] ); ?>"><?php esc_html_e( 'Copy/paste the code below into your functions.php file.', 'custom-post-type-ui' ); ?></label>
64 </p>
65 <textarea name="cptui_tax_get_code_<?php echo esc_attr( $taxonomy['name'] ); ?>" id="cptui_tax_get_code_<?php echo esc_attr( $taxonomy['name'] ); ?>" class="large-text cptui_tax_get_code" onclick="this.focus();this.select()" onfocus="this.focus();this.select();" readonly="readonly" aria-readonly="true"><?php cptui_get_taxonomy_code( [ $taxonomy ], true ); ?></textarea>
66 <?php
67 }
68 }
69 ?>
70 <?php
71 }
1 <?php
2
3 // Exit if accessed directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 /**
9 * Display our copy-able code for registered post types.
10 *
11 * @param array $cptui_post_types Array of post types to render. Optional.
12 * @param bool $single Whether or not we are rendering a single post type. Optional. Default false.
13 *
14 * @since 1.2.0 Added $single parameter.
15 * @since 1.0.0
16 * @since 1.2.0 Added $cptui_post_types parameter.
17 */
18 function cptui_get_post_type_code( $cptui_post_types = [], $single = false ) {
19 // Whitespace very much matters here, thus why it's all flush against the left side.
20 if ( ! empty( $cptui_post_types ) ) {
21 $callback = 'cptui_register_my_cpts';
22 if ( $single ) {
23 $key = key( $cptui_post_types );
24 $callback = 'cptui_register_my_cpts_' . str_replace( '-', '_', esc_html( $cptui_post_types[ $key ]['name'] ) );
25 }
26 ?>
27
28 function <?php echo esc_html( $callback ); ?>() {
29 <?php
30 // Space before this line reflects in textarea.
31 foreach ( $cptui_post_types as $type ) {
32 echo cptui_get_single_post_type_registery( $type );
33 }
34 ?>
35 }
36
37 add_action( 'init', '<?php echo esc_html( $callback ); ?>' );
38 <?php
39 } else {
40 esc_html_e( 'No post types to display at this time', 'custom-post-type-ui' );
41 }
42 }
43
44 /**
45 * Create output for single post type to be ready for copy/paste from Get Code.
46 *
47 * @param array $post_type Post type data to output. Optional.
48 *
49 * @since 1.0.0
50 */
51 function cptui_get_single_post_type_registery( $post_type = [] ) {
52
53 /* This filter is documented in custom-post-type-ui/custom-post-type-ui.php */
54 $post_type['map_meta_cap'] = apply_filters( 'cptui_map_meta_cap', 'true', $post_type['name'], $post_type );
55
56 /* This filter is documented in custom-post-type-ui/custom-post-type-ui.php */
57 $user_supports_params = apply_filters( 'cptui_user_supports_params', [], $post_type['name'], $post_type );
58 if ( is_array( $user_supports_params ) ) {
59 $post_type['supports'] = array_merge( $post_type['supports'], $user_supports_params );
60 }
61
62 $yarpp = false; // Prevent notices.
63 if ( ! empty( $post_type['custom_supports'] ) ) {
64 $custom = explode( ',', $post_type['custom_supports'] );
65 foreach ( $custom as $part ) {
66 // We'll handle YARPP separately.
67 if ( in_array( $part, [ 'YARPP', 'yarpp' ], true ) ) {
68 $yarpp = true;
69 continue;
70 }
71 $post_type['supports'][] = $part;
72 }
73 }
74
75
76 $show_graphql = isset( $post_type['show_in_graphql'] ) ? (bool) $post_type['show_in_graphql'] : false;
77
78 $rewrite_withfront = '';
79 $rewrite = get_disp_boolean( $post_type['rewrite'] );
80 if ( false !== $rewrite ) {
81 $rewrite = disp_boolean( $post_type['rewrite'] );
82
83 $rewrite_slug = ' "slug" => "' . $post_type['name'] . '",';
84 if ( ! empty( $post_type['rewrite_slug'] ) ) {
85 $rewrite_slug = ' "slug" => "' . $post_type['rewrite_slug'] . '",';
86 }
87
88 $withfront = disp_boolean( $post_type['rewrite_withfront'] );
89 if ( ! empty( $withfront ) ) {
90 $rewrite_withfront = ' "with_front" => ' . $withfront . ' ';
91 }
92
93 if ( ! empty( $post_type['rewrite_slug'] ) || ! empty( $post_type['rewrite_withfront'] ) ) {
94 $rewrite_start = '[';
95 $rewrite_end = ']';
96
97 $rewrite = $rewrite_start . $rewrite_slug . $rewrite_withfront . $rewrite_end;
98 }
99 } else {
100 $rewrite = disp_boolean( $post_type['rewrite'] );
101 }
102 $has_archive = get_disp_boolean( $post_type['has_archive'] );
103 if ( false !== $has_archive ) {
104 $has_archive = disp_boolean( $post_type['has_archive'] );
105 if ( ! empty( $post_type['has_archive_string'] ) ) {
106 $has_archive = '"' . $post_type['has_archive_string'] . '"';
107 }
108 } else {
109 $has_archive = disp_boolean( $post_type['has_archive'] );
110 }
111
112 $supports = '';
113 // Do a little bit of php work to get these into strings.
114 if ( ! empty( $post_type['supports'] ) && is_array( $post_type['supports'] ) ) {
115 $supports = '[ "' . implode( '", "', $post_type['supports'] ) . '" ]';
116 }
117
118 if ( in_array( 'none', $post_type['supports'], true ) ) {
119 $supports = 'false';
120 }
121
122 $taxonomies = '';
123 if ( ! empty( $post_type['taxonomies'] ) && is_array( $post_type['taxonomies'] ) ) {
124 $taxonomies = '[ "' . implode( '", "', $post_type['taxonomies'] ) . '" ]';
125 }
126
127 if ( in_array( $post_type['query_var'], [ 'true', 'false', '0', '1' ], true ) ) {
128 $post_type['query_var'] = disp_boolean( $post_type['query_var'] );
129 }
130 if ( ! empty( $post_type['query_var_slug'] ) ) {
131 $post_type['query_var'] = '"' . $post_type['query_var_slug'] . '"';
132 }
133
134 if ( empty( $post_type['show_in_rest'] ) ) {
135 $post_type['show_in_rest'] = 'false';
136 }
137 $rest_controller_class = ! empty( $post_type['rest_controller_class'] ) ? $post_type['rest_controller_class'] : 'WP_REST_Posts_Controller';
138 $rest_namespace = ! empty( $post_type['rest_namespace'] ) ? $post_type['rest_namespace'] : 'wp/v2';
139
140 $show_in_menu = get_disp_boolean( $post_type['show_in_menu'] );
141 if ( false !== $show_in_menu ) {
142 $show_in_menu = disp_boolean( $post_type['show_in_menu'] );
143 if ( ! empty( $post_type['show_in_menu_string'] ) ) {
144 $show_in_menu = '"' . $post_type['show_in_menu_string'] . '"';
145 }
146 } else {
147 $show_in_menu = disp_boolean( $post_type['show_in_menu'] );
148 }
149
150 $delete_with_user = 'false';
151 if ( isset( $post_type['delete_with_user'] ) ) {
152 $delete_with_user = disp_boolean( $post_type['delete_with_user'] );
153 }
154
155 $can_export = 'true';
156 if ( isset( $post_type['can_export'] ) ) {
157 $can_export = disp_boolean( $post_type['can_export'] );
158 }
159
160 $public = isset( $post_type['public'] ) ? disp_boolean( $post_type['public'] ) : 'true';
161 $show_in_nav_menus = ( ! empty( $post_type['show_in_nav_menus'] ) && false !== get_disp_boolean( $post_type['show_in_nav_menus'] ) ) ? 'true' : 'false';
162 if ( empty( $post_type['show_in_nav_menus'] ) ) {
163 $show_in_nav_menus = $public;
164 }
165
166 $capability_type = '"post"';
167 if ( ! empty( $post_type['capability_type'] ) ) {
168 $capability_type = '"' . $post_type['capability_type'] . '"';
169 if ( false !== strpos( $post_type['capability_type'], ',' ) ) {
170 $caps = array_map( 'trim', explode( ',', $post_type['capability_type'] ) );
171 if ( count( $caps ) > 2 ) {
172 $caps = array_slice( $caps, 0, 2 );
173 }
174 $capability_type = '[ "' . $caps[0] . '", "' . $caps[1] . '" ]';
175 }
176 }
177
178 $post_type['description'] = addslashes( $post_type['description'] );
179
180 $my_theme = wp_get_theme();
181 $textdomain = $my_theme->get( 'TextDomain' );
182 if ( empty( $textdomain ) ) {
183 $textdomain = 'custom-post-type-ui';
184 }
185 ?>
186
187 /**
188 * Post Type: <?php echo $post_type['label']; ?>.
189 */
190
191 $labels = [
192 "name" => esc_html__( "<?php echo $post_type['label']; ?>", "<?php echo $textdomain; ?>" ),
193 "singular_name" => esc_html__( "<?php echo $post_type['singular_label']; ?>", "<?php echo $textdomain; ?>" ),
194 <?php
195 foreach ( $post_type['labels'] as $key => $label ) {
196 if ( ! empty( $label ) ) {
197 if ( 'parent' === $key && ! array_key_exists( 'parent_item_colon', $post_type['labels'] ) ) {
198 // Fix for incorrect label key. See #439.
199 echo "\t\t" . '"' . 'parent_item_colon' . '" => esc_html__( "' . $label . '", "' . $textdomain . '" ),' . "\n";
200 } else {
201 echo "\t\t" . '"' . $key . '" => esc_html__( "' . $label . '", "' . $textdomain . '" ),' . "\n";
202 }
203 }
204 }
205 ?>
206 ];
207
208 $args = [
209 "label" => esc_html__( "<?php echo $post_type['label']; ?>", "<?php echo $textdomain; ?>" ),
210 "labels" => $labels,
211 "description" => "<?php echo $post_type['description']; ?>",
212 "public" => <?php echo disp_boolean( $post_type['public'] ); ?>,
213 "publicly_queryable" => <?php echo disp_boolean( $post_type['publicly_queryable'] ); ?>,
214 "show_ui" => <?php echo disp_boolean( $post_type['show_ui'] ); ?>,
215 "show_in_rest" => <?php echo disp_boolean( $post_type['show_in_rest'] ); ?>,
216 "rest_base" => "<?php echo $post_type['rest_base']; ?>",
217 "rest_controller_class" => "<?php echo $rest_controller_class; ?>",
218 "rest_namespace" => "<?php echo $rest_namespace; ?>",
219 "has_archive" => <?php echo $has_archive; ?>,
220 "show_in_menu" => <?php echo $show_in_menu; ?>,
221 "show_in_nav_menus" => <?php echo $show_in_nav_menus; ?>,
222 "delete_with_user" => <?php echo $delete_with_user; ?>,
223 "exclude_from_search" => <?php echo disp_boolean( $post_type['exclude_from_search'] ); ?>,
224 "capability_type" => <?php echo $capability_type; ?>,
225 "map_meta_cap" => <?php echo disp_boolean( $post_type['map_meta_cap'] ); ?>,
226 "hierarchical" => <?php echo disp_boolean( $post_type['hierarchical'] ); ?>,
227 "can_export" => <?php echo $can_export; ?>,
228 "rewrite" => <?php echo $rewrite; ?>,
229 "query_var" => <?php echo $post_type['query_var']; ?>,
230 <?php if ( ! empty( $post_type['menu_position'] ) ) { ?>
231 "menu_position" => <?php echo $post_type['menu_position']; ?>,
232 <?php } ?>
233 <?php if ( ! empty( $post_type['menu_icon'] ) ) { ?>
234 "menu_icon" => "<?php echo $post_type['menu_icon']; ?>",
235 <?php } ?>
236 <?php if ( ! empty( $post_type['register_meta_box_cb'] ) ) { ?>
237 "register_meta_box_cb" => "<?php echo $post_type['register_meta_box_cb']; ?>",
238 <?php } ?>
239 <?php if ( ! empty( $supports ) ) { ?>
240 "supports" => <?php echo $supports; ?>,
241 <?php } ?>
242 <?php if ( ! empty( $taxonomies ) ) { ?>
243 "taxonomies" => <?php echo $taxonomies; ?>,
244 <?php } ?>
245 <?php if ( true === $yarpp ) { ?>
246 "yarpp_support" => <?php echo disp_boolean( $yarpp ); ?>,
247 <?php } ?>
248 <?php if ( $show_graphql ) : ?>
249 "show_in_graphql" => <?php echo disp_boolean( $post_type['show_in_graphql'] ); ?>,
250 "graphql_single_name" => "<?php echo esc_html( $post_type['graphql_single_name'] ); ?>",
251 "graphql_plural_name" => "<?php echo esc_html( $post_type['graphql_plural_name'] ); ?>",
252 <?php else: ?>
253 "show_in_graphql" => <?php echo disp_boolean( false ); ?>,
254 <?php endif; ?>
255 ];
256
257 register_post_type( "<?php echo esc_html( $post_type['name'] ); ?>", $args );
258 <?php
259 }
1 <?php
2
3 // Exit if accessed directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 /**
9 * Display our copy-able code for registered taxonomies.
10 *
11 * @param array $cptui_taxonomies Array of taxonomies to render. Optional.
12 * @param bool $single Whether or not we are rendering a single taxonomy. Optional. Default false.
13 *
14 * @since 1.2.0 Added $single parameter.
15 * @since 1.0.0
16 * @since 1.2.0 Added $cptui_taxonomies parameter.
17 */
18 function cptui_get_taxonomy_code( $cptui_taxonomies = [], $single = false ) {
19 if ( ! empty( $cptui_taxonomies ) ) {
20 $callback = 'cptui_register_my_taxes';
21 if ( $single ) {
22 $key = key( $cptui_taxonomies );
23 $callback = 'cptui_register_my_taxes_' . str_replace( '-', '_', esc_html( $cptui_taxonomies[ $key ]['name'] ) );
24 }
25 ob_start();
26 ?>
27 function <?php echo esc_html( $callback ); ?>() {
28 <?php
29 foreach ( $cptui_taxonomies as $tax ) {
30 echo cptui_get_single_taxonomy_registery( $tax );
31 }
32 ?>
33 }
34 add_action( 'init', '<?php echo esc_html( $callback ); ?>' );
35 <?php
36 } else {
37 esc_html_e( 'No taxonomies to display at this time', 'custom-post-type-ui' );
38 }
39 echo trim( ob_get_clean() );
40 }
41
42 /**
43 * Create output for single taxonomy to be ready for copy/paste from Get Code.
44 *
45 * @param array $taxonomy Taxonomy data to output. Optional.
46 *
47 * @since 1.0.0
48 */
49 function cptui_get_single_taxonomy_registery( $taxonomy = [] ) {
50
51 $post_types = "''";
52 if ( is_array( $taxonomy['object_types'] ) ) {
53 $post_types = '[ "' . implode( '", "', $taxonomy['object_types'] ) . '" ]';
54 }
55
56 if ( false !== get_disp_boolean( $taxonomy['rewrite'] ) ) {
57 $rewrite = disp_boolean( $taxonomy['rewrite'] );
58
59 $rewrite_slug = ' \'slug\' => \'' . $taxonomy['name'] . '\',';
60 if ( ! empty( $taxonomy['rewrite_slug'] ) ) {
61 $rewrite_slug = ' \'slug\' => \'' . $taxonomy['rewrite_slug'] . '\',';
62 }
63
64 $rewrite_withfront = '';
65 $withfront = disp_boolean( $taxonomy['rewrite_withfront'] );
66 if ( ! empty( $withfront ) ) {
67 $rewrite_withfront = ' \'with_front\' => ' . $withfront . ', ';
68 }
69
70 $hierarchical = ! empty( $taxonomy['rewrite_hierarchical'] ) ? disp_boolean( $taxonomy['rewrite_hierarchical'] ) : '';
71 $rewrite_hierarchcial = '';
72 if ( ! empty( $hierarchical ) ) {
73 $rewrite_hierarchcial = ' \'hierarchical\' => ' . $hierarchical . ', ';
74 }
75
76 if ( ! empty( $taxonomy['rewrite_slug'] ) || false !== disp_boolean( $taxonomy['rewrite_withfront'] ) ) {
77 $rewrite_start = '[';
78 $rewrite_end = ']';
79
80 $rewrite = $rewrite_start . $rewrite_slug . $rewrite_withfront . $rewrite_hierarchcial . $rewrite_end;
81 }
82 } else {
83 $rewrite = disp_boolean( $taxonomy['rewrite'] );
84 }
85 $public = isset( $taxonomy['public'] ) ? disp_boolean( $taxonomy['public'] ) : 'true';
86 $publicly_queryable = isset( $taxonomy['publicly_queryable'] ) ? disp_boolean( $taxonomy['publicly_queryable'] ) : disp_boolean( $taxonomy['public'] );
87 $show_in_quick_edit = isset( $taxonomy['show_in_quick_edit'] ) ? disp_boolean( $taxonomy['show_in_quick_edit'] ) : disp_boolean( $taxonomy['show_ui'] );
88 $show_tagcloud = isset( $taxonomy['show_tagcloud'] ) ? disp_boolean( $taxonomy['show_tagcloud'] ) : disp_boolean( $taxonomy['show_ui'] );
89
90 $show_in_menu = ( ! empty( $taxonomy['show_in_menu'] ) && false !== get_disp_boolean( $taxonomy['show_in_menu'] ) ) ? 'true' : 'false';
91 if ( empty( $taxonomy['show_in_menu'] ) ) {
92 $show_in_menu = disp_boolean( $taxonomy['show_ui'] );
93 }
94
95 $show_in_nav_menus = ( ! empty( $taxonomy['show_in_nav_menus'] ) && false !== get_disp_boolean( $taxonomy['show_in_nav_menus'] ) ) ? 'true' : 'false';
96 if ( empty( $taxonomy['show_in_nav_menus'] ) ) {
97 $show_in_nav_menus = $public;
98 }
99
100 $show_in_rest = ( ! empty( $taxonomy['show_in_rest'] ) && false !== get_disp_boolean( $taxonomy['show_in_rest'] ) ) ? 'true' : 'false';
101 $rest_base = ! empty( $taxonomy['rest_base'] ) ? $taxonomy['rest_base'] : $taxonomy['name'];
102 $rest_controller_class = ! empty( $taxonomy['rest_controller_class'] ) ? $taxonomy['rest_controller_class'] : 'WP_REST_Terms_Controller';
103 $rest_namespace = ! empty( $taxonomy['rest_namespace'] ) ? $taxonomy['rest_namespace'] : 'wp/v2';
104 $sort = ( ! empty( $taxonomy['sort'] ) && false !== get_disp_boolean( $taxonomy['sort'] ) ) ? 'true' : 'false';
105
106 if ( ! empty( $taxonomy['meta_box_cb'] ) ) {
107 $meta_box_cb = ( false !== get_disp_boolean( $taxonomy['meta_box_cb'] ) ) ? '"' . $taxonomy['meta_box_cb'] . '"' : 'false';
108 }
109
110 $default_term = '';
111 if ( ! empty( $taxonomy['default_term'] ) ) {
112 $term_parts = explode( ',', $taxonomy['default_term'] );
113 $default_term_start = '[';
114 $default_term_end = ']';
115 if ( ! empty( $term_parts[0] ) ) {
116 $default_term .= "'name' => '" . trim( $term_parts[0] ) . "'";
117 }
118 if ( ! empty( $term_parts[1] ) ) {
119 $default_term .= ", 'slug' => '" . trim( $term_parts[1] ) . "'";
120 }
121 if ( ! empty( $term_parts[2] ) ) {
122 $default_term .= ", 'description' => '" . trim( $term_parts[2] ) . "'";
123 }
124
125 $default_term = $default_term_start . $default_term . $default_term_end;
126 }
127
128 $my_theme = wp_get_theme();
129 $textdomain = $my_theme->get( 'TextDomain' );
130 if ( empty( $textdomain ) ) {
131 $textdomain = 'custom-post-type-ui';
132 }
133 ?>
134
135 /**
136 * Taxonomy: <?php echo esc_html( $taxonomy['label'] ); ?>.
137 */
138
139 $labels = [
140 "name" => esc_html__( "<?php echo esc_html( $taxonomy['label'] ); ?>", "<?php echo esc_html( $textdomain ); ?>" ),
141 "singular_name" => esc_html__( "<?php echo esc_html( $taxonomy['singular_label'] ); ?>", "<?php echo esc_html( $textdomain ); ?>" ),
142 <?php
143 foreach ( $taxonomy['labels'] as $key => $label ) {
144 if ( ! empty( $label ) ) {
145 echo "\t\t" . '"' . esc_html( $key ) . '" => esc_html__( "' . esc_html( $label ) . '", "' . esc_html( $textdomain ) . '" ),' . "\n";
146 }
147 }
148 ?>
149 ];
150
151 <?php
152 $show_graphql = isset( $taxonomy['show_in_graphql'] ) ? (bool) $taxonomy['show_in_graphql'] : false;
153 ?>
154
155 $args = [
156 "label" => esc_html__( "<?php echo $taxonomy['label']; ?>", "<?php echo $textdomain; ?>" ),
157 "labels" => $labels,
158 "public" => <?php echo $public; ?>,
159 "publicly_queryable" => <?php echo $publicly_queryable; ?>,
160 "hierarchical" => <?php echo $taxonomy['hierarchical']; ?>,
161 "show_ui" => <?php echo disp_boolean( $taxonomy['show_ui'] ); ?>,
162 "show_in_menu" => <?php echo $show_in_menu; ?>,
163 "show_in_nav_menus" => <?php echo $show_in_nav_menus; ?>,
164 "query_var" => <?php echo disp_boolean( $taxonomy['query_var'] ); ?>,
165 "rewrite" => <?php echo $rewrite; ?>,
166 "show_admin_column" => <?php echo $taxonomy['show_admin_column']; ?>,
167 "show_in_rest" => <?php echo $show_in_rest; ?>,
168 "show_tagcloud" => <?php echo $show_tagcloud; ?>,
169 "rest_base" => "<?php echo $rest_base; ?>",
170 "rest_controller_class" => "<?php echo $rest_controller_class; ?>",
171 "rest_namespace" => "<?php echo $rest_namespace; ?>",
172 "show_in_quick_edit" => <?php echo $show_in_quick_edit; ?>,
173 "sort" => <?php echo $sort; ?>,
174 <?php if ( $show_graphql ) : ?>
175 "show_in_graphql" => <?php echo disp_boolean( $taxonomy['show_in_graphql'] ); ?>,
176 "graphql_single_name" => "<?php echo esc_html( $taxonomy['graphql_single_name'] ); ?>",
177 "graphql_plural_name" => "<?php echo esc_html( $taxonomy['graphql_plural_name'] ); ?>",
178 <?php else: ?>
179 "show_in_graphql" => <?php echo disp_boolean( false ); ?>,
180 <?php endif; ?>
181 <?php if ( ! empty( $meta_box_cb ) ) { ?>
182 "meta_box_cb" => <?php echo $meta_box_cb; ?>,
183 <?php } ?>
184 <?php if ( ! empty( $default_term ) ) { ?>
185 "default_term" => <?php echo $default_term; ?>,
186 <?php } ?>
187 ];
188 register_taxonomy( "<?php echo esc_html( $taxonomy['name'] ); ?>", <?php echo $post_types; ?>, $args );
189 <?php
190 }
1 <?php
2 /**
3 * Custom Post Type UI WP-CLI.
4 *
5 * @package CPTUI
6 * @subpackage WP-CLI
7 * @author WebDevStudios
8 * @since 1.6.0
9 * @license GPL-2.0+
10 */
11
12 // phpcs:disable WebDevStudios.All.RequireAuthor
13
14 /**
15 * Imports and exports Custom Post Type UI setting data.
16 */
17 class CPTUI_Import_JSON extends WP_CLI_Command {
18
19 public $args;
20
21 public $assoc_args;
22
23 public $type;
24
25 public $data = [];
26
27 /**
28 * Imports and parses JSON into CPTUI settings.
29 *
30 * ## Options
31 *
32 * [--type=<type>]
33 * : What type of import this is. Available options are `post_type` and `taxonomy`.
34 *
35 * [--data-path=<path>]
36 * : The server path to the file holding JSON data to import. Relative to PWD.
37 */
38 public function import( $args, $assoc_args ) {
39 $this->args = $args;
40 $this->assoc_args = $assoc_args;
41
42 if ( ! isset( $this->assoc_args['type'] ) ) {
43 WP_CLI::error( esc_html__( 'Please provide whether you are importing post types or taxonomies', 'custom-post-type-ui' ) );
44 }
45
46 if ( ! isset( $this->assoc_args['data-path'] ) ) {
47 WP_CLI::error( esc_html__( 'Please provide a path to the file holding your CPTUI JSON data.', 'custom-post-type-ui' ) );
48 }
49
50 $this->type = $assoc_args['type'];
51
52 $json = file_get_contents( $this->assoc_args['data-path'] );
53
54 if ( empty( $json ) ) {
55 WP_CLI::error( esc_html__( 'No JSON data found', 'custom-post-type-ui' ) );
56 }
57
58 if ( 'post_type' === $this->type ) {
59 $this->data['cptui_post_import'] = json_decode( stripslashes_deep( trim( $json ) ), true );
60 }
61
62 if ( 'taxonomy' === $this->type ) {
63 $this->data['cptui_tax_import'] = json_decode( stripslashes_deep( trim( $json ) ), true );
64 }
65
66 $result = cptui_import_types_taxes_settings( $this->data );
67
68 if ( false === $result || 'import_fail' === $result ) {
69 WP_CLI::error( sprintf( esc_html__( 'An error on import occurred', 'custom-post-type-ui' ) ) );
70 } else {
71 WP_CLI::success(
72 sprintf(
73 /* translators: Placeholders are just for HTML markup that doesn't need translated */
74 esc_html__( 'Imported %s successfully', 'custom-post-type-ui' ),
75 $this->type
76 )
77 );
78 }
79 }
80
81 /**
82 * Export CPTUI settings to file.
83 *
84 * ## Options
85 *
86 * [--type=<type>]
87 * : Which settings to export. Available options are `post_type` and `taxonomy`.
88 *
89 * [--dest-path=<path>]
90 * : The path and file to export to. Relative to PWD.
91 */
92 public function export( $args, $assoc_args ) {
93 $this->args = $args;
94 $this->assoc_args = $assoc_args;
95
96 if ( ! isset( $this->assoc_args['type'] ) ) {
97 WP_CLI::error( esc_html__( 'Please provide whether you are exporting your post types or taxonomies', 'custom-post-type-ui' ) );
98 }
99
100 if ( ! isset( $this->assoc_args['dest-path'] ) ) {
101 WP_CLI::error( esc_html__( 'Please provide a path to export your data to.', 'custom-post-type-ui' ) );
102 }
103
104 $this->type = $assoc_args['type'];
105
106 if ( 'post_type' === $this->type ) {
107 $content = cptui_get_post_type_data();
108 }
109
110 if ( 'taxonomy' === $this->type ) {
111 $content = cptui_get_taxonomy_data();
112 }
113
114 $content = wp_json_encode( $content );
115 $result = file_put_contents( $this->assoc_args['dest-path'], $content );
116
117 if ( false === $result ) {
118 WP_CLI::error( esc_html__( 'Error saving data.', 'custom-post-type-ui' ) );
119 }
120
121 WP_CLI::success( esc_html__( 'Successfully saved data to file.', 'custom-post-type-ui' ) );
122 }
123 }
124 WP_CLI::add_command( 'cptui', 'CPTUI_Import_JSON' );
1 === Custom Post Type UI ===
2 Contributors: webdevstudios, pluginize, tw2113, williamsba1
3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3084056
4 Tags: custom post types, post type, taxonomy, content types, CPT, CMS, post, types, custom
5 Requires at least: 5.9
6 Tested up to: 6.2.2
7 Stable tag: 1.13.7
8 License: GPL-2.0+
9 Requires PHP: 5.6
10
11 Admin UI for creating custom content types like post types and taxonomies
12
13 == Description ==
14
15 Custom Post Type UI provides an easy to use interface for registering and managing custom post types and taxonomies for your website.
16
17 = Custom Post Type UI Extended =
18
19 CPTUI helps create custom content types, but displaying that content can be a whole new challenge. We created [Custom Post Type UI Extended](https://pluginize.com/product/custom-post-type-ui-extended/?utm_source=cptui-desription&utm_medium=text&utm_campaign=wporg) to help with displaying your crafted content. [View our Layouts page](https://pluginize.com/cpt-ui-extended-features/?utm_source=cptui-description-examples&utm_medium=text&utm_campaign=wporg) to see available layout examples with Custom Post Type UI Extended.
20
21 Beginning with version 1.7.0, Custom Post Type UI Extended has properly moved in to the Block editor experience and is working to get all the layouts available in the new "Custom Post Type UI Block". It's now even easier to start showing your content with the existing and future layouts available with Custom Post Type UI Extended.
22
23 [Pluginize](https://pluginize.com/?utm_source=cptui&utm_medium=text&utm_campaign=wporg) was launched in 2016 by [WebDevStudios](https://webdevstudios.com/) to promote, support, and house all of their [WordPress products](https://pluginize.com/shop/?utm_source=cptui-&utm_medium=text&utm_campaign=wporg). Pluginize is not only [creating new products for WordPress, like CPTUI Extended](https://pluginize.com/product/custom-post-type-ui-extended/?utm_source=cptui&utm_medium=text&utm_campaign=wporg), but also provides ongoing support and development for WordPress community favorites like [CMB2](https://wordpress.org/plugins/cmb2/) and more.
24
25 = Plugin development =
26
27 Custom Post Type UI development is managed on GitHub, with official releases published on WordPress.org. The GitHub repo can be found at [https://github.com/WebDevStudios/custom-post-type-ui](https://github.com/WebDevStudios/custom-post-type-ui). Please use the WordPress.org support tab for potential bugs, issues, or enhancement ideas.
28
29 == Screenshots ==
30
31 1. Add new post type screen and tab.
32 2. Add new taxonomy screen and tab.
33 3. Registered post types and taxonomies from CPTUI
34 4. Tools screen.
35 5. Help/support screen.
36
37 == Changelog ==
38
39 = 1.13.7 - 2023-07-11 =
40 * Fixed: "themes" marked as reserved taxonomy slug. Causes issues with featured image metabox.
41 * Fixed: PHP notice around `sort` parameter.
42
43 = 1.13.6 - 2023-05-30 =
44 * Fixed: Prevent PHP errors for dynamic WordPress hooks.
45 * Fixed: Prevent PHP errors from array_key_exist() checks on non arrays.
46 * Updated: Removed Maintainn graphic and added WP Search with Algolia Pro graphic.
47 * Updated: Fixed a lot of text escaping for translation-ready content.
48
49 = 1.13.5 - 2023-03-27 =
50 * Fixed: Security issue in CPTUI Debug Info screen.
51 * Fixed: Added `empty()` check for `can_export` parameters.
52 * Updated: Changed textdomain loading from `plugins_loaded` to `init`.
53
54 = 1.13.4 - 2022-12-16 =
55 * Fixed: Character encoding issue on CPTUI setting save in conjunction with PHP8 compatibility.
56
57 = 1.13.3 - 2022-12-15 =
58 * Fixed: Multiple PHP8 compatibility notices and warnings.
59 * Fixed: "Invalid argument for foreach" based notices around labels.
60 * Updated: Added taxonomy PHP global sanitization for 3rd party parameters.
61
62 = 1.13.2 - 2022-11-29 =
63 * Fixed: Removed forcing of underscores in place of dashes for taxonomy slugs. Yay!
64 * Updated: tested up to WP 6.1.1
65 * Updated: Documentation links in wordpress.org FAQ section.
66
67 = 1.13.1 - 2022-09-08 =
68 * Fixed: Various issues caused by a misplaced output for `ob_get_clean()` outside of function.
69
70 = 1.13.0 - 2022-09-07 =
71 * Added: Notes regarding featured image and post format support also needing `add_theme_support` to work.
72 * Fixed: Issues around double quotes and JSON export with the post type description field
73 * Fixed: Issues around HTML markup being removed from post type description field stemming from 1.10.x release
74 * Fixed: Pluralization issue with our UI for some field labels
75 * Updated: Code separation and quality cleanup.
76 * Updated: Plugin branding.
77
78 = 1.12.1 - 2022-05-16 =
79 * Fixed: JSON decoding issues around WP-CLI import.
80
81 = 1.12.0 - 2022-05-09 =
82 * Added: Tested on WordPress 6.0.
83 * Added: Auto-check, but not force, "page-attributes" when setting a post type as hierarchical.
84 * Added: "rest_namespace" parameters for both post types and taxonomies.
85 * Added: "register_meta_box_cb" parameter for post types.
86 * Fixed: undefined index notices for "can_export".
87 * Updated: list of reserved taxonomy names with more that are considered reserved.
88 * Updated: readme descriptions and screenshots.
89
90 = 1.11.2 - 2022-03-21 =
91 * Fixed: Unintended reuse of `$delete_with_user` variable and `can_export` option. Props @bogutskyy
92 * Fixed: PHP notices around `sort` array index.
93
94 = 1.11.1 - 2022-03-18 =
95 * Fixed: Errors and warnings around array_key_exists() and bool values
96
97 = 1.11.0 - 2022-03-17 =
98 * Added: "sort" argument for taxonomies.
99 * Added: "can export" argument for post types
100 * Added: New taxonomy labels from WordPress 5.9
101 * Added: Custom option to set "Enter title here" value for post types.
102 * Added: Notes around "exclude from search" argument for post types and taxonomy term archives.
103 * Added: Notes around taxonomy "hierarchical" option regarding category vs tag behavior.
104 * Updated: Reserved post type slugs from recent WordPress releases.
105 * Fixed: PHP warnings around foreach loops in cptui_published_post_format_fix()
106
107 == Upgrade Notice ==
108
109 = 1.13.7 - 2023-07-11 =
110 * Fixed: "themes" marked as reserved taxonomy slug. Causes issues with featured image metabox.
111 * Fixed: PHP notice around `sort` parameter.
112
113 = 1.13.6 - 2023-05-30 =
114 * Fixed: Prevent PHP errors for dynamic WordPress hooks.
115 * Fixed: Prevent PHP errors from array_key_exist() checks on non arrays.
116 * Updated: Removed Maintainn graphic and added WP Search with Algolia Pro graphic.
117 * Updated: Fixed a lot of text escaping for translation-ready content.
118
119 = 1.13.5 - 2023-03-27 =
120 * Fixed: Security issue in CPTUI Debug Info screen.
121 * Fixed: Added `empty()` check for `can_export` parameters.
122 * Updated: Changed textdomain loading from `plugins_loaded` to `init`.
123
124 = 1.13.4 - 2022-12-16 =
125 * Fixed: Character encoding issue on CPTUI setting save in conjunction with PHP8 compatibility.
126
127 = 1.13.3 - 2022-12-15 =
128 * Fixed: Multiple PHP8 compatibility notices and warnings.
129 * Fixed: "Invalid argument for foreach" based notices around labels.
130 * Updated: Added taxonomy PHP global sanitization for 3rd party parameters.
131
132 = 1.13.2 - 2022-11-29 =
133 * Fixed: Removed forcing of underscores in place of dashes for taxonomy slugs. Yay!
134 * Updated: tested up to WP 6.1.1
135 * Updated: Documentation links in wordpress.org FAQ section.
136
137 = 1.13.1 - 2022-09-08 =
138 * Fixed: Various issues caused by a misplaced output for `ob_get_clean()` outside of function.
139
140 = 1.13.0 - 2022-09-07 =
141 * Added: Notes regarding featured image and post format support also needing `add_theme_support` to work.
142 * Fixed: Issues around double quotes and JSON export with the post type description field
143 * Fixed: Issues around HTML markup being removed from post type description field stemming from 1.10.x release
144 * Fixed: Pluralization issue with our UI for some field labels
145 * Updated: Code separation and quality cleanup.
146 * Updated: Plugin branding.
147
148 = 1.12.1 - 2022-05-16 =
149 * Fixed: JSON decoding issues around WP-CLI import.
150
151 = 1.12.0 - 2022-05-09 =
152 * Added: Tested on WordPress 6.0.
153 * Added: Auto-check, but not force, "page-attributes" when setting a post type as hierarchical.
154 * Added: "rest_namespace" parameters for both post types and taxonomies.
155 * Added: "register_meta_box_cb" parameter for post types.
156 * Fixed: undefined index notices for "can_export".
157 * Updated: list of reserved taxonomy names with more that are considered reserved.
158 * Updated: readme descriptions and screenshots.
159
160 = 1.11.2 - 2022-03-21 =
161 * Fixed: Unintended reuse of `$delete_with_user` variable and `can_export` option. Props @bogutskyy
162 * Fixed: PHP notices around `sort` array index.
163
164 = 1.11.1 - 2022-03-18 =
165 * Fixed: Errors and warnings around array_key_exists() and bool values
166
167 = 1.11.0 - 2022-03-17 =
168 * Added: "sort" argument for taxonomies.
169 * Added: "can export" argument for post types
170 * Added: New taxonomy labels from WordPress 5.9
171 * Added: Custom option to set "Enter title here" value for post types.
172 * Added: Notes around "exclude from search" argument for post types and taxonomy term archives.
173 * Added: Notes around taxonomy "hierarchical" option regarding category vs tag behavior.
174 * Updated: Reserved post type slugs from recent WordPress releases.
175 * Fixed: PHP warnings around foreach loops in cptui_published_post_format_fix()
176
177 == Installation ==
178
179 = Admin Installer via search =
180 1. Visit the Add New plugin screen and search for "custom post type ui".
181 2. Click the "Install Now" button.
182 3. Activate the plugin.
183 4. Navigate to the "CPTUI" Menu.
184
185 = Admin Installer via zip =
186 1. Visit the Add New plugin screen and click the "Upload Plugin" button.
187 2. Click the "Browse..." button and select zip file from your computer.
188 3. Click "Install Now" button.
189 4. Once done uploading, activate Custom Post Type UI.
190
191 = Manual =
192 1. Upload the Custom Post Type UI folder to the plugins directory in your WordPress installation.
193 2. Activate the plugin.
194 3. Navigate to the "CPTUI" Menu.
195
196 That's it! Now you can easily start creating custom post types and taxonomies in WordPress.
197
198 == Frequently Asked Questions ==
199
200 #### User documentation
201 Please see https://docs.pluginize.com/tutorials/custom-post-type-ui/