Version Description
- 2022-09-07 =
- Added: Notes regarding featured image and post format support also needing
add_theme_support
to work. - Fixed: Issues around double quotes and JSON export with the post type description field
- Fixed: Issues around HTML markup being removed from post type description field stemming from 1.10.x release
- Fixed: Pluralization issue with our UI for some field labels
- Updated: Code separation and quality cleanup.
- Updated: Plugin branding.
Download this release
Release Info
Developer | tw2113 |
Plugin | Custom Post Type UI |
Version | 1.13.0 |
Comparing to | |
See all releases |
Code changes from version 1.12.1 to 1.13.0
- build/cptui-scripts.js +291 -0
- build/cptui-scripts.min.js +1 -0
- build/cptui-scripts.min.js.map +1 -0
- build/cptui-styles.css +342 -0
- build/cptui-styles.css.map +9 -0
- build/cptui-styles.min.css +1 -0
- build/dashicons-picker.js +69 -0
- build/dashicons-picker.min.js +1 -0
- build/dashicons-picker.min.js.map +1 -0
- classes/class.cptui_admin_ui.php +61 -11
- classes/class.cptui_debug_info.php +37 -34
- css/cptui.css +0 -456
- css/cptui.min.css +0 -1
- css/cptui.scss +0 -439
- custom-post-type-ui.php +25 -19
- external/wpgraphql.php +80 -54
- images/cptui-icon-128x128.png +0 -0
- images/cptui-icon-173x173.png +0 -0
- images/cptui-icon-256x256.png +0 -0
- inc/about.php +19 -6
- inc/listings.php +31 -29
- inc/post-types.php +1333 -1007
- inc/support.php +61 -22
- inc/taxonomies.php +769 -641
- inc/tools-sections/tools-debug.php +47 -0
- inc/tools-sections/tools-get-code.php +71 -0
- inc/tools-sections/tools-post-types.php +259 -0
- inc/tools-sections/tools-taxonomies.php +188 -0
- inc/tools.php +114 -644
- inc/utility.php +94 -57
- inc/wp-cli.php +8 -3
- js/cptui.js +0 -291
- js/cptui.min.js +0 -1
- js/dashicons-picker.js +0 -419
- js/dashicons-picker.min.js +0 -1
- readme.txt +18 -30
build/cptui-scripts.js
ADDED
@@ -0,0 +1,291 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
if ("cpt-ui_page_cptui_manage_post_types" === window.pagenow) {
|
107 |
+
s = s.replace(/[^a-z0-9\s-]/gi, "_");
|
108 |
+
} else {
|
109 |
+
s = s.replace(/[^a-z0-9\s]/gi, "_");
|
110 |
+
}
|
111 |
+
return s;
|
112 |
+
}
|
113 |
+
function composePreviewContent(value) {
|
114 |
+
var re = /(http|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/;
|
115 |
+
var is_url = re.test(value);
|
116 |
+
if (!value) {
|
117 |
+
return "";
|
118 |
+
} else if (0 === value.indexOf("dashicons-")) {
|
119 |
+
return $('<div class="dashicons-before"><br></div>').addClass(htmlEncode(value));
|
120 |
+
} else if (is_url) {
|
121 |
+
var imgsrc = encodeURI(value);
|
122 |
+
var theimg = document.createElement("IMG");
|
123 |
+
theimg.src = imgsrc;
|
124 |
+
return theimg;
|
125 |
+
}
|
126 |
+
}
|
127 |
+
function htmlEncode(str) {
|
128 |
+
return String(str).replace(/[^-\w. ]/gi, function(c) {
|
129 |
+
return "&#" + c.charCodeAt(0) + ";";
|
130 |
+
});
|
131 |
+
}
|
132 |
+
var cyrillic = {
|
133 |
+
"Ё": "YO",
|
134 |
+
"Й": "I",
|
135 |
+
"Ц": "TS",
|
136 |
+
"У": "U",
|
137 |
+
"К": "K",
|
138 |
+
"Е": "E",
|
139 |
+
"Н": "N",
|
140 |
+
"Г": "G",
|
141 |
+
"Ш": "SH",
|
142 |
+
"Щ": "SCH",
|
143 |
+
"З": "Z",
|
144 |
+
"Х": "H",
|
145 |
+
"Ъ": "'",
|
146 |
+
"ё": "yo",
|
147 |
+
"й": "i",
|
148 |
+
"ц": "ts",
|
149 |
+
"у": "u",
|
150 |
+
"к": "k",
|
151 |
+
"е": "e",
|
152 |
+
"н": "n",
|
153 |
+
"г": "g",
|
154 |
+
"ш": "sh",
|
155 |
+
"щ": "sch",
|
156 |
+
"з": "z",
|
157 |
+
"х": "h",
|
158 |
+
"ъ": "'",
|
159 |
+
"Ф": "F",
|
160 |
+
"Ы": "I",
|
161 |
+
"В": "V",
|
162 |
+
"А": "a",
|
163 |
+
"П": "P",
|
164 |
+
"Р": "R",
|
165 |
+
"О": "O",
|
166 |
+
"Л": "L",
|
167 |
+
"Д": "D",
|
168 |
+
"Ж": "ZH",
|
169 |
+
"Э": "E",
|
170 |
+
"ф": "f",
|
171 |
+
"ы": "i",
|
172 |
+
"в": "v",
|
173 |
+
"а": "a",
|
174 |
+
"п": "p",
|
175 |
+
"р": "r",
|
176 |
+
"о": "o",
|
177 |
+
"л": "l",
|
178 |
+
"д": "d",
|
179 |
+
"ж": "zh",
|
180 |
+
"э": "e",
|
181 |
+
"Я": "Ya",
|
182 |
+
"Ч": "CH",
|
183 |
+
"С": "S",
|
184 |
+
"М": "M",
|
185 |
+
"И": "I",
|
186 |
+
"Т": "T",
|
187 |
+
"Ь": "'",
|
188 |
+
"Б": "B",
|
189 |
+
"Ю": "YU",
|
190 |
+
"я": "ya",
|
191 |
+
"ч": "ch",
|
192 |
+
"с": "s",
|
193 |
+
"м": "m",
|
194 |
+
"и": "i",
|
195 |
+
"т": "t",
|
196 |
+
"ь": "'",
|
197 |
+
"б": "b",
|
198 |
+
"ю": "yu"
|
199 |
+
};
|
200 |
+
function transliterate(word) {
|
201 |
+
return word.split("").map(function(char) {
|
202 |
+
return cyrillic[char] || char;
|
203 |
+
}).join("");
|
204 |
+
}
|
205 |
+
if (undefined != wp.media) {
|
206 |
+
var _custom_media = true, _orig_send_attachment = wp.media.editor.send.attachment;
|
207 |
+
}
|
208 |
+
function getParameterByName(name, url) {
|
209 |
+
if (!url) url = window.location.href;
|
210 |
+
name = name.replace(/[\[\]]/g, "\\$&");
|
211 |
+
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url);
|
212 |
+
if (!results) return null;
|
213 |
+
if (!results[2]) return "";
|
214 |
+
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
215 |
+
}
|
216 |
+
$("#cptui_choose_icon").on("click", function(e) {
|
217 |
+
e.preventDefault();
|
218 |
+
var button = $(this);
|
219 |
+
var id = jQuery("#menu_icon").attr("id");
|
220 |
+
_custom_media = true;
|
221 |
+
wp.media.editor.send.attachment = function(props, attachment) {
|
222 |
+
if (_custom_media) {
|
223 |
+
$("#" + id).val(attachment.url).change();
|
224 |
+
} else {
|
225 |
+
return _orig_send_attachment.apply(this, [ props, attachment ]);
|
226 |
+
}
|
227 |
+
};
|
228 |
+
wp.media.editor.open(button);
|
229 |
+
return false;
|
230 |
+
});
|
231 |
+
$("#menu_icon").on("change", function() {
|
232 |
+
var value = $(this).val();
|
233 |
+
value = value.trim();
|
234 |
+
$("#menu_icon_preview").html(composePreviewContent(value));
|
235 |
+
});
|
236 |
+
$(".cptui-help").on("click", function(e) {
|
237 |
+
e.preventDefault();
|
238 |
+
});
|
239 |
+
$(".cptui-taxonomy-submit").on("click", function(e) {
|
240 |
+
if ($(".cptui-table :checkbox:checked").length == 0) {
|
241 |
+
e.preventDefault();
|
242 |
+
var no_associated_type_warning = $('<div class="cptui-taxonomy-empty-types-dialog">' + cptui_tax_data.no_associated_type + "</div>").appendTo("#poststuff").dialog({
|
243 |
+
dialogClass: "wp-dialog",
|
244 |
+
modal: true,
|
245 |
+
autoOpen: true,
|
246 |
+
buttons: {
|
247 |
+
OK: function() {
|
248 |
+
$(this).dialog("close");
|
249 |
+
}
|
250 |
+
}
|
251 |
+
});
|
252 |
+
}
|
253 |
+
});
|
254 |
+
$("#auto-populate").on("click tap", function(e) {
|
255 |
+
e.preventDefault();
|
256 |
+
var slug = $("#name").val();
|
257 |
+
var plural = $("#label").val();
|
258 |
+
var singular = $("#singular_label").val();
|
259 |
+
var fields = $('.cptui-labels input[type="text"]');
|
260 |
+
if ("" === slug) {
|
261 |
+
return;
|
262 |
+
}
|
263 |
+
if ("" === plural) {
|
264 |
+
plural = slug;
|
265 |
+
}
|
266 |
+
if ("" === singular) {
|
267 |
+
singular = slug;
|
268 |
+
}
|
269 |
+
$(fields).each(function(i, el) {
|
270 |
+
var newval = $(el).data("label");
|
271 |
+
var plurality = $(el).data("plurality");
|
272 |
+
if ("undefined" !== newval) {
|
273 |
+
if ("plural" === plurality) {
|
274 |
+
newval = newval.replace(/item/gi, plural);
|
275 |
+
} else {
|
276 |
+
newval = newval.replace(/item/gi, singular);
|
277 |
+
}
|
278 |
+
if ($(el).val() === "") {
|
279 |
+
$(el).val(newval);
|
280 |
+
}
|
281 |
+
}
|
282 |
+
});
|
283 |
+
});
|
284 |
+
$("#auto-clear").on("click tap", function(e) {
|
285 |
+
e.preventDefault();
|
286 |
+
var fields = $('.cptui-labels input[type="text"]');
|
287 |
+
$(fields).each(function(i, el) {
|
288 |
+
$(el).val("");
|
289 |
+
});
|
290 |
+
});
|
291 |
+
})(jQuery);
|
build/cptui-scripts.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
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=function(e){e="cpt-ui_page_cptui_manage_post_types"===window.pagenow?e.replace(/[^a-z0-9\s-]/gi,"_"):e.replace(/[^a-z0-9\s]/gi,"_");return e}(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 p[e]||e}).join("")))!==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,p={"Ё":"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);
|
build/cptui-scripts.min.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
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","replaceSpecialCharacters","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,EA0IL,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,GArJTd,EAAE,kCAAkCkB,OACpClB,EAAE,iCAAiCkB,OAE/B,SAkLJ,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,KAvLPmB,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,SAAS,WAC3B9B,EAAE,2BAA2BiC,WAG9BjC,EAAE,aAAa8B,GAAG,SAAS,WAC1B9B,EAAG,0BAA2BiC,WAI/BjC,EAAE,2CAA2C8B,GAAG,QAAQ,SAASI,GAChEA,EAAEC,iBACF,IAAIC,EAAM,GACqB,oBAApBC,gBACVD,EAAMC,gBAAgBC,QACc,oBAAnBC,iBACjBH,EAAMG,eAAeD,SAEMtC,EAAE,2CAA6CoC,EAAM,UAAUI,SAAS,cAAcC,OAAO,CACxHC,YAAkB,YAClBC,OAAkB,EAClBC,UAAkB,EAClBC,QAAkB,CACjBC,GAAM,WACM9C,EAAEkC,EAAEa,QAAQC,QAAQ,QAC/BhD,EAAEkC,EAAEa,QAAQE,IAAI,SAASC,SAE1BC,OAAU,WACTnD,EAAE+B,MAAMU,OAAO,eAOnBzC,EAAE,sBAAsBoD,KAAK,WAC5B,IAAIC,EAAMrD,EAAE+B,MAAOuB,GAAQ,EAAOC,EAASF,EAAIG,KAAK,OAAOC,UAC3DJ,EAAIvB,GAAG,gBAAgB,SAASI,GAEnB,YAATA,EAAEwB,MAAgC,KAAZxB,EAAEyB,SAA4B,KAAZzB,EAAEyB,UAG7CzB,EAAEC,iBACFmB,GAASA,EACTC,EAAOK,YAAYN,GACnBD,EAAIQ,YAAY,SAASP,GACzBD,EAAIS,KAAK,gBAAiBR,EAAMS,YAChCV,EAAIW,aAKNhE,EAAE,SAAS8B,GAAG,QAAQ,SAASI,GAC9B,IACA/B,EAAQ8D,EAAiBjE,EAAE+B,MAAMF,MAsB7BqC,GArBe,IAAdhC,EAAEyB,SAA+B,KAAdzB,EAAEyB,SAAgC,KAAdzB,EAAEyB,SAAgC,KAAdzB,EAAEyB,SAAgC,KAAdzB,EAAEyB,UAKrFxD,EAsDF,SAAkCgE,GAEhCA,EADI,wCAA0C9C,OAAOtB,QACjDoE,EAAE1D,QAAQ,iBAAkB,KAE5B0D,EAAE1D,QAAQ,gBAAiB,KAGhC,OAAO0D,EA7DEC,CADRjE,GADAA,EAoCF,SAA2BgE,GAa1B,IAZA,IAAIE,EAAa,CAChB,eAAgB,eAChB,eAAgB,eAChB,eAAgB,eAChB,eAAgB,eAChB,eAAgB,eAChB,UAAW,UACX,UAAW,WAGRC,EAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,KAErEC,EAAI,EAAGA,EAAIF,EAAWG,OAAQD,IACtCJ,EAAIA,EAAE1D,QAAQ4D,EAAWE,GAAID,EAAMC,IAGpC,OAAOJ,EArDEM,CADRtE,GADAA,EAAQA,EAAMM,QAAQ,KAAM,MACdiE,gBA+FHC,MAAM,IAAIC,IAAI,SAAUC,GACnC,OAAOC,EAASD,IAASA,IACvBE,KAAK,QA7FQd,GACdjE,EAAE+B,MAAMC,KAAK,QAAS7B,QAKI,IAAlBF,IACL+E,EAAehF,EAAE,gBAClBG,GAASF,EACX+E,EAAaC,YAAY,eAEzBD,EAAazE,SAAS,gBAINP,EAAE,gBACW,oBAAnBqC,kBACPA,gBAAgB6C,oBAAoBC,eAAehF,IAAUA,IAAUF,EAC1EiE,EAAYe,YAAY,eAExBf,EAAY3D,SAAS,gBAGO,oBAAlBgC,iBACPA,eAAe6C,oBAAoBD,eAAehF,IAAUA,IAAUF,EACzEiE,EAAYe,YAAY,eAExBf,EAAY3D,SAAS,kBA2DxB,IAWK8E,EACHC,EAZER,EAAW,CACdS,IAAK,KAAMC,IAAK,IAAKC,IAAK,KAAMC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,KAAMC,IAAK,MAAOC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,KAAMC,IAAK,IAAKC,IAAK,KAAMC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,KAAMC,IAAK,MAAOC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,KAAMC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,KAAMC,IAAK,IAAKC,IAAK,KAAMC,IAAK,KAAMC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,KAAMC,IAAK,KAAMC,IAAK,KAAMC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,IAAKC,IAAK,MAS5pBC,MAAaC,GAAGC,QAChBtE,GAAgB,EACnBC,EAAwBoE,GAAGC,MAAMC,OAAOC,KAAKC,YAa/C9J,EAAE,sBAAsB8B,GAAG,QAAQ,SAASI,GAC3CA,EAAEC,iBAEF,IAAI4H,EAAS/J,EAAE+B,MACXiI,EAAKC,OAAO,cAAcnG,KAAK,MAWnC,OAVAuB,GAAgB,EAChBqE,GAAGC,MAAMC,OAAOC,KAAKC,WAAa,SAAUI,EAAOJ,GAClD,IAAIzE,EAGH,OAAOC,EAAsB6E,MAAMpI,KAAM,CAACmI,EAAOJ,IAFjD9J,EAAE,IAAMgK,GAAInI,IAAIiI,EAAW1I,KAAKgJ,UAMlCV,GAAGC,MAAMC,OAAOS,KAAKN,IACd,IAGR/J,EAAE,cAAc8B,GAAG,SAAU,WAC5B,IACA3B,GAAQA,EADIH,EAAE+B,MAAMF,OACNyI,OACdtK,EAAE,sBAAsBuK,KAAKrK,EAAsBC,MAGpDH,EAAE,eAAe8B,GAAG,QAAQ,SAASI,GACpCA,EAAEC,mBAGHnC,EAAE,0BAA0B8B,GAAG,QAAQ,SAASI,GACI,GAA9ClC,EAAE,kCAAkCwE,SACxCtC,EAAEC,iBAC+BnC,EAAE,kDAAoDuC,eAAeiI,mBAAqB,UAAUhI,SAAS,cAAcC,OAAO,CAClKC,YAAkB,YAClBC,OAAkB,EAClBC,UAAkB,EAClBC,QAAkB,CACjBC,GAAM,WACL9C,EAAE+B,MAAMU,OAAO,gBAOpBzC,EAAE,kBAAkB8B,GAAI,YAAa,SAASI,GAC7CA,EAAEC,iBAEF,IAAIsI,EAAWzK,EAAE,SAAS6B,MACtB6I,EAAW1K,EAAE,UAAU6B,MACvB8I,EAAW3K,EAAE,mBAAmB6B,MAChC+I,EAAW5K,EAAE,oCAEZ,KAAOyK,IAGP,KAAOC,IACXA,EAASD,GAEL,KAAOE,IACXA,EAAWF,GAGZzK,EAAE4K,GAAQxH,KAAM,SAAUmB,EAAGsG,GAC5B,IAAIC,EAAS9K,EAAG6K,GAAKE,KAAM,SACvBC,EAAYhL,EAAG6K,GAAKE,KAAM,aACzB,cAAgBD,IAGnBA,EADI,WAAaE,EACRF,EAAOrK,QAAQ,SAAUiK,GAEzBI,EAAOrK,QAAQ,SAAUkK,GAEZ,KAAlB3K,EAAG6K,GAAKhJ,OACZ7B,EAAE6K,GAAIhJ,IAAIiJ,SAMd9K,EAAE,eAAe8B,GAAI,YAAa,SAASI,GAC1CA,EAAEC,iBAEEyI,EAAS5K,EAAE,oCAEfA,EAAE4K,GAAQxH,KAAM,SAAUmB,EAAGsG,GAC5B7K,EAAE6K,GAAIhJ,IAAI,QAtRb,CA0RGoI"}
|
build/cptui-styles.css
ADDED
@@ -0,0 +1,342 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 */
|
build/cptui-styles.css.map
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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,KAAK,EAAE,kBAAkB,GAsBzB;EA1BD,AACC,YADW,CACX,cAAc,AAAA,YAAY,EADb,aAAa,CAC1B,cAAc,AAAA,YAAY,CAAC;IAC1B,UAAU,EAAE,IAAI,GAChB;EAHF,AAKC,YALW,CAKX,kBAAkB,EALL,aAAa,CAK1B,kBAAkB,CAAC;IACjB,KAAK,EAAE,IAAI,GACZ;EAPF,AAQC,YARW,CAQX,QAAQ,CAAC,iBAAiB,AAAA,OAAO,EARpB,aAAa,CAQ1B,QAAQ,CAAC,iBAAiB,AAAA,OAAO,CAAC;IACjC,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,IAAI;IACX,sBAAsB,EAAE,WAAW;IACnC,uBAAuB,EAAE,SAAS;IAClC,eAAe,EAAE,eAAe,GAChC;EAhBF,AAiBC,YAjBW,CAiBX,QAAQ,AAAA,OAAO,CAAC,UAAU,CAAC,iBAAiB,AAAA,QAAQ,EAjBvC,aAAa,CAiB1B,QAAQ,AAAA,OAAO,CAAC,UAAU,CAAC,iBAAiB,AAAA,QAAQ,CAAC;IACpD,OAAO,EAAE,OAAO,GAChB;EAnBF,AAoBC,YApBW,CAoBX,QAAQ,CAAC,MAAM,EApBF,aAAa,CAoB1B,QAAQ,CAAC,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,GACf;EAtBF,AAuBC,YAvBW,CAuBX,SAAS,EAvBI,aAAa,CAuB1B,SAAS,CAAC;IACT,KAAK,EAAE,GAAc,GACrB;;AAEF,AACC,YADW,CACX,EAAE,AAAA,MAAM,CAAC;EACR,cAAc,EAAE,GAAG;EACnB,KAAK,EAAE,GAAG,GACV;;AAJF,AAKC,YALW,CAKX,KAAK,CAAA,AAAA,IAAC,CAAK,MAAM,AAAX,EAAa;EAClB,KAAK,EAAE,GAAG,GACV;;AAPF,AAQC,YARW,CAQX,SAAS,AAAA,MAAM,CAAC;EACf,MAAM,EAAE,OAAO,GACf;;AAVF,AAWC,YAXW,CAWX,EAAE,CAAC,CAAC,CAAC;EACJ,WAAW,EAAE,GAAG;EAChB,SAAS,EAAE,IAAI,GACf;;AAdF,AAeC,YAfW,CAeX,mBAAmB,CAAC;EACnB,UAAU,EAAE,IAAI,GAChB;;AAjBF,AAmBC,YAnBW,CAmBX,YAAY,EAnBb,YAAY,CAmBG,WAAW,CAAC;EACzB,KAAK,EAAE,GAAG;EACV,WAAW,EAAE,IAAI,GAIjB;EAzBF,AAsBE,YAtBU,CAmBX,YAAY,AAGV,YAAY,EAtBf,YAAY,CAmBG,WAAW,AAGvB,YAAY,CAAC;IACb,OAAO,EAAE,IAAI,GACb;;AAIH,AACC,cADa,CAAC,QAAQ,CACtB,SAAS,CAAC;EACT,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,IAAI,GAYjB;EAfF,AAIE,cAJY,CAAC,QAAQ,CACtB,SAAS,AAGP,OAAO,CAAC;IACR,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,KAAK;IAClB,QAAQ,EAAE,QAAQ;IAClB,sBAAsB,EAAE,WAAW,GACnC;EAXH,AAYE,cAZY,CAAC,QAAQ,CACtB,SAAS,AAWP,OAAO,AAAA,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,GAChB;;AAdH,AAgBC,cAhBa,CAAC,QAAQ,CAgBtB,OAAO,CAAC;EACP,MAAM,EAAE,aAAa,GACrB;;AAlBF,AAmBC,cAnBa,CAAC,QAAQ,CAmBtB,EAAE,CAAC,EAAE,CAAC;EACL,UAAU,EAAE,IAAI,GAChB;;AArBF,AAsBC,cAtBa,CAAC,QAAQ,CAsBtB,EAAE,CAAC;EACF,QAAQ,EAAE,QAAQ,GAClB;;AAEF,AAAA,wBAAwB,CAAC;EACxB,UAAU,EAAE,MAAM,GAClB;;AACD,AAAA,uBAAuB;AACvB,sBAAsB,CAAC;EACtB,UAAU,EAAE,IAAI,GAChB;;AACD,AAAA,kBAAkB;AAClB,iBAAiB,CAAC;EACjB,MAAM,EAAE,KAAK;EACb,aAAa,EAAE,IAAI;EACnB,MAAM,EAAE,QAAQ;EAChB,KAAK,EAAE,IAAI,GACX;;AACD,AAAA,yBAAyB;AACzB,mBAAmB,CAAC;EACnB,MAAM,EAAE,KAAK;EACb,MAAM,EAAE,QAAQ,GAChB;;AACD,AACC,WADU,CACV,cAAc,CAAC;EACd,QAAQ,EAAE,kBAAkB;EAC5B,KAAK,EAAC,CAAC,GASP;EAZF,AAIE,WAJS,CACV,cAAc,AAGZ,OAAO,EAJV,WAAW,CACV,cAAc,AAIZ,MAAM,CAAC;IACP,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,KAAK,GACd;EARH,AASE,WATS,CACV,cAAc,AAQZ,MAAM,CAAC;IACP,KAAK,EAAE,IAAI,GACX;;AAXH,AAaC,WAbU,CAaV,EAAE,GAAG,cAAc,CAAC;EACnB,UAAU,EAAE,CAAC,GACb;;AAfF,AAiBG,WAjBQ,CAgBR,UAAU,CACV,EAAE,CAAC;EACJ,UAAU,EAAE,MAAM,GAChB;;AAnBJ,AAsBE,WAtBS,CAqBV,aAAa,CACZ,GAAG,CAAC;EACH,KAAK,EAAE,cAAc;EACrB,aAAa,EAAE,KAAK;EACpB,eAAe,EAAE,UAAU;EAC3B,UAAU,EAAE,UAAU;EACtB,MAAM,EAAE,YAAY,GAyBpB;EApDH,AA4BG,WA5BQ,CAqBV,aAAa,CACZ,GAAG,AAMD,aAAa,CAAC;IACd,YAAY,EAAE,KAAK;IACnB,aAAa,EAAE,CAAC,GAChB;EA/BJ,AAgCG,WAhCQ,CAqBV,aAAa,CACZ,GAAG,AAUD,KAAK,CAAC;IACN,KAAK,EAAE,YAAY;IACnB,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC,GAgBT;IAnDJ,AAoCI,WApCO,CAqBV,aAAa,CACZ,GAAG,AAUD,KAAK,AAIJ,OAAO,CAAC;MACR,WAAW,EAAE,MAAM;MACnB,KAAK,EAAE,IAAI;MACX,SAAS,EAAE,KAAK;MAChB,WAAW,EAAE,KAAK;MAClB,KAAK,EAAE,OAAO;MACd,OAAO,EAAE,YAAY;MACrB,QAAQ,EAAE,QAAQ;MAClB,UAAU,EAAE,MAAM;MAClB,KAAK,EAAE,IAAI;MACX,MAAM,EAAE,YAAY;MACpB,OAAO,EAAE,OAAO;MAChB,sBAAsB,EAAE,WAAW;MACnC,uBAAuB,EAAE,SAAS,GAClC;;AAKL,AACC,WADU,CACV,mBAAmB,CAAC;EACnB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,MAAM;EACd,OAAO,EAAE,aAAa,GACtB;;AALF,AAOE,WAPS,CAMV,UAAU,CACT,EAAE,CAAC;EACF,WAAW,EAAE,GAAG,GAChB;;AATH,AAWC,WAXU,CAWV,iBAAiB,CAAC;EACjB,aAAa,EAAE,cAAc;EAC7B,YAAY,EAAE,CAAC;EACf,SAAS,EAAE,kBAAkB,GAC7B;;AAEF,AACC,uBADsB,CACtB,KAAK,AAAA,aAAa,CAAC;EAClB,KAAK,EAAE,OAAO,GACd;;AAEF,AAAA,0BAA0B,CAAC;EAC1B,UAAU,EAAE,MAAM,GAClB;;AACD,AAAA,qBAAqB,CAAA;EACjB,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,GAAG,GACtB;;AAED,AAAA,WAAW,CAAC;EACX,KAAK,EAAE,OAAO;EACd,WAAW,EAAE,GAAG;EAChB,OAAO,EAAE,GAAG;EACZ,eAAe,EAAE,IAAI;EACrB,KAAK,EAAE,IAAI,GAYX;EAXA,AAAA,QAAQ,CANT,WAAW,CAMC;IACV,QAAQ,EAAE,QAAQ;IAClB,GAAG,EAAE,GAAG,GACR;EATF,AAUC,WAVU,AAUT,MAAM,CAAC;IACP,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,CAAC,GACV;EAbF,AAcC,WAdU,AAcT,MAAM,CAAC;IACP,UAAU,EAAE,IAAI,GAChB;;AAEF,AAAA,kBAAkB,CAAC;EAClB,KAAK,EAAE,KAAK;EACZ,YAAY,EAAE,GAAG,GAOjB;EATD,AAIC,kBAJiB,CAIjB,GAAG,CAAC;IACH,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,IAAI,GACX;;AAGF,AAAA,eAAe,CAAC;EACf,QAAQ,EAAE,QAAQ;EAClB,IAAI,EAAE,QAAQ;EACd,GAAG,EAAE,IAAI;EACT,KAAK,EAAE,GAAG;EACV,MAAM,EAAE,GAAG;EACX,QAAQ,EAAE,MAAM,GAChB;;AACD,AAAA,aAAa,CAAC;EACb,OAAO,EAAE,KAAK;EACd,UAAU,EAAE,IAAI,GAChB;;AAED,AAAA,2BAA2B,CAAC;EAC3B,UAAU,EAAE,IAAI;EAChB,aAAa,EAAE,IAAI;EACnB,OAAO,EAAE,IAAI,GAIb;EAPD,AAIC,2BAJ0B,CAI1B,KAAK,CAAC;IACL,aAAa,EAAE,IAAI,GACnB;;AAGF,AACC,cADa,CACb,EAAE,CAAC;EACF,UAAU,EAAC,IAAI,GACf;;AAGF,AAAA,UAAU,CAAC;EACV,KAAK,EAAE,KAAK;EACZ,WAAW,EAAE,IAAI;EACjB,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,KAAK,GACZ;;AACD,AAAA,gBAAgB,CAAC;EAChB,OAAO,EAAE,WAAW;EACpB,OAAO,EAAE,YAAY;EACrB,OAAO,EAAE,IAAI;EACb,sBAAsB,EAAE,GAAG;EAC3B,kBAAkB,EAAE,GAAG;EACvB,cAAc,EAAE,GAAG;EACnB,iBAAiB,EAAE,MAAM;EACzB,aAAa,EAAE,MAAM;EACrB,SAAS,EAAE,MAAM;EACjB,uBAAuB,EAAE,aAAa;EACtC,aAAa,EAAE,OAAO;EACtB,eAAe,EAAE,aAAa;EAC9B,qBAAqB,EAAE,OAAO;EAC9B,aAAa,EAAE,OAAO;EACtB,mBAAmB,EAAE,UAAU;EAC/B,cAAc,EAAE,KAAK;EACrB,WAAW,EAAE,UAAU;EACvB,MAAM,EAAE,MAAM,GAwCd;EA1DD,AAoBC,gBApBe,CAoBf,CAAC,AAAA,UAAW,CAAA,CAAC,EAAE;IACd,cAAc,EAAE,CAAC;IACjB,KAAK,EAAE,CAAC;IACR,YAAY,EAAE,QAAQ;IACtB,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,QAAQ;IACd,kBAAkB,EAAE,IAAI;IACxB,UAAU,EAAE,IAAI,GAChB;EA5BF,AA8BC,gBA9Be,CA8Bf,CAAC,AAAA,UAAW,CAAA,CAAC,EAAE;IACd,cAAc,EAAE,CAAC;IACjB,KAAK,EAAE,CAAC;IACR,YAAY,EAAE,QAAQ;IACtB,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,QAAQ;IACd,kBAAkB,EAAE,IAAI;IACxB,UAAU,EAAE,IAAI,GAChB;EAtCF,AAwCC,gBAxCe,CAwCf,CAAC,AAAA,UAAW,CAAA,CAAC,EAAE;IACd,cAAc,EAAE,CAAC;IACjB,KAAK,EAAE,CAAC;IACR,YAAY,EAAE,QAAQ;IACtB,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,QAAQ;IACd,kBAAkB,EAAE,IAAI;IACxB,UAAU,EAAE,IAAI,GAChB;EAhDF,AAiDC,gBAjDe,CAiDf,CAAC,CAAC;IACA,OAAO,EAAE,KAAK,GAOf;IAzDF,AAmDG,gBAnDa,CAiDf,CAAC,AAEE,UAAW,CAAA,CAAC,EAAE;MAChB,YAAY,EAAE,CAAC,GACb;IArDJ,AAsDG,gBAtDa,CAiDf,CAAC,AAKE,UAAW,CAAA,CAAC,EAAE;MAChB,aAAa,EAAE,CAAC,GACd;;AAGJ,AACC,MADK,CACL,kBAAkB,CAAC;EAClB,OAAO,EAAE,IACV,GAAC;;AAEF,AACC,eADc,CACd,EAAE,CAAC;EACF,WAAW,EAAE,IAAI,GACjB;;AAHF,AAKE,eALa,CAId,kBAAkB,CACjB,EAAE,CAAC;EACF,KAAK,EAAE,SAAS,GAChB;;AAPH,AAUE,eAVa,CASd,iBAAiB,CAChB,EAAE,CAAC;EACF,KAAK,EAAE,GAAG,GACV;;AAGH,AAAA,UAAU,CAAC;EACV,SAAS,EAAE,KAAK,GAChB;;AAED,AAAA,0BAA0B,CAAC;EAC1B,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,KAAK;EACb,SAAS,EAAE,IAAI;EACf,gBAAgB,EAAE,IAAI;EACtB,UAAU,EAAG,IAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,mBAAmB;EAChD,QAAQ,EAAE,MAAM;EAChB,OAAO,EAAE,GAAG;EACZ,UAAU,EAAE,UAAU,GA+BtB;EAxCD,AAWC,0BAXyB,CAWzB,EAAE,CAAC;IACF,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,CAAC,GA0BV;IAvCF,AAeE,0BAfwB,CAWzB,EAAE,CAID,UAAU,CAAC;MACV,KAAK,EAAE,IAAI;MACX,MAAM,EAAE,IAAI;MACZ,SAAS,EAAE,IAAI,GACf;IAnBH,AAqBE,0BArBwB,CAWzB,EAAE,CAUD,EAAE,CAAC;MACF,OAAO,EAAE,YAAY;MACrB,MAAM,EAAE,GAAG;MACX,KAAK,EAAE,IAAI,GAcX;MAtCH,AA0BG,0BA1BuB,CAWzB,EAAE,CAUD,EAAE,CAKD,CAAC,CAAC;QACD,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,IAAI;QACrB,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,iBAAiB,GAMzB;QArCJ,AAiCI,0BAjCsB,CAWzB,EAAE,CAUD,EAAE,CAKD,CAAC,AAOC,MAAM,CAAC;UACP,YAAY,EAAE,IAAI;UAClB,UAAU,EAAE,OAAO,GACnB;;AAML,AAAA,wBAAwB,CAAC;EACxB,MAAM,EAAE,IAAI,GAkBZ;EAnBD,AAGC,wBAHuB,CAGvB,CAAC,CAAC;IACD,OAAO,EAAE,GAAG;IACZ,eAAe,EAAE,IAAI;IACrB,WAAW,EAAE,IAAI;IACjB,KAAK,EAAE,IAAI,GAMX;IAbF,AASE,wBATsB,CAGvB,CAAC,CAMA,IAAI,CAAC;MACJ,OAAO,EAAE,MAAM;MACf,cAAc,EAAE,MAAM,GACtB;EAZH,AAeC,wBAfuB,CAevB,KAAK,CAAC;IACL,SAAS,EAAE,IAAI;IACf,KAAK,EAAE,KAAK,GACZ;;AAGF,MAAM,CAAC,MAAM,MAAM,SAAS,EAAE,KAAK;EAClC,AAAA,YAAY,CAAC;IACZ,UAAU,EAAE,KAAK;IACd,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,MAAM;IAClB,aAAa,EAAE,IAAI;IACnB,UAAU,EAAE,qCAAqC,CAAC,SAAS;IAC9D,eAAe,EAAE,OAAO,GACxB;;AAGF,MAAM,CAAC,MAAM,MAAM,SAAS,EAAE,KAAK;EACjC,AACD,YADa,CACb,YAAY,CAAC;IACX,KAAK,EAAE,IAAI,GACZ;EAEA,AAAA,gBAAgB,CAAC;IAClB,SAAS,EAAE,IAAI,GAUb;IAXD,AAED,gBAFiB,CAEjB,CAAC,CAAC;MACA,MAAM,EAAE,QAAQ,GAOjB;MAVA,AAIC,gBAJe,CAEjB,CAAC,AAEE,UAAW,CAAA,CAAC,EAAE;QAChB,YAAY,EAAE,GAAG,GACf;MANF,AAOC,gBAPe,CAEjB,CAAC,AAKE,UAAW,CAAA,CAAC,EAAE;QAChB,aAAa,EAAE,GAAG,GAChB;EAGF,AACD,YADa,CACb,EAAE,AAAA,MAAM,CAAC;IACP,KAAK,EAAE,IAAI,GACZ;EAGA,AAAA,uBAAuB,CAAC;IACzB,KAAK,EAAE,IAAI,GACT"
|
9 |
+
}
|
build/cptui-styles.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.posttypesui,.taxonomiesui{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%}}
|
build/dashicons-picker.js
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
build/dashicons-picker.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
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);
|
build/dashicons-picker.min.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
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,KAC3CC,IAgBUC,EAbWZ,EAHRA,EAKTa,EAASrB,EAAG,cACfsB,EAAUtB,EAAGQ,EAAOe,KAAM,YAC1BC,EAASxB,EAAG,kIAGDyB,IAAK,CACfR,IAAQX,EACRY,KAAQX,IAETmB,EAAOF,EAAMG,KAAM,yBAEpB,IAAUP,KAAKjB,EACTA,EAAMyB,eAAeR,IACzBM,EAAKG,OAAO,kBAAoB1B,EAAMiB,GAAK,wBAA0BjB,EAAMiB,GAAK,sCAAwCjB,EAAMiB,GAAK,sBAIrIpB,EAAG,IAAK0B,GAAOb,GAAI,QAAS,SAAWC,GACtCA,EAAEgB,iBACEC,EAAQ/B,EAAGI,MAAO4B,KAAM,SAC5BX,EAAOY,IAAK,aAAeF,GAAQG,SACnCZ,EACEa,KAAK,QAAS,aACdC,SAAU,aAAeL,GAC3BtB,OAGG4B,EAAUb,EAAMG,KAAM,6BAElBW,KAAM,yPAMdtC,EAAG,IAAKqC,GAAUxB,GAAI,QAAS,SAAWC,GACzCA,EAAEgB,iBACqC,SAAlC9B,EAAGI,MAAOmB,KAAM,aACpBvB,EAAG,UAAaG,EAAMoC,OAAS,IAAO,IAAKb,GAAOc,UAAWd,GAE7D1B,EAAG,YAAa0B,GAAOe,SAAUf,KAInCF,EAAMiB,SAAU,QAASC,OAEzB1C,EAAG,QAASqC,GAAUxB,GAAI,QAAS,SAAWC,GAC7C,IAAI6B,EAAS3C,EAAGI,MAAO6B,MACP,KAAXU,EACJ3C,EAAG,YAAa0B,GAAOgB,OAEvB1C,EAAG,KAAM0B,GAAOrB,KAAM,YAC4D,IAA5EL,EAAGI,MAAOmB,KAAM,QAASqB,cAAcC,QAASF,EAAOC,eAC3D5C,EAAGI,MAAOsC,OAEV1C,EAAGI,MAAO0C,WAMd9C,EAAGW,UAAWE,GAAI,2BAA4B,SAAWC,GACjDU,EAAMuB,GAAIjC,EAAEO,SAA6C,IAAjCG,EAAMwB,IAAKlC,EAAEO,QAASkB,QACpD9B,WAYLT,EAAG,WACFA,EAAG,qBAAsBE,oBAzZ1B,CA4ZE+C"}
|
classes/class.cptui_admin_ui.php
CHANGED
@@ -22,11 +22,18 @@ class cptui_admin_ui {
|
|
22 |
* Return an opening `<tr>` tag.
|
23 |
*
|
24 |
* @since 1.0.0
|
|
|
25 |
*
|
|
|
26 |
* @return string $value Opening `<tr>` tag with attributes.
|
27 |
*/
|
28 |
-
public function get_tr_start() {
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
|
32 |
/**
|
@@ -44,11 +51,17 @@ class cptui_admin_ui {
|
|
44 |
* Return an opening `<th>` tag.
|
45 |
*
|
46 |
* @since 1.0.0
|
|
|
47 |
*
|
|
|
48 |
* @return string $value Opening `<th>` tag with attributes.
|
49 |
*/
|
50 |
-
public function get_th_start() {
|
51 |
-
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
/**
|
@@ -66,11 +79,17 @@ class cptui_admin_ui {
|
|
66 |
* Return an opening `<td>` tag.
|
67 |
*
|
68 |
* @since 1.0.0
|
|
|
69 |
*
|
|
|
70 |
* @return string $value Opening `<td>` tag.
|
71 |
*/
|
72 |
-
public function get_td_start() {
|
73 |
-
|
|
|
|
|
|
|
|
|
74 |
}
|
75 |
|
76 |
/**
|
@@ -89,11 +108,13 @@ class cptui_admin_ui {
|
|
89 |
*
|
90 |
* @since 1.2.0
|
91 |
* @since 1.3.0 Added $args parameter.
|
|
|
92 |
*
|
93 |
* @param array $args Array of arguments.
|
|
|
94 |
* @return string $value Opening `<fieldset>` tag.
|
95 |
*/
|
96 |
-
public function get_fieldset_start( $args = [] ) {
|
97 |
$fieldset = '<fieldset';
|
98 |
|
99 |
if ( ! empty( $args['id'] ) ) {
|
@@ -109,6 +130,10 @@ class cptui_admin_ui {
|
|
109 |
$fieldset .= ' aria-expanded="' . $args['aria-expanded'] . '"';
|
110 |
}
|
111 |
|
|
|
|
|
|
|
|
|
112 |
$fieldset .= ' tabindex="0">';
|
113 |
|
114 |
return $fieldset;
|
@@ -132,8 +157,12 @@ class cptui_admin_ui {
|
|
132 |
*
|
133 |
* @return string
|
134 |
*/
|
135 |
-
public function get_legend_start() {
|
136 |
-
|
|
|
|
|
|
|
|
|
137 |
}
|
138 |
|
139 |
/**
|
@@ -294,7 +323,9 @@ class cptui_admin_ui {
|
|
294 |
*/
|
295 |
public function get_select_input( $args = [] ) {
|
296 |
$defaults = $this->get_default_input_parameters(
|
297 |
-
[
|
|
|
|
|
298 |
);
|
299 |
|
300 |
$args = wp_parse_args( $args, $defaults );
|
@@ -536,7 +567,7 @@ class cptui_admin_ui {
|
|
536 |
public function get_button( $args = [] ) {
|
537 |
$value = '';
|
538 |
$classes = isset( $args['classes'] ) ? $args['classes'] : '';
|
539 |
-
$value
|
540 |
|
541 |
return $value;
|
542 |
}
|
@@ -586,4 +617,23 @@ class cptui_admin_ui {
|
|
586 |
(array) $additions
|
587 |
);
|
588 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
589 |
}
|
22 |
* Return an opening `<tr>` tag.
|
23 |
*
|
24 |
* @since 1.0.0
|
25 |
+
* @since 1.13.0 Added attributes parameter
|
26 |
*
|
27 |
+
* @param array $atts Array of custom attributes to add to the tag.
|
28 |
* @return string $value Opening `<tr>` tag with attributes.
|
29 |
*/
|
30 |
+
public function get_tr_start( $atts = [] ) {
|
31 |
+
|
32 |
+
$atts_str = '';
|
33 |
+
if ( ! empty( $atts ) ) {
|
34 |
+
$atts_str = ' ' . $this->get_custom_attributes( $atts );
|
35 |
+
}
|
36 |
+
return '<tr' . $atts_str . '>';
|
37 |
}
|
38 |
|
39 |
/**
|
51 |
* Return an opening `<th>` tag.
|
52 |
*
|
53 |
* @since 1.0.0
|
54 |
+
* @since 1.13.0 Added attributes parameter.
|
55 |
*
|
56 |
+
* @param array $atts Array of attributes to add to the tag.
|
57 |
* @return string $value Opening `<th>` tag with attributes.
|
58 |
*/
|
59 |
+
public function get_th_start( $atts = [] ) {
|
60 |
+
$atts_str = '';
|
61 |
+
if ( ! empty( $atts ) ) {
|
62 |
+
$atts_str = ' ' . $this->get_custom_attributes( $atts );
|
63 |
+
}
|
64 |
+
return "<th scope=\"row\"{$atts_str}>";
|
65 |
}
|
66 |
|
67 |
/**
|
79 |
* Return an opening `<td>` tag.
|
80 |
*
|
81 |
* @since 1.0.0
|
82 |
+
* @since 1.13.0 Added attributes parameter.
|
83 |
*
|
84 |
+
* @param array $atts Array of attributes to add to the tag.
|
85 |
* @return string $value Opening `<td>` tag.
|
86 |
*/
|
87 |
+
public function get_td_start( $atts = [] ) {
|
88 |
+
$atts_str = '';
|
89 |
+
if ( ! empty( $atts ) ) {
|
90 |
+
$atts_str = ' ' . $this->get_custom_attributes( $atts );
|
91 |
+
}
|
92 |
+
return "<td{$atts_str}>";
|
93 |
}
|
94 |
|
95 |
/**
|
108 |
*
|
109 |
* @since 1.2.0
|
110 |
* @since 1.3.0 Added $args parameter.
|
111 |
+
* @since 1.13.0 Added $atts parameter
|
112 |
*
|
113 |
* @param array $args Array of arguments.
|
114 |
+
* @param array $atts Array of custom attributes for the tag.
|
115 |
* @return string $value Opening `<fieldset>` tag.
|
116 |
*/
|
117 |
+
public function get_fieldset_start( $args = [], $atts = [] ) {
|
118 |
$fieldset = '<fieldset';
|
119 |
|
120 |
if ( ! empty( $args['id'] ) ) {
|
130 |
$fieldset .= ' aria-expanded="' . $args['aria-expanded'] . '"';
|
131 |
}
|
132 |
|
133 |
+
if ( ! empty( $atts ) ) {
|
134 |
+
$fieldset .= ' ' . $this->get_custom_attributes( $atts );
|
135 |
+
}
|
136 |
+
|
137 |
$fieldset .= ' tabindex="0">';
|
138 |
|
139 |
return $fieldset;
|
157 |
*
|
158 |
* @return string
|
159 |
*/
|
160 |
+
public function get_legend_start( $atts = [] ) {
|
161 |
+
$atts_str = '';
|
162 |
+
if ( ! empty( $atts ) ) {
|
163 |
+
$atts_str = ' ' . $this->get_custom_attributes( $atts );
|
164 |
+
}
|
165 |
+
return "<legend class=\"screen-reader-text\"{$atts_str}>";
|
166 |
}
|
167 |
|
168 |
/**
|
323 |
*/
|
324 |
public function get_select_input( $args = [] ) {
|
325 |
$defaults = $this->get_default_input_parameters(
|
326 |
+
[
|
327 |
+
'selections' => [],
|
328 |
+
]
|
329 |
);
|
330 |
|
331 |
$args = wp_parse_args( $args, $defaults );
|
567 |
public function get_button( $args = [] ) {
|
568 |
$value = '';
|
569 |
$classes = isset( $args['classes'] ) ? $args['classes'] : '';
|
570 |
+
$value .= '<input id="' . $args['id'] . '" class="button ' . $classes . '" type="button" value="' . $args['textvalue'] . '" />';
|
571 |
|
572 |
return $value;
|
573 |
}
|
617 |
(array) $additions
|
618 |
);
|
619 |
}
|
620 |
+
|
621 |
+
/**
|
622 |
+
* Return combined attributes string.
|
623 |
+
*
|
624 |
+
* @param array $attributes Array of attributes to combine.
|
625 |
+
*
|
626 |
+
* @return string
|
627 |
+
* @since 1.13.0
|
628 |
+
*/
|
629 |
+
public function get_custom_attributes( $attributes = [] ) {
|
630 |
+
$formatted = [];
|
631 |
+
if ( ! empty( $attributes ) ) {
|
632 |
+
foreach ( $attributes as $key => $attribute ) {
|
633 |
+
$formatted[] = "$key=\"$attribute\"";
|
634 |
+
}
|
635 |
+
}
|
636 |
+
|
637 |
+
return implode( ' ', $formatted );
|
638 |
+
}
|
639 |
}
|
classes/class.cptui_debug_info.php
CHANGED
@@ -21,10 +21,10 @@ class CPTUI_Debug_Info {
|
|
21 |
*/
|
22 |
public function tab_site_info() {
|
23 |
?>
|
24 |
-
<p><?php
|
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 $this->system_status(); ?>
|
28 |
</textarea></label>
|
29 |
<?php
|
30 |
}
|
@@ -44,40 +44,40 @@ class CPTUI_Debug_Info {
|
|
44 |
global $wpdb;
|
45 |
|
46 |
$theme_data = wp_get_theme();
|
47 |
-
$theme
|
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 site_url() . "\n"; ?>
|
57 |
-
HOME_URL: <?php echo home_url() . "\n"; ?>
|
58 |
|
59 |
-
WordPress Version: <?php echo get_bloginfo( 'version' ) . "\n"; ?>
|
60 |
-
Permalink Structure: <?php echo get_option( 'permalink_structure' ) . "\n"; ?>
|
61 |
-
Active Theme: <?php echo $theme . "\n"; ?>
|
62 |
|
63 |
-
Registered Post Types: <?php echo implode( ', ', get_post_types( '', 'names' ) ) . "\n"; ?>
|
64 |
|
65 |
PHP Version: <?php echo PHP_VERSION . "\n"; ?>
|
66 |
-
MySQL Version: <?php echo $wpdb->db_version() . "\n"; ?>
|
67 |
-
Web Server Info: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?>
|
68 |
|
69 |
-
Show On Front: <?php echo get_option( 'show_on_front' ) . "\n" ?>
|
70 |
-
Page On Front: <?php $id = get_option( 'page_on_front' );
|
71 |
-
echo get_the_title( $id ) . ' (#' . $id . ')' . "\n" ?>
|
72 |
-
Page For Posts: <?php $id = get_option( 'page_for_posts' );
|
73 |
-
echo get_the_title( $id ) . ' (#' . $id . ')' . "\n" ?>
|
74 |
|
75 |
-
WordPress Memory Limit: <?php echo ( $this->num_convt( WP_MEMORY_LIMIT ) / ( 1024 ) ) . 'MB'; ?><?php echo "\n"; ?>
|
76 |
|
77 |
<?php
|
78 |
$plugins = get_plugins();
|
79 |
$pg_count = count( $plugins );
|
80 |
-
echo 'TOTAL PLUGINS: ' . $pg_count . "\n\n";
|
81 |
// MU plugins.
|
82 |
$mu_plugins = get_mu_plugins();
|
83 |
|
@@ -86,7 +86,7 @@ class CPTUI_Debug_Info {
|
|
86 |
|
87 |
foreach ( $mu_plugins as $mu_path => $mu_plugin ) {
|
88 |
|
89 |
-
echo "\t\t" . $mu_plugin['Name'] . ': ' . $mu_plugin['Version'] . "\n";
|
90 |
}
|
91 |
endif;
|
92 |
// Standard plugins - active.
|
@@ -96,27 +96,27 @@ class CPTUI_Debug_Info {
|
|
96 |
$ac_count = count( $active );
|
97 |
$ic_count = $pg_count - $ac_count;
|
98 |
|
99 |
-
echo "\t\t" . 'ACTIVE PLUGINS: (' . $ac_count . ')' . "\n\n";
|
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 ) ) {
|
104 |
continue;
|
105 |
}
|
106 |
|
107 |
-
echo "\t\t" . $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
|
108 |
}
|
109 |
// Standard plugins - inactive.
|
110 |
echo "\n";
|
111 |
-
echo "\t\t" , 'INACTIVE PLUGINS: (' . $ic_count . ')' . "\n\n";
|
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 ) ) {
|
116 |
continue;
|
117 |
}
|
118 |
|
119 |
-
echo "\t\t" . $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
|
120 |
}
|
121 |
|
122 |
// If multisite, grab network as well.
|
@@ -138,7 +138,7 @@ class CPTUI_Debug_Info {
|
|
138 |
|
139 |
$plugin = get_plugin_data( $plugin_path );
|
140 |
|
141 |
-
echo $plugin['Name'] . ' :' . $plugin['Version'] . "\n";
|
142 |
}
|
143 |
|
144 |
endif;
|
@@ -146,13 +146,13 @@ class CPTUI_Debug_Info {
|
|
146 |
echo "\n";
|
147 |
$cptui_post_types = cptui_get_post_type_data();
|
148 |
echo "\t\t" . 'Post Types: ' . "\n";
|
149 |
-
echo "\t\t" .
|
150 |
|
151 |
echo "\n\n";
|
152 |
|
153 |
$cptui_taxonomies = cptui_get_taxonomy_data();
|
154 |
echo "\t\t" . 'Taxonomies: ' . "\n";
|
155 |
-
echo "\t\t" .
|
156 |
echo "\n";
|
157 |
|
158 |
if ( has_action( 'cptui_custom_debug_info' ) ) {
|
@@ -229,11 +229,14 @@ class CPTUI_Debug_Info {
|
|
229 |
*
|
230 |
* @param string $value Intended email subject.
|
231 |
*/
|
232 |
-
$subject = apply_filters(
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
|
|
|
|
|
|
237 |
|
238 |
$result = wp_mail( $args['email'], $subject, $message );
|
239 |
|
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 |
}
|
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 |
|
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.
|
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.
|
138 |
|
139 |
$plugin = get_plugin_data( $plugin_path );
|
140 |
|
141 |
+
echo esc_html( $plugin['Name'] ) . ' :' . esc_html( $plugin['Version'] ) . "\n";
|
142 |
}
|
143 |
|
144 |
endif;
|
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' ) ) {
|
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 |
|
css/cptui.css
DELETED
@@ -1,456 +0,0 @@
|
|
1 |
-
.posttypesui, .taxonomiesui {
|
2 |
-
width: calc(100% - 300px);
|
3 |
-
}
|
4 |
-
|
5 |
-
.posttypesui .cptui-section:first-child, .taxonomiesui .cptui-section:first-child {
|
6 |
-
margin-top: 30px;
|
7 |
-
}
|
8 |
-
|
9 |
-
.posttypesui .postbox-container, .taxonomiesui .postbox-container {
|
10 |
-
width: 100%;
|
11 |
-
}
|
12 |
-
|
13 |
-
.posttypesui .postbox .toggle-indicator:before, .taxonomiesui .postbox .toggle-indicator:before {
|
14 |
-
content: "\f142";
|
15 |
-
display: inline-block;
|
16 |
-
font: normal 20px/1 dashicons;
|
17 |
-
speak: none;
|
18 |
-
-webkit-font-smoothing: antialiased;
|
19 |
-
-moz-osx-font-smoothing: grayscale;
|
20 |
-
text-decoration: none !important;
|
21 |
-
}
|
22 |
-
|
23 |
-
.posttypesui .postbox.closed .handlediv .toggle-indicator::before, .taxonomiesui .postbox.closed .handlediv .toggle-indicator::before {
|
24 |
-
content: "\f140";
|
25 |
-
}
|
26 |
-
|
27 |
-
.posttypesui .postbox .hndle, .taxonomiesui .postbox .hndle {
|
28 |
-
cursor: pointer;
|
29 |
-
}
|
30 |
-
|
31 |
-
.posttypesui .required, .taxonomiesui .required {
|
32 |
-
color: red;
|
33 |
-
}
|
34 |
-
|
35 |
-
.cptui-table td.outer {
|
36 |
-
vertical-align: top;
|
37 |
-
width: 50%;
|
38 |
-
}
|
39 |
-
|
40 |
-
.cptui-table input[type="text"] {
|
41 |
-
width: 75%;
|
42 |
-
}
|
43 |
-
|
44 |
-
.cptui-table .question:hover {
|
45 |
-
cursor: pointer;
|
46 |
-
}
|
47 |
-
|
48 |
-
.cptui-table th p {
|
49 |
-
font-weight: 400;
|
50 |
-
font-size: 12px;
|
51 |
-
}
|
52 |
-
|
53 |
-
.cptui-table .cptui-slug-details {
|
54 |
-
margin-top: 15px;
|
55 |
-
}
|
56 |
-
|
57 |
-
.cptui-table #slugchanged, .cptui-table #slugexists {
|
58 |
-
color: red;
|
59 |
-
font-weight: bold;
|
60 |
-
}
|
61 |
-
|
62 |
-
.cptui-table #slugchanged.hidemessage, .cptui-table #slugexists.hidemessage {
|
63 |
-
display: none;
|
64 |
-
}
|
65 |
-
|
66 |
-
.cptui-support #support .question {
|
67 |
-
font-size: 18px;
|
68 |
-
font-weight: bold;
|
69 |
-
}
|
70 |
-
|
71 |
-
.cptui-support #support .question:before {
|
72 |
-
content: "\f139";
|
73 |
-
display: inline-block;
|
74 |
-
font: normal 25px/1 'dashicons';
|
75 |
-
margin-left: -25px;
|
76 |
-
position: absolute;
|
77 |
-
-webkit-font-smoothing: antialiased;
|
78 |
-
}
|
79 |
-
|
80 |
-
.cptui-support #support .question.active:before {
|
81 |
-
content: "\f140";
|
82 |
-
}
|
83 |
-
|
84 |
-
.cptui-support #support .answer {
|
85 |
-
margin: 10px 0 0 20px;
|
86 |
-
}
|
87 |
-
|
88 |
-
.cptui-support #support ol li {
|
89 |
-
list-style: none;
|
90 |
-
}
|
91 |
-
|
92 |
-
.cptui-support #support li {
|
93 |
-
position: relative;
|
94 |
-
}
|
95 |
-
|
96 |
-
.cptui-field-description {
|
97 |
-
font-style: italic;
|
98 |
-
}
|
99 |
-
|
100 |
-
#cptui_select_post_type,
|
101 |
-
#cptui_select_taxonomy {
|
102 |
-
margin-top: 15px;
|
103 |
-
}
|
104 |
-
|
105 |
-
.cptui_post_import,
|
106 |
-
.cptui_tax_import {
|
107 |
-
height: 200px;
|
108 |
-
margin-bottom: 10px;
|
109 |
-
resize: vertical;
|
110 |
-
width: 100%;
|
111 |
-
}
|
112 |
-
|
113 |
-
.cptui_post_type_get_code,
|
114 |
-
.cptui_tax_get_code {
|
115 |
-
height: 300px;
|
116 |
-
resize: vertical;
|
117 |
-
}
|
118 |
-
|
119 |
-
.about-wrap .cptui-feature {
|
120 |
-
overflow: visible !important;
|
121 |
-
*zoom: 1;
|
122 |
-
}
|
123 |
-
|
124 |
-
.about-wrap .cptui-feature:before, .about-wrap .cptui-feature:after {
|
125 |
-
content: " ";
|
126 |
-
display: table;
|
127 |
-
}
|
128 |
-
|
129 |
-
.about-wrap .cptui-feature:after {
|
130 |
-
clear: both;
|
131 |
-
}
|
132 |
-
|
133 |
-
.about-wrap h3 + .cptui-feature {
|
134 |
-
margin-top: 0;
|
135 |
-
}
|
136 |
-
|
137 |
-
.about-wrap .changelog h2 {
|
138 |
-
text-align: center;
|
139 |
-
}
|
140 |
-
|
141 |
-
.about-wrap .feature-rest div {
|
142 |
-
width: 50% !important;
|
143 |
-
padding-right: 100px;
|
144 |
-
box-sizing: border-box;
|
145 |
-
margin: 0 !important;
|
146 |
-
}
|
147 |
-
|
148 |
-
.about-wrap .feature-rest div.last-feature {
|
149 |
-
padding-left: 100px;
|
150 |
-
padding-right: 0;
|
151 |
-
}
|
152 |
-
|
153 |
-
.about-wrap .feature-rest div.icon {
|
154 |
-
width: 0 !important;
|
155 |
-
padding: 0;
|
156 |
-
margin: 0;
|
157 |
-
}
|
158 |
-
|
159 |
-
.about-wrap .feature-rest div.icon:before {
|
160 |
-
font-weight: normal;
|
161 |
-
width: 100%;
|
162 |
-
font-size: 170px;
|
163 |
-
line-height: 125px;
|
164 |
-
color: #9c5d90;
|
165 |
-
display: inline-block;
|
166 |
-
position: relative;
|
167 |
-
text-align: center;
|
168 |
-
speak: none;
|
169 |
-
margin: 0 0 0 -100px;
|
170 |
-
content: "\e01d";
|
171 |
-
-webkit-font-smoothing: antialiased;
|
172 |
-
-moz-osx-font-smoothing: grayscale;
|
173 |
-
}
|
174 |
-
|
175 |
-
.about-wrap .about-integrations {
|
176 |
-
background: #fff;
|
177 |
-
margin: 20px 0;
|
178 |
-
padding: 1px 20px 10px;
|
179 |
-
}
|
180 |
-
|
181 |
-
.about-wrap .changelog h4 {
|
182 |
-
line-height: 1.4;
|
183 |
-
}
|
184 |
-
|
185 |
-
.about-wrap .cptui-about-text {
|
186 |
-
margin-bottom: 1em !important;
|
187 |
-
margin-right: 0;
|
188 |
-
max-width: calc(100% - 173px);
|
189 |
-
}
|
190 |
-
|
191 |
-
.email-octopus-form-row input:-ms-input-placeholder {
|
192 |
-
color: #cccccc;
|
193 |
-
}
|
194 |
-
|
195 |
-
.email-octopus-form-row input::placeholder {
|
196 |
-
color: #cccccc;
|
197 |
-
}
|
198 |
-
|
199 |
-
.email-octopus-form-row-hp {
|
200 |
-
visibility: hidden;
|
201 |
-
}
|
202 |
-
|
203 |
-
.cptui-intro-devblock {
|
204 |
-
display: -ms-flexbox;
|
205 |
-
display: flex;
|
206 |
-
-ms-flex-direction: row;
|
207 |
-
flex-direction: row;
|
208 |
-
}
|
209 |
-
|
210 |
-
.cptui-help {
|
211 |
-
color: #424242;
|
212 |
-
margin-left: 4px;
|
213 |
-
opacity: 0.5;
|
214 |
-
text-decoration: none;
|
215 |
-
width: 16px;
|
216 |
-
}
|
217 |
-
|
218 |
-
fieldset .cptui-help {
|
219 |
-
position: relative;
|
220 |
-
top: 4px;
|
221 |
-
}
|
222 |
-
|
223 |
-
.cptui-help:hover {
|
224 |
-
color: #0074a2;
|
225 |
-
opacity: 1;
|
226 |
-
}
|
227 |
-
|
228 |
-
.cptui-help:focus {
|
229 |
-
box-shadow: none;
|
230 |
-
}
|
231 |
-
|
232 |
-
#menu_icon_preview {
|
233 |
-
float: right;
|
234 |
-
padding-left: 8px;
|
235 |
-
}
|
236 |
-
|
237 |
-
#menu_icon_preview img {
|
238 |
-
display: block;
|
239 |
-
height: 20px;
|
240 |
-
width: 20px;
|
241 |
-
}
|
242 |
-
|
243 |
-
.visuallyhidden {
|
244 |
-
position: absolute;
|
245 |
-
left: -10000px;
|
246 |
-
top: auto;
|
247 |
-
width: 1px;
|
248 |
-
height: 1px;
|
249 |
-
overflow: hidden;
|
250 |
-
}
|
251 |
-
|
252 |
-
.cptui-spacer {
|
253 |
-
display: block;
|
254 |
-
margin-top: 25px;
|
255 |
-
}
|
256 |
-
|
257 |
-
.email-octopus-form-wrapper {
|
258 |
-
background: #fff;
|
259 |
-
margin-bottom: 10px;
|
260 |
-
padding: 20px;
|
261 |
-
}
|
262 |
-
|
263 |
-
.email-octopus-form-wrapper label {
|
264 |
-
margin-bottom: 10px;
|
265 |
-
}
|
266 |
-
|
267 |
-
.wdsoctosignup h2 {
|
268 |
-
text-align: left;
|
269 |
-
}
|
270 |
-
|
271 |
-
.wdspromos {
|
272 |
-
float: right;
|
273 |
-
margin-left: 20px;
|
274 |
-
margin-top: 10px;
|
275 |
-
width: 275px;
|
276 |
-
}
|
277 |
-
|
278 |
-
.wdspromos-about {
|
279 |
-
display: -ms-flexbox;
|
280 |
-
display: flex;
|
281 |
-
-ms-flex-direction: row;
|
282 |
-
flex-direction: row;
|
283 |
-
-ms-flex-wrap: nowrap;
|
284 |
-
flex-wrap: nowrap;
|
285 |
-
-ms-flex-pack: justify;
|
286 |
-
justify-content: space-between;
|
287 |
-
-ms-flex-line-pack: stretch;
|
288 |
-
align-content: stretch;
|
289 |
-
-ms-flex-align: start;
|
290 |
-
align-items: flex-start;
|
291 |
-
margin: 20px 0;
|
292 |
-
}
|
293 |
-
|
294 |
-
.wdspromos-about a:nth-child(1) {
|
295 |
-
-ms-flex-order: 0;
|
296 |
-
order: 0;
|
297 |
-
-ms-flex: 0 1 auto;
|
298 |
-
flex: 0 1 auto;
|
299 |
-
-ms-flex-item-align: auto;
|
300 |
-
-ms-grid-row-align: auto;
|
301 |
-
align-self: auto;
|
302 |
-
}
|
303 |
-
|
304 |
-
.wdspromos-about a:nth-child(2) {
|
305 |
-
-ms-flex-order: 0;
|
306 |
-
order: 0;
|
307 |
-
-ms-flex: 0 1 auto;
|
308 |
-
flex: 0 1 auto;
|
309 |
-
-ms-flex-item-align: auto;
|
310 |
-
-ms-grid-row-align: auto;
|
311 |
-
align-self: auto;
|
312 |
-
}
|
313 |
-
|
314 |
-
.wdspromos-about a:nth-child(3) {
|
315 |
-
-ms-flex-order: 0;
|
316 |
-
order: 0;
|
317 |
-
-ms-flex: 0 1 auto;
|
318 |
-
flex: 0 1 auto;
|
319 |
-
-ms-flex-item-align: auto;
|
320 |
-
-ms-grid-row-align: auto;
|
321 |
-
align-self: auto;
|
322 |
-
}
|
323 |
-
|
324 |
-
.wdspromos-about p {
|
325 |
-
padding: 0 5px;
|
326 |
-
}
|
327 |
-
|
328 |
-
.wdspromos-about p:nth-child(1) {
|
329 |
-
padding-left: 0;
|
330 |
-
}
|
331 |
-
|
332 |
-
.wdspromos-about p:nth-child(4) {
|
333 |
-
padding-right: 0;
|
334 |
-
}
|
335 |
-
|
336 |
-
.no-js #cptui_choose_icon {
|
337 |
-
display: none;
|
338 |
-
}
|
339 |
-
|
340 |
-
.cptui-listings th {
|
341 |
-
font-weight: bold;
|
342 |
-
}
|
343 |
-
|
344 |
-
.cptui-listings .post-type-listing th {
|
345 |
-
width: 16.66667%;
|
346 |
-
}
|
347 |
-
|
348 |
-
.cptui-listings .taxonomy-listing th {
|
349 |
-
width: 20%;
|
350 |
-
}
|
351 |
-
|
352 |
-
#poststuff {
|
353 |
-
min-width: 463px;
|
354 |
-
}
|
355 |
-
|
356 |
-
.dashicon-picker-container {
|
357 |
-
position: absolute;
|
358 |
-
width: 220px;
|
359 |
-
height: 252px;
|
360 |
-
font-size: 14px;
|
361 |
-
background-color: #fff;
|
362 |
-
box-shadow: -1px 2px 5px 3px rgba(0, 0, 0, 0.41);
|
363 |
-
overflow: hidden;
|
364 |
-
padding: 5px;
|
365 |
-
box-sizing: border-box;
|
366 |
-
}
|
367 |
-
|
368 |
-
.dashicon-picker-container ul {
|
369 |
-
margin: 0 0 10px;
|
370 |
-
padding: 0;
|
371 |
-
}
|
372 |
-
|
373 |
-
.dashicon-picker-container ul .dashicons {
|
374 |
-
width: 20px;
|
375 |
-
height: 20px;
|
376 |
-
font-size: 20px;
|
377 |
-
}
|
378 |
-
|
379 |
-
.dashicon-picker-container ul li {
|
380 |
-
display: inline-block;
|
381 |
-
margin: 5px;
|
382 |
-
float: left;
|
383 |
-
}
|
384 |
-
|
385 |
-
.dashicon-picker-container ul li a {
|
386 |
-
display: block;
|
387 |
-
text-decoration: none;
|
388 |
-
color: #373737;
|
389 |
-
padding: 5px 5px;
|
390 |
-
border: 1px solid #dfdfdf;
|
391 |
-
}
|
392 |
-
|
393 |
-
.dashicon-picker-container ul li a:hover {
|
394 |
-
border-color: #999;
|
395 |
-
background: #efefef;
|
396 |
-
}
|
397 |
-
|
398 |
-
.dashicon-picker-control {
|
399 |
-
height: 32px;
|
400 |
-
}
|
401 |
-
|
402 |
-
.dashicon-picker-control a {
|
403 |
-
padding: 5px;
|
404 |
-
text-decoration: none;
|
405 |
-
line-height: 32px;
|
406 |
-
width: 25px;
|
407 |
-
}
|
408 |
-
|
409 |
-
.dashicon-picker-control a span {
|
410 |
-
display: inline;
|
411 |
-
vertical-align: middle;
|
412 |
-
}
|
413 |
-
|
414 |
-
.dashicon-picker-control input {
|
415 |
-
font-size: 12px;
|
416 |
-
width: 140px;
|
417 |
-
}
|
418 |
-
|
419 |
-
@media screen and (min-width: 769px) {
|
420 |
-
.cptui-badge {
|
421 |
-
margin-top: -42px;
|
422 |
-
height: 173px;
|
423 |
-
width: 173px;
|
424 |
-
color: #fafafa;
|
425 |
-
font-weight: bold;
|
426 |
-
font-size: 14px;
|
427 |
-
text-align: center;
|
428 |
-
margin-bottom: 10px;
|
429 |
-
background: url(../images/cptui-icon-173x173.png) no-repeat;
|
430 |
-
}
|
431 |
-
}
|
432 |
-
|
433 |
-
@media screen and (max-width: 768px) {
|
434 |
-
.cptui-table #description {
|
435 |
-
width: 100%;
|
436 |
-
}
|
437 |
-
.wdspromos-about {
|
438 |
-
-ms-flex-wrap: wrap;
|
439 |
-
flex-wrap: wrap;
|
440 |
-
}
|
441 |
-
.wdspromos-about p {
|
442 |
-
margin: 5px auto;
|
443 |
-
}
|
444 |
-
.wdspromos-about p:nth-child(1) {
|
445 |
-
padding-left: 5px;
|
446 |
-
}
|
447 |
-
.wdspromos-about p:nth-child(4) {
|
448 |
-
padding-right: 5px;
|
449 |
-
}
|
450 |
-
.cptui-table td.outer {
|
451 |
-
width: 100%;
|
452 |
-
}
|
453 |
-
#cptui_debug_info_email {
|
454 |
-
width: 100%;
|
455 |
-
}
|
456 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/cptui.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.posttypesui,.taxonomiesui{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:700}.cptui-table #slugchanged.hidemessage,.cptui-table #slugexists.hidemessage{display:none}.cptui-support #support .question{font-size:18px;font-weight:700}.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:after,.about-wrap .cptui-feature:before{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;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:400;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:-ms-input-placeholder{color:#ccc}.email-octopus-form-row input::placeholder{color:#ccc}.email-octopus-form-row-hp{visibility:hidden}.cptui-intro-devblock{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.cptui-help{color:#424242;margin-left:4px;opacity:.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:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-line-pack:stretch;align-content:stretch;-ms-flex-align:start;align-items:flex-start;margin:20px 0}.wdspromos-about a:first-child,.wdspromos-about a:nth-child(2),.wdspromos-about a:nth-child(3){-ms-flex-order:0;order:0;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-item-align:auto;-ms-grid-row-align:auto;align-self:auto}.wdspromos-about p{padding:0 5px}.wdspromos-about p:first-child{padding-left:0}.wdspromos-about p:nth-child(4){padding-right:0}.no-js #cptui_choose_icon{display:none}.cptui-listings th{font-weight:700}.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,.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;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:700;font-size:14px;text-align:center;margin-bottom:10px;background:url(../images/cptui-icon-173x173.png) no-repeat}}@media screen and (max-width:768px){.cptui-table #description{width:100%}.wdspromos-about{-ms-flex-wrap:wrap;flex-wrap:wrap}.wdspromos-about p{margin:5px auto}.wdspromos-about p:first-child{padding-left:5px}.wdspromos-about p:nth-child(4){padding-right:5px}#cptui_debug_info_email,.cptui-table td.outer{width:100%}}
|
|
css/cptui.scss
DELETED
@@ -1,439 +0,0 @@
|
|
1 |
-
$min-tablet: "screen and (min-width: 769px)";
|
2 |
-
$max-tablet: "screen and (max-width: 768px)";
|
3 |
-
|
4 |
-
.posttypesui, .taxonomiesui {
|
5 |
-
.cptui-section:first-child {
|
6 |
-
margin-top: 30px;
|
7 |
-
}
|
8 |
-
width: calc(100% - 300px);
|
9 |
-
.postbox-container {
|
10 |
-
width: 100%;
|
11 |
-
}
|
12 |
-
.postbox .toggle-indicator:before {
|
13 |
-
content: "\f142";
|
14 |
-
display: inline-block;
|
15 |
-
font: normal 20px/1 dashicons;
|
16 |
-
speak: none;
|
17 |
-
-webkit-font-smoothing: antialiased;
|
18 |
-
-moz-osx-font-smoothing: grayscale;
|
19 |
-
text-decoration: none !important;
|
20 |
-
}
|
21 |
-
.postbox.closed .handlediv .toggle-indicator::before {
|
22 |
-
content: "\f140";
|
23 |
-
}
|
24 |
-
.postbox .hndle {
|
25 |
-
cursor: pointer;
|
26 |
-
}
|
27 |
-
.required {
|
28 |
-
color: rgb(255, 0, 0);
|
29 |
-
}
|
30 |
-
}
|
31 |
-
.cptui-table {
|
32 |
-
td.outer {
|
33 |
-
vertical-align: top;
|
34 |
-
width: 50%;
|
35 |
-
}
|
36 |
-
input[type="text"] {
|
37 |
-
width: 75%;
|
38 |
-
}
|
39 |
-
.question:hover {
|
40 |
-
cursor: pointer;
|
41 |
-
}
|
42 |
-
th p {
|
43 |
-
font-weight: 400;
|
44 |
-
font-size: 12px;
|
45 |
-
}
|
46 |
-
.cptui-slug-details {
|
47 |
-
margin-top: 15px;
|
48 |
-
}
|
49 |
-
|
50 |
-
#slugchanged, #slugexists {
|
51 |
-
color: red;
|
52 |
-
font-weight: bold;
|
53 |
-
&.hidemessage {
|
54 |
-
display: none;
|
55 |
-
}
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
.cptui-support #support {
|
60 |
-
.question {
|
61 |
-
font-size: 18px;
|
62 |
-
font-weight: bold;
|
63 |
-
&:before {
|
64 |
-
content: "\f139";
|
65 |
-
display: inline-block;
|
66 |
-
font: normal 25px/1 'dashicons';
|
67 |
-
margin-left: -25px;
|
68 |
-
position: absolute;
|
69 |
-
-webkit-font-smoothing: antialiased;
|
70 |
-
}
|
71 |
-
&.active:before {
|
72 |
-
content: "\f140";
|
73 |
-
}
|
74 |
-
}
|
75 |
-
.answer {
|
76 |
-
margin: 10px 0 0 20px;
|
77 |
-
}
|
78 |
-
ol li {
|
79 |
-
list-style: none;
|
80 |
-
}
|
81 |
-
li {
|
82 |
-
position: relative;
|
83 |
-
}
|
84 |
-
}
|
85 |
-
.cptui-field-description {
|
86 |
-
font-style: italic;
|
87 |
-
}
|
88 |
-
#cptui_select_post_type,
|
89 |
-
#cptui_select_taxonomy {
|
90 |
-
margin-top: 15px;
|
91 |
-
}
|
92 |
-
.cptui_post_import,
|
93 |
-
.cptui_tax_import {
|
94 |
-
height: 200px;
|
95 |
-
margin-bottom: 10px;
|
96 |
-
resize: vertical;
|
97 |
-
width: 100%;
|
98 |
-
}
|
99 |
-
.cptui_post_type_get_code,
|
100 |
-
.cptui_tax_get_code {
|
101 |
-
height: 300px;
|
102 |
-
resize: vertical;
|
103 |
-
}
|
104 |
-
.about-wrap {
|
105 |
-
.cptui-feature {
|
106 |
-
overflow: visible !important;
|
107 |
-
*zoom:1;
|
108 |
-
&:before,
|
109 |
-
&:after {
|
110 |
-
content: " ";
|
111 |
-
display: table;
|
112 |
-
}
|
113 |
-
&:after {
|
114 |
-
clear: both;
|
115 |
-
}
|
116 |
-
}
|
117 |
-
h3 + .cptui-feature {
|
118 |
-
margin-top: 0;
|
119 |
-
}
|
120 |
-
.changelog {
|
121 |
-
h2 {
|
122 |
-
text-align: center;
|
123 |
-
}
|
124 |
-
}
|
125 |
-
.feature-rest {
|
126 |
-
div {
|
127 |
-
width: 50% !important;
|
128 |
-
padding-right: 100px;
|
129 |
-
-moz-box-sizing: border-box;
|
130 |
-
box-sizing: border-box;
|
131 |
-
margin: 0 !important;
|
132 |
-
&.last-feature {
|
133 |
-
padding-left: 100px;
|
134 |
-
padding-right: 0;
|
135 |
-
}
|
136 |
-
&.icon {
|
137 |
-
width: 0 !important;
|
138 |
-
padding: 0;
|
139 |
-
margin: 0;
|
140 |
-
&:before {
|
141 |
-
font-weight: normal;
|
142 |
-
width: 100%;
|
143 |
-
font-size: 170px;
|
144 |
-
line-height: 125px;
|
145 |
-
color: #9c5d90;
|
146 |
-
display: inline-block;
|
147 |
-
position: relative;
|
148 |
-
text-align: center;
|
149 |
-
speak: none;
|
150 |
-
margin: 0 0 0 -100px;
|
151 |
-
content: "\e01d";
|
152 |
-
-webkit-font-smoothing: antialiased;
|
153 |
-
-moz-osx-font-smoothing: grayscale;
|
154 |
-
}
|
155 |
-
}
|
156 |
-
}
|
157 |
-
}
|
158 |
-
}
|
159 |
-
.about-wrap {
|
160 |
-
.about-integrations {
|
161 |
-
background: #fff;
|
162 |
-
margin: 20px 0;
|
163 |
-
padding: 1px 20px 10px;
|
164 |
-
}
|
165 |
-
.changelog {
|
166 |
-
h4 {
|
167 |
-
line-height: 1.4;
|
168 |
-
}
|
169 |
-
}
|
170 |
-
.cptui-about-text {
|
171 |
-
margin-bottom: 1em !important;
|
172 |
-
margin-right: 0;
|
173 |
-
max-width: calc(100% - 173px);
|
174 |
-
}
|
175 |
-
}
|
176 |
-
.email-octopus-form-row {
|
177 |
-
input::placeholder {
|
178 |
-
color: #cccccc;
|
179 |
-
}
|
180 |
-
}
|
181 |
-
.email-octopus-form-row-hp {
|
182 |
-
visibility: hidden;
|
183 |
-
}
|
184 |
-
.cptui-intro-devblock{
|
185 |
-
display: flex;
|
186 |
-
flex-direction: row;
|
187 |
-
}
|
188 |
-
|
189 |
-
.cptui-help {
|
190 |
-
color: #424242;
|
191 |
-
margin-left: 4px;
|
192 |
-
opacity: 0.5;
|
193 |
-
text-decoration: none;
|
194 |
-
width: 16px;
|
195 |
-
fieldset & {
|
196 |
-
position: relative;
|
197 |
-
top: 4px;
|
198 |
-
}
|
199 |
-
&:hover {
|
200 |
-
color: #0074a2;
|
201 |
-
opacity: 1;
|
202 |
-
}
|
203 |
-
&:focus {
|
204 |
-
box-shadow: none;
|
205 |
-
}
|
206 |
-
}
|
207 |
-
#menu_icon_preview {
|
208 |
-
float: right;
|
209 |
-
padding-left: 8px;
|
210 |
-
|
211 |
-
img {
|
212 |
-
display: block;
|
213 |
-
height: 20px;
|
214 |
-
width: 20px;
|
215 |
-
}
|
216 |
-
}
|
217 |
-
|
218 |
-
.visuallyhidden {
|
219 |
-
position: absolute;
|
220 |
-
left: -10000px;
|
221 |
-
top: auto;
|
222 |
-
width: 1px;
|
223 |
-
height: 1px;
|
224 |
-
overflow: hidden;
|
225 |
-
}
|
226 |
-
.cptui-spacer {
|
227 |
-
display: block;
|
228 |
-
margin-top: 25px;
|
229 |
-
}
|
230 |
-
|
231 |
-
.email-octopus-form-wrapper {
|
232 |
-
background: #fff;
|
233 |
-
margin-bottom: 10px;
|
234 |
-
padding: 20px;
|
235 |
-
label {
|
236 |
-
margin-bottom: 10px;
|
237 |
-
}
|
238 |
-
}
|
239 |
-
|
240 |
-
.wdsoctosignup {
|
241 |
-
h2 {
|
242 |
-
text-align:left;
|
243 |
-
}
|
244 |
-
}
|
245 |
-
|
246 |
-
.wdspromos {
|
247 |
-
float: right;
|
248 |
-
margin-left: 20px;
|
249 |
-
margin-top: 10px;
|
250 |
-
width: 275px;
|
251 |
-
}
|
252 |
-
.wdspromos-about {
|
253 |
-
display: -ms-flexbox;
|
254 |
-
display: -webkit-flex;
|
255 |
-
display: flex;
|
256 |
-
-webkit-flex-direction: row;
|
257 |
-
-ms-flex-direction: row;
|
258 |
-
flex-direction: row;
|
259 |
-
-webkit-flex-wrap: nowrap;
|
260 |
-
-ms-flex-wrap: nowrap;
|
261 |
-
flex-wrap: nowrap;
|
262 |
-
-webkit-justify-content: space-between;
|
263 |
-
-ms-flex-pack: justify;
|
264 |
-
justify-content: space-between;
|
265 |
-
-webkit-align-content: stretch;
|
266 |
-
align-content: stretch;
|
267 |
-
-webkit-align-items: flex-start;
|
268 |
-
-ms-flex-align: start;
|
269 |
-
align-items: flex-start;
|
270 |
-
margin: 20px 0;
|
271 |
-
|
272 |
-
a:nth-child(1) {
|
273 |
-
-ms-flex-order: 0;
|
274 |
-
order: 0;
|
275 |
-
-webkit-flex: 0 1 auto;
|
276 |
-
-ms-flex: 0 1 auto;
|
277 |
-
flex: 0 1 auto;
|
278 |
-
-webkit-align-self: auto;
|
279 |
-
align-self: auto;
|
280 |
-
}
|
281 |
-
|
282 |
-
a:nth-child(2) {
|
283 |
-
-ms-flex-order: 0;
|
284 |
-
order: 0;
|
285 |
-
-webkit-flex: 0 1 auto;
|
286 |
-
-ms-flex: 0 1 auto;
|
287 |
-
flex: 0 1 auto;
|
288 |
-
-webkit-align-self: auto;
|
289 |
-
align-self: auto;
|
290 |
-
}
|
291 |
-
|
292 |
-
a:nth-child(3) {
|
293 |
-
-ms-flex-order: 0;
|
294 |
-
order: 0;
|
295 |
-
-webkit-flex: 0 1 auto;
|
296 |
-
-ms-flex: 0 1 auto;
|
297 |
-
flex: 0 1 auto;
|
298 |
-
-webkit-align-self: auto;
|
299 |
-
align-self: auto;
|
300 |
-
}
|
301 |
-
p {
|
302 |
-
padding: 0 5px;
|
303 |
-
&:nth-child(1) {
|
304 |
-
padding-left: 0;
|
305 |
-
}
|
306 |
-
&:nth-child(4) {
|
307 |
-
padding-right: 0;
|
308 |
-
}
|
309 |
-
}
|
310 |
-
}
|
311 |
-
.no-js {
|
312 |
-
#cptui_choose_icon {
|
313 |
-
display: none
|
314 |
-
}
|
315 |
-
}
|
316 |
-
.cptui-listings {
|
317 |
-
th {
|
318 |
-
font-weight: bold;
|
319 |
-
}
|
320 |
-
.post-type-listing {
|
321 |
-
th {
|
322 |
-
width: 16.66667%;
|
323 |
-
}
|
324 |
-
}
|
325 |
-
.taxonomy-listing {
|
326 |
-
th {
|
327 |
-
width: 20%;
|
328 |
-
}
|
329 |
-
}
|
330 |
-
}
|
331 |
-
#poststuff {
|
332 |
-
min-width: 463px;
|
333 |
-
}
|
334 |
-
|
335 |
-
.dashicon-picker-container {
|
336 |
-
position: absolute;
|
337 |
-
width: 220px;
|
338 |
-
height: 252px;
|
339 |
-
font-size: 14px;
|
340 |
-
background-color: #fff;
|
341 |
-
box-shadow: -1px 2px 5px 3px rgba(0, 0, 0, 0.41);
|
342 |
-
overflow: hidden;
|
343 |
-
padding: 5px;
|
344 |
-
box-sizing: border-box;
|
345 |
-
|
346 |
-
ul {
|
347 |
-
margin: 0 0 10px;
|
348 |
-
padding: 0;
|
349 |
-
|
350 |
-
.dashicons {
|
351 |
-
width: 20px;
|
352 |
-
height: 20px;
|
353 |
-
font-size: 20px;
|
354 |
-
}
|
355 |
-
|
356 |
-
li {
|
357 |
-
display: inline-block;
|
358 |
-
margin: 5px;
|
359 |
-
float: left;
|
360 |
-
|
361 |
-
a {
|
362 |
-
display: block;
|
363 |
-
text-decoration: none;
|
364 |
-
color: #373737;
|
365 |
-
padding: 5px 5px;
|
366 |
-
border: 1px solid #dfdfdf;
|
367 |
-
|
368 |
-
&:hover {
|
369 |
-
border-color: #999;
|
370 |
-
background: #efefef;
|
371 |
-
}
|
372 |
-
}
|
373 |
-
}
|
374 |
-
}
|
375 |
-
}
|
376 |
-
|
377 |
-
.dashicon-picker-control {
|
378 |
-
height: 32px;
|
379 |
-
|
380 |
-
a {
|
381 |
-
padding: 5px;
|
382 |
-
text-decoration: none;
|
383 |
-
line-height: 32px;
|
384 |
-
width: 25px;
|
385 |
-
|
386 |
-
span {
|
387 |
-
display: inline;
|
388 |
-
vertical-align: middle;
|
389 |
-
}
|
390 |
-
}
|
391 |
-
|
392 |
-
input {
|
393 |
-
font-size: 12px;
|
394 |
-
width: 140px;
|
395 |
-
}
|
396 |
-
}
|
397 |
-
|
398 |
-
@media #{$min-tablet} {
|
399 |
-
.cptui-badge {
|
400 |
-
margin-top: -42px;
|
401 |
-
height: 173px;
|
402 |
-
width: 173px;
|
403 |
-
color: #fafafa;
|
404 |
-
font-weight: bold;
|
405 |
-
font-size: 14px;
|
406 |
-
text-align: center;
|
407 |
-
margin-bottom: 10px;
|
408 |
-
background: url(../images/cptui-icon-173x173.png) no-repeat;
|
409 |
-
}
|
410 |
-
}
|
411 |
-
|
412 |
-
@media #{$max-tablet} {
|
413 |
-
.cptui-table {
|
414 |
-
#description {
|
415 |
-
width: 100%;
|
416 |
-
}
|
417 |
-
}
|
418 |
-
.wdspromos-about {
|
419 |
-
flex-wrap: wrap;
|
420 |
-
p {
|
421 |
-
margin: 5px auto;
|
422 |
-
&:nth-child(1) {
|
423 |
-
padding-left: 5px;
|
424 |
-
}
|
425 |
-
&:nth-child(4) {
|
426 |
-
padding-right: 5px;
|
427 |
-
}
|
428 |
-
}
|
429 |
-
}
|
430 |
-
.cptui-table {
|
431 |
-
td.outer {
|
432 |
-
width: 100%;
|
433 |
-
}
|
434 |
-
}
|
435 |
-
|
436 |
-
#cptui_debug_info_email {
|
437 |
-
width: 100%;
|
438 |
-
}
|
439 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
custom-post-type-ui.php
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
* Plugin URI: https://github.com/WebDevStudios/custom-post-type-ui/
|
17 |
* Description: Admin panel for creating custom post types and custom taxonomies in WordPress
|
18 |
* Author: WebDevStudios
|
19 |
-
* Version: 1.
|
20 |
* Author URI: https://webdevstudios.com/
|
21 |
* Text Domain: custom-post-type-ui
|
22 |
* Domain Path: /languages
|
@@ -24,14 +24,17 @@
|
|
24 |
*/
|
25 |
|
26 |
// phpcs:disable WebDevStudios.All.RequireAuthor
|
|
|
|
|
|
|
27 |
|
28 |
// Exit if accessed directly.
|
29 |
if ( ! defined( 'ABSPATH' ) ) {
|
30 |
exit;
|
31 |
}
|
32 |
|
33 |
-
define( 'CPT_VERSION', '1.
|
34 |
-
define( 'CPTUI_VERSION', '1.
|
35 |
define( 'CPTUI_WP_VERSION', get_bloginfo( 'version' ) );
|
36 |
|
37 |
/**
|
@@ -201,6 +204,10 @@ function cptui_create_submenus() {
|
|
201 |
require_once plugin_dir_path( __FILE__ ) . 'inc/taxonomies.php';
|
202 |
require_once plugin_dir_path( __FILE__ ) . 'inc/listings.php';
|
203 |
require_once plugin_dir_path( __FILE__ ) . 'inc/tools.php';
|
|
|
|
|
|
|
|
|
204 |
require_once plugin_dir_path( __FILE__ ) . 'inc/support.php';
|
205 |
|
206 |
if ( defined( 'WP_CLI' ) && WP_CLI ) {
|
@@ -238,11 +245,10 @@ function cptui_add_styles() {
|
|
238 |
if ( wp_doing_ajax() ) {
|
239 |
return;
|
240 |
}
|
241 |
-
|
242 |
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
243 |
-
wp_register_script( 'cptui', plugins_url( "
|
244 |
-
wp_register_script( 'dashicons-picker', plugins_url( "
|
245 |
-
wp_register_style( 'cptui-css', plugins_url( "
|
246 |
}
|
247 |
add_action( 'admin_enqueue_scripts', 'cptui_add_styles' );
|
248 |
|
@@ -405,7 +411,7 @@ function cptui_register_single_post_type( $post_type = [] ) {
|
|
405 |
$labels[ $key ] = $label;
|
406 |
}
|
407 |
} elseif ( empty( $label ) && in_array( $key, $preserved, true ) ) {
|
408 |
-
$singular_or_plural = ( in_array( $key, array_keys( $preserved_labels['post_types']['plural'] ) ) ) ? 'plural' : 'singular';
|
409 |
$label_plurality = ( 'plural' === $singular_or_plural ) ? $post_type['label'] : $post_type['singular_label'];
|
410 |
$labels[ $key ] = sprintf( $preserved_labels['post_types'][ $singular_or_plural ][ $key ], $label_plurality );
|
411 |
}
|
@@ -433,7 +439,7 @@ function cptui_register_single_post_type( $post_type = [] ) {
|
|
433 |
}
|
434 |
}
|
435 |
|
436 |
-
$menu_icon
|
437 |
$register_meta_box_cb = ! empty( $post_type['register_meta_box_cb'] ) ? $post_type['register_meta_box_cb'] : null;
|
438 |
|
439 |
if ( in_array( $post_type['query_var'], [ 'true', 'false', '0', '1' ], true ) ) {
|
@@ -658,7 +664,7 @@ function cptui_register_single_taxonomy( $taxonomy = [] ) {
|
|
658 |
if ( ! empty( $label ) ) {
|
659 |
$labels[ $key ] = $label;
|
660 |
} elseif ( empty( $label ) && in_array( $key, $preserved, true ) ) {
|
661 |
-
$singular_or_plural = ( in_array( $key, array_keys( $preserved_labels['taxonomies']['plural'] ) ) ) ? 'plural' : 'singular';
|
662 |
$label_plurality = ( 'plural' === $singular_or_plural ) ? $taxonomy['label'] : $taxonomy['singular_label'];
|
663 |
$labels[ $key ] = sprintf( $preserved_labels['taxonomies'][ $singular_or_plural ][ $key ], $label_plurality );
|
664 |
}
|
@@ -736,7 +742,7 @@ function cptui_register_single_taxonomy( $taxonomy = [] ) {
|
|
736 |
}
|
737 |
$default_term = null;
|
738 |
if ( ! empty( $taxonomy['default_term'] ) ) {
|
739 |
-
$term_parts = explode(',', $taxonomy['default_term'] );
|
740 |
if ( ! empty( $term_parts[0] ) ) {
|
741 |
$default_term['name'] = trim( $term_parts[0] );
|
742 |
}
|
@@ -829,9 +835,9 @@ function cptui_settings_tab_menu( $page = 'post_types' ) {
|
|
829 |
}
|
830 |
|
831 |
printf(
|
832 |
-
$tmpl,
|
833 |
-
$tabs['page_title'],
|
834 |
-
$tab_output
|
835 |
);
|
836 |
}
|
837 |
|
@@ -854,7 +860,7 @@ function cptui_convert_settings() {
|
|
854 |
|
855 |
$retval = '';
|
856 |
|
857 |
-
if ( false === get_option( 'cptui_post_types' ) && ( $post_types = get_option( 'cpt_custom_post_types' ) ) ) {
|
858 |
|
859 |
$new_post_types = [];
|
860 |
foreach ( $post_types as $type ) {
|
@@ -872,7 +878,7 @@ function cptui_convert_settings() {
|
|
872 |
$retval = update_option( 'cptui_post_types', $new_post_types );
|
873 |
}
|
874 |
|
875 |
-
if ( false === get_option( 'cptui_taxonomies' ) && ( $taxonomies = get_option( 'cpt_custom_tax_types' ) ) ) {
|
876 |
|
877 |
$new_taxonomies = [];
|
878 |
foreach ( $taxonomies as $tax ) {
|
@@ -915,7 +921,7 @@ function cptui_admin_notices( $action = '', $object_type = '', $success = true,
|
|
915 |
$object_type = esc_attr( $object_type );
|
916 |
|
917 |
$messagewrapstart = '<div id="message" class="' . implode( ' ', $class ) . '"><p>';
|
918 |
-
$message
|
919 |
|
920 |
$messagewrapend = '</p></div>';
|
921 |
|
@@ -1072,7 +1078,7 @@ function cptui_get_preserved_labels() {
|
|
1072 |
'new_item' => __( 'New %s', 'custom-post-type-ui' ),
|
1073 |
'view_item' => __( 'View %s', 'custom-post-type-ui' ),
|
1074 |
],
|
1075 |
-
'plural'
|
1076 |
'view_items' => __( 'View %s', 'custom-post-type-ui' ),
|
1077 |
'all_items' => __( 'All %s', 'custom-post-type-ui' ),
|
1078 |
'search_items' => __( 'Search %s', 'custom-post-type-ui' ),
|
@@ -1089,7 +1095,7 @@ function cptui_get_preserved_labels() {
|
|
1089 |
'add_new_item' => __( 'Add new %s', 'custom-post-type-ui' ),
|
1090 |
'new_item_name' => __( 'New %s name', 'custom-post-type-ui' ),
|
1091 |
],
|
1092 |
-
'plural'
|
1093 |
'search_items' => __( 'Search %s', 'custom-post-type-ui' ),
|
1094 |
'popular_items' => __( 'Popular %s', 'custom-post-type-ui' ),
|
1095 |
'all_items' => __( 'All %s', 'custom-post-type-ui' ),
|
16 |
* Plugin URI: https://github.com/WebDevStudios/custom-post-type-ui/
|
17 |
* Description: Admin panel for creating custom post types and custom taxonomies in WordPress
|
18 |
* Author: WebDevStudios
|
19 |
+
* Version: 1.13.0
|
20 |
* Author URI: https://webdevstudios.com/
|
21 |
* Text Domain: custom-post-type-ui
|
22 |
* Domain Path: /languages
|
24 |
*/
|
25 |
|
26 |
// phpcs:disable WebDevStudios.All.RequireAuthor
|
27 |
+
// phpcs:set WordPress.WP.I18n check_translator_comments false
|
28 |
+
|
29 |
+
|
30 |
|
31 |
// Exit if accessed directly.
|
32 |
if ( ! defined( 'ABSPATH' ) ) {
|
33 |
exit;
|
34 |
}
|
35 |
|
36 |
+
define( 'CPT_VERSION', '1.13.0' ); // Left for legacy purposes.
|
37 |
+
define( 'CPTUI_VERSION', '1.13.0' );
|
38 |
define( 'CPTUI_WP_VERSION', get_bloginfo( 'version' ) );
|
39 |
|
40 |
/**
|
204 |
require_once plugin_dir_path( __FILE__ ) . 'inc/taxonomies.php';
|
205 |
require_once plugin_dir_path( __FILE__ ) . 'inc/listings.php';
|
206 |
require_once plugin_dir_path( __FILE__ ) . 'inc/tools.php';
|
207 |
+
require_once plugin_dir_path( __FILE__ ) . 'inc/tools-sections/tools-post-types.php';
|
208 |
+
require_once plugin_dir_path( __FILE__ ) . 'inc/tools-sections/tools-taxonomies.php';
|
209 |
+
require_once plugin_dir_path( __FILE__ ) . 'inc/tools-sections/tools-get-code.php';
|
210 |
+
require_once plugin_dir_path( __FILE__ ) . 'inc/tools-sections/tools-debug.php';
|
211 |
require_once plugin_dir_path( __FILE__ ) . 'inc/support.php';
|
212 |
|
213 |
if ( defined( 'WP_CLI' ) && WP_CLI ) {
|
245 |
if ( wp_doing_ajax() ) {
|
246 |
return;
|
247 |
}
|
|
|
248 |
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
249 |
+
wp_register_script( 'cptui', plugins_url( "build/cptui-scripts{$min}.js", __FILE__ ), [ 'jquery', 'jquery-ui-dialog', 'postbox' ], CPTUI_VERSION, true );
|
250 |
+
wp_register_script( 'dashicons-picker', plugins_url( "build/dashicons-picker{$min}.js", __FILE__ ), [ 'jquery'], '1.0.0', true );
|
251 |
+
wp_register_style( 'cptui-css', plugins_url( "build/cptui-styles{$min}.css", __FILE__ ), [ 'wp-jquery-ui-dialog' ], CPTUI_VERSION );
|
252 |
}
|
253 |
add_action( 'admin_enqueue_scripts', 'cptui_add_styles' );
|
254 |
|
411 |
$labels[ $key ] = $label;
|
412 |
}
|
413 |
} elseif ( empty( $label ) && in_array( $key, $preserved, true ) ) {
|
414 |
+
$singular_or_plural = ( in_array( $key, array_keys( $preserved_labels['post_types']['plural'] ) ) ) ? 'plural' : 'singular'; // phpcs:ignore.
|
415 |
$label_plurality = ( 'plural' === $singular_or_plural ) ? $post_type['label'] : $post_type['singular_label'];
|
416 |
$labels[ $key ] = sprintf( $preserved_labels['post_types'][ $singular_or_plural ][ $key ], $label_plurality );
|
417 |
}
|
439 |
}
|
440 |
}
|
441 |
|
442 |
+
$menu_icon = ! empty( $post_type['menu_icon'] ) ? $post_type['menu_icon'] : null;
|
443 |
$register_meta_box_cb = ! empty( $post_type['register_meta_box_cb'] ) ? $post_type['register_meta_box_cb'] : null;
|
444 |
|
445 |
if ( in_array( $post_type['query_var'], [ 'true', 'false', '0', '1' ], true ) ) {
|
664 |
if ( ! empty( $label ) ) {
|
665 |
$labels[ $key ] = $label;
|
666 |
} elseif ( empty( $label ) && in_array( $key, $preserved, true ) ) {
|
667 |
+
$singular_or_plural = ( in_array( $key, array_keys( $preserved_labels['taxonomies']['plural'] ) ) ) ? 'plural' : 'singular'; // phpcs:ignore.
|
668 |
$label_plurality = ( 'plural' === $singular_or_plural ) ? $taxonomy['label'] : $taxonomy['singular_label'];
|
669 |
$labels[ $key ] = sprintf( $preserved_labels['taxonomies'][ $singular_or_plural ][ $key ], $label_plurality );
|
670 |
}
|
742 |
}
|
743 |
$default_term = null;
|
744 |
if ( ! empty( $taxonomy['default_term'] ) ) {
|
745 |
+
$term_parts = explode( ',', $taxonomy['default_term'] );
|
746 |
if ( ! empty( $term_parts[0] ) ) {
|
747 |
$default_term['name'] = trim( $term_parts[0] );
|
748 |
}
|
835 |
}
|
836 |
|
837 |
printf(
|
838 |
+
$tmpl, // phpcs:ignore.
|
839 |
+
$tabs['page_title'], // phpcs:ignore.
|
840 |
+
$tab_output // phpcs:ignore.
|
841 |
);
|
842 |
}
|
843 |
|
860 |
|
861 |
$retval = '';
|
862 |
|
863 |
+
if ( false === get_option( 'cptui_post_types' ) && ( $post_types = get_option( 'cpt_custom_post_types' ) ) ) { // phpcs:ignore.
|
864 |
|
865 |
$new_post_types = [];
|
866 |
foreach ( $post_types as $type ) {
|
878 |
$retval = update_option( 'cptui_post_types', $new_post_types );
|
879 |
}
|
880 |
|
881 |
+
if ( false === get_option( 'cptui_taxonomies' ) && ( $taxonomies = get_option( 'cpt_custom_tax_types' ) ) ) { // phpcs:ignore.
|
882 |
|
883 |
$new_taxonomies = [];
|
884 |
foreach ( $taxonomies as $tax ) {
|
921 |
$object_type = esc_attr( $object_type );
|
922 |
|
923 |
$messagewrapstart = '<div id="message" class="' . implode( ' ', $class ) . '"><p>';
|
924 |
+
$message = '';
|
925 |
|
926 |
$messagewrapend = '</p></div>';
|
927 |
|
1078 |
'new_item' => __( 'New %s', 'custom-post-type-ui' ),
|
1079 |
'view_item' => __( 'View %s', 'custom-post-type-ui' ),
|
1080 |
],
|
1081 |
+
'plural' => [
|
1082 |
'view_items' => __( 'View %s', 'custom-post-type-ui' ),
|
1083 |
'all_items' => __( 'All %s', 'custom-post-type-ui' ),
|
1084 |
'search_items' => __( 'Search %s', 'custom-post-type-ui' ),
|
1095 |
'add_new_item' => __( 'Add new %s', 'custom-post-type-ui' ),
|
1096 |
'new_item_name' => __( 'New %s name', 'custom-post-type-ui' ),
|
1097 |
],
|
1098 |
+
'plural' => [
|
1099 |
'search_items' => __( 'Search %s', 'custom-post-type-ui' ),
|
1100 |
'popular_items' => __( 'Popular %s', 'custom-post-type-ui' ),
|
1101 |
'all_items' => __( 'All %s', 'custom-post-type-ui' ),
|
external/wpgraphql.php
CHANGED
@@ -31,13 +31,13 @@ class CPTUI_GraphQL {
|
|
31 |
*/
|
32 |
public function init() {
|
33 |
|
34 |
-
// Post Types
|
35 |
add_action( 'cptui_post_type_after_fieldsets', [ $this, 'add_graphql_post_type_settings' ], 10, 1 );
|
36 |
add_filter( 'cptui_before_update_post_type', [ $this, 'before_update_post_type' ], 10, 2 );
|
37 |
add_filter( 'cptui_pre_register_post_type', [ $this, 'add_graphql_settings_to_registry' ], 10, 3 );
|
38 |
add_filter( 'cptui_pre_save_post_type', [ $this, 'save_graphql_settings' ], 10, 2 );
|
39 |
|
40 |
-
// Taxonomies
|
41 |
add_action( 'cptui_taxonomy_after_fieldsets', [ $this, 'add_taxonomy_graphql_settings' ], 10, 1 );
|
42 |
add_filter( 'cptui_before_update_taxonomy', [ $this, 'before_update_taxonomy' ], 10, 2 );
|
43 |
add_filter( 'cptui_pre_register_taxonomy', [ $this, 'add_graphql_settings_to_registry' ], 10, 3 );
|
@@ -47,36 +47,47 @@ class CPTUI_GraphQL {
|
|
47 |
/**
|
48 |
* Adds the GraphQL Settings from CPT UI to the post_type and taxonomy registry args.
|
49 |
*
|
50 |
-
* @param array $args The args for the registry
|
51 |
-
* @param string $name The name of the type
|
52 |
-
* @param array $type The array that composes the Type
|
53 |
*
|
54 |
* @return array
|
55 |
*/
|
56 |
public function add_graphql_settings_to_registry( $args, $name, $type ) {
|
57 |
|
58 |
-
// If the type is not set to show_in_graphql, return the args as-is
|
59 |
if ( ! isset( $type['show_in_graphql'] ) || true !== (bool) $type['show_in_graphql'] ) {
|
60 |
return $args;
|
61 |
}
|
62 |
|
63 |
// If the type has no graphql_plural_name, return the args as-is, but
|
64 |
-
// add a message to the debug log for why the Type is not in the Schema
|
65 |
if ( ! isset( $type['graphql_plural_name'] ) || empty( $type['graphql_plural_name'] ) ) {
|
66 |
-
graphql_debug(
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
return $args;
|
69 |
}
|
70 |
|
71 |
// If the type has no graphql_single_name, return the args as-is, but
|
72 |
-
// add a message to the debug log for why the Type is not in the Schema
|
73 |
if ( ! isset( $type['graphql_single_name'] ) || empty( $type['graphql_single_name'] ) ) {
|
74 |
-
graphql_debug(
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
return $args;
|
77 |
}
|
78 |
|
79 |
-
|
80 |
$args['show_in_graphql'] = isset( $type['show_in_graphql'] ) ? (bool) $type['show_in_graphql'] : false;
|
81 |
$args['graphql_single_name'] = ! empty( $type['graphql_single_name'] ) ? $type['graphql_single_name'] : null;
|
82 |
$args['graphql_plural_name'] = ! empty( $type['graphql_plural_name'] ) ? $type['graphql_plural_name'] : null;
|
@@ -125,10 +136,10 @@ class CPTUI_GraphQL {
|
|
125 |
/**
|
126 |
* Add settings fields to Custom Post Type UI form
|
127 |
*
|
128 |
-
* @param cptui_admin_ui $ui Admin UI instance
|
129 |
*/
|
130 |
public function add_graphql_post_type_settings( $ui ) {
|
131 |
-
$tab = ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) ? 'edit' : 'new';
|
132 |
$current = [];
|
133 |
$name_array = 'cpt_custom_post_type';
|
134 |
if ( 'edit' === $tab ) {
|
@@ -140,16 +151,16 @@ class CPTUI_GraphQL {
|
|
140 |
}
|
141 |
}
|
142 |
}
|
143 |
-
echo $this->get_setting_fields( $ui, $current, $name_array );
|
144 |
}
|
145 |
|
146 |
/**
|
147 |
* Add settings fields to Custom Post Type UI form
|
148 |
*
|
149 |
-
* @param cptui_admin_ui $ui Admin UI instance
|
150 |
*/
|
151 |
public function add_taxonomy_graphql_settings( $ui ) {
|
152 |
-
$tab = ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) ? 'edit' : 'new';
|
153 |
$name_array = 'cpt_custom_tax';
|
154 |
$current = [];
|
155 |
if ( 'edit' === $tab ) {
|
@@ -161,13 +172,13 @@ class CPTUI_GraphQL {
|
|
161 |
}
|
162 |
}
|
163 |
}
|
164 |
-
echo $this->get_setting_fields( $ui, $current, $name_array );
|
165 |
}
|
166 |
|
167 |
/**
|
168 |
* Get the settings fields to render for the form
|
169 |
*
|
170 |
-
* @param cptui_admin_ui $ui Admin UI instance
|
171 |
* @param array $current
|
172 |
* @param string $name_array
|
173 |
*/
|
@@ -195,7 +206,7 @@ class CPTUI_GraphQL {
|
|
195 |
'options' => [
|
196 |
[
|
197 |
'attr' => '0',
|
198 |
-
'text' => esc_attr__( 'False', 'wp-graphql-custom-post-type-ui' )
|
199 |
],
|
200 |
[
|
201 |
'attr' => '1',
|
@@ -207,35 +218,39 @@ class CPTUI_GraphQL {
|
|
207 |
$selected = ( isset( $current ) && ! empty( $current['show_in_graphql'] ) ) ? disp_boolean( $current['show_in_graphql'] ) : '';
|
208 |
$selections['selected'] = ( ! empty( $selected ) && ! empty( $current['show_in_graphql'] ) ) ? $current['show_in_graphql'] : '0';
|
209 |
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
echo $ui->get_text_input(
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
|
|
|
|
|
|
|
|
239 |
?>
|
240 |
</table>
|
241 |
</div>
|
@@ -312,14 +327,25 @@ add_action( 'cptui_loaded', __NAMESPACE__ . '\cptui_graphql_init' );
|
|
312 |
|
313 |
function cptui_graphql_init() {
|
314 |
if ( class_exists( 'WPGraphQL_CPT_UI' ) ) {
|
315 |
-
add_action(
|
316 |
-
|
317 |
-
|
|
|
|
|
318 |
<div class="notice notice-error">
|
319 |
-
<p
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
</div>
|
321 |
-
|
322 |
-
|
|
|
323 |
|
324 |
return;
|
325 |
}
|
31 |
*/
|
32 |
public function init() {
|
33 |
|
34 |
+
// Post Types.
|
35 |
add_action( 'cptui_post_type_after_fieldsets', [ $this, 'add_graphql_post_type_settings' ], 10, 1 );
|
36 |
add_filter( 'cptui_before_update_post_type', [ $this, 'before_update_post_type' ], 10, 2 );
|
37 |
add_filter( 'cptui_pre_register_post_type', [ $this, 'add_graphql_settings_to_registry' ], 10, 3 );
|
38 |
add_filter( 'cptui_pre_save_post_type', [ $this, 'save_graphql_settings' ], 10, 2 );
|
39 |
|
40 |
+
// Taxonomies.
|
41 |
add_action( 'cptui_taxonomy_after_fieldsets', [ $this, 'add_taxonomy_graphql_settings' ], 10, 1 );
|
42 |
add_filter( 'cptui_before_update_taxonomy', [ $this, 'before_update_taxonomy' ], 10, 2 );
|
43 |
add_filter( 'cptui_pre_register_taxonomy', [ $this, 'add_graphql_settings_to_registry' ], 10, 3 );
|
47 |
/**
|
48 |
* Adds the GraphQL Settings from CPT UI to the post_type and taxonomy registry args.
|
49 |
*
|
50 |
+
* @param array $args The args for the registry.
|
51 |
+
* @param string $name The name of the type.
|
52 |
+
* @param array $type The array that composes the Type.
|
53 |
*
|
54 |
* @return array
|
55 |
*/
|
56 |
public function add_graphql_settings_to_registry( $args, $name, $type ) {
|
57 |
|
58 |
+
// If the type is not set to show_in_graphql, return the args as-is.
|
59 |
if ( ! isset( $type['show_in_graphql'] ) || true !== (bool) $type['show_in_graphql'] ) {
|
60 |
return $args;
|
61 |
}
|
62 |
|
63 |
// If the type has no graphql_plural_name, return the args as-is, but
|
64 |
+
// add a message to the debug log for why the Type is not in the Schema.
|
65 |
if ( ! isset( $type['graphql_plural_name'] ) || empty( $type['graphql_plural_name'] ) ) {
|
66 |
+
graphql_debug(
|
67 |
+
sprintf(
|
68 |
+
// phpcs:ignore.
|
69 |
+
esc_attr__( 'The graphql_plural_name is empty for the "%s" Post Type or Taxonomy registered by Custom Post Type UI.' ),
|
70 |
+
$type['name']
|
71 |
+
)
|
72 |
+
);
|
73 |
|
74 |
return $args;
|
75 |
}
|
76 |
|
77 |
// If the type has no graphql_single_name, return the args as-is, but
|
78 |
+
// add a message to the debug log for why the Type is not in the Schema.
|
79 |
if ( ! isset( $type['graphql_single_name'] ) || empty( $type['graphql_single_name'] ) ) {
|
80 |
+
graphql_debug(
|
81 |
+
sprintf(
|
82 |
+
// phpcs:ignore.
|
83 |
+
esc_attr__( 'The graphql_single_name is empty for the "%s" Post Type or Taxonomy registered by Custom Post Type UI.' ),
|
84 |
+
$type['name']
|
85 |
+
)
|
86 |
+
);
|
87 |
|
88 |
return $args;
|
89 |
}
|
90 |
|
|
|
91 |
$args['show_in_graphql'] = isset( $type['show_in_graphql'] ) ? (bool) $type['show_in_graphql'] : false;
|
92 |
$args['graphql_single_name'] = ! empty( $type['graphql_single_name'] ) ? $type['graphql_single_name'] : null;
|
93 |
$args['graphql_plural_name'] = ! empty( $type['graphql_plural_name'] ) ? $type['graphql_plural_name'] : null;
|
136 |
/**
|
137 |
* Add settings fields to Custom Post Type UI form
|
138 |
*
|
139 |
+
* @param cptui_admin_ui $ui Admin UI instance.
|
140 |
*/
|
141 |
public function add_graphql_post_type_settings( $ui ) {
|
142 |
+
$tab = ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) ? 'edit' : 'new'; // phpcs:ignore WordPress.Security.NonceVerification
|
143 |
$current = [];
|
144 |
$name_array = 'cpt_custom_post_type';
|
145 |
if ( 'edit' === $tab ) {
|
151 |
}
|
152 |
}
|
153 |
}
|
154 |
+
echo $this->get_setting_fields( $ui, $current, $name_array ); // phpcs:ignore.
|
155 |
}
|
156 |
|
157 |
/**
|
158 |
* Add settings fields to Custom Post Type UI form
|
159 |
*
|
160 |
+
* @param cptui_admin_ui $ui Admin UI instance.
|
161 |
*/
|
162 |
public function add_taxonomy_graphql_settings( $ui ) {
|
163 |
+
$tab = ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) ? 'edit' : 'new'; // phpcs:ignore WordPress.Security.NonceVerification
|
164 |
$name_array = 'cpt_custom_tax';
|
165 |
$current = [];
|
166 |
if ( 'edit' === $tab ) {
|
172 |
}
|
173 |
}
|
174 |
}
|
175 |
+
echo $this->get_setting_fields( $ui, $current, $name_array ); // phpcs:ignore.
|
176 |
}
|
177 |
|
178 |
/**
|
179 |
* Get the settings fields to render for the form
|
180 |
*
|
181 |
+
* @param cptui_admin_ui $ui Admin UI instance.
|
182 |
* @param array $current
|
183 |
* @param string $name_array
|
184 |
*/
|
206 |
'options' => [
|
207 |
[
|
208 |
'attr' => '0',
|
209 |
+
'text' => esc_attr__( 'False', 'wp-graphql-custom-post-type-ui' ),
|
210 |
],
|
211 |
[
|
212 |
'attr' => '1',
|
218 |
$selected = ( isset( $current ) && ! empty( $current['show_in_graphql'] ) ) ? disp_boolean( $current['show_in_graphql'] ) : '';
|
219 |
$selections['selected'] = ( ! empty( $selected ) && ! empty( $current['show_in_graphql'] ) ) ? $current['show_in_graphql'] : '0';
|
220 |
|
221 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
222 |
+
[
|
223 |
+
'namearray' => $name_array,
|
224 |
+
'name' => 'show_in_graphql',
|
225 |
+
'labeltext' => esc_html__( 'Show in GraphQL', 'wp-graphql-custom-post-type-ui' ),
|
226 |
+
'aftertext' => esc_html__( 'Whether or not to show data of this type in the WPGraphQL. Default: false', 'wp-graphql-custom-post-type-ui' ),
|
227 |
+
'selections' => $selections, // phpcs:ignore.
|
228 |
+
'default' => false,
|
229 |
+
'required' => true,
|
230 |
+
]
|
231 |
+
);
|
232 |
+
|
233 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
234 |
+
[
|
235 |
+
'namearray' => $name_array,
|
236 |
+
'name' => 'graphql_single_name',
|
237 |
+
'labeltext' => esc_html__( 'GraphQL Single Name', 'wp-graphql-custom-post-type-ui' ),
|
238 |
+
'aftertext' => esc_attr__( 'Singular name for reference in the GraphQL API.', 'wp-graphql-custom-post-type-ui' ),
|
239 |
+
'textvalue' => ( isset( $current['graphql_single_name'] ) ) ? esc_attr( $current['graphql_single_name'] ) : '', // phpcs:ignore.
|
240 |
+
'required' => true,
|
241 |
+
]
|
242 |
+
);
|
243 |
+
|
244 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
245 |
+
[
|
246 |
+
'namearray' => $name_array,
|
247 |
+
'name' => 'graphql_plural_name',
|
248 |
+
'labeltext' => esc_html__( 'GraphQL Plural Name', 'wp-graphql-custom-post-type-ui' ),
|
249 |
+
'aftertext' => esc_attr__( 'Plural name for reference in the GraphQL API.', 'wp-graphql-custom-post-type-ui' ),
|
250 |
+
'textvalue' => ( isset( $current['graphql_plural_name'] ) ) ? esc_attr( $current['graphql_plural_name'] ) : '', // phpcs:ignore.
|
251 |
+
'required' => true,
|
252 |
+
]
|
253 |
+
);
|
254 |
?>
|
255 |
</table>
|
256 |
</div>
|
327 |
|
328 |
function cptui_graphql_init() {
|
329 |
if ( class_exists( 'WPGraphQL_CPT_UI' ) ) {
|
330 |
+
add_action(
|
331 |
+
'admin_notices',
|
332 |
+
function () {
|
333 |
+
$link = trailingslashit( admin_url() ) . 'plugins.php';
|
334 |
+
?>
|
335 |
<div class="notice notice-error">
|
336 |
+
<p>
|
337 |
+
<?php
|
338 |
+
echo sprintf(
|
339 |
+
// phpcs:ignore.
|
340 |
+
esc_html__( 'Custom Post Type UI has native support for WPGraphQL. Please <a href="%s">de-active</a> the "WPGraphQL for Custom Post Type UI" extension to proceed.', 'custom-post-type-ui' ),
|
341 |
+
$link // phpcs:ignore.
|
342 |
+
);
|
343 |
+
?>
|
344 |
+
</p>
|
345 |
</div>
|
346 |
+
<?php
|
347 |
+
}
|
348 |
+
);
|
349 |
|
350 |
return;
|
351 |
}
|
images/cptui-icon-128x128.png
DELETED
Binary file
|
images/cptui-icon-173x173.png
CHANGED
Binary file
|
images/cptui-icon-256x256.png
DELETED
Binary file
|
inc/about.php
CHANGED
@@ -81,14 +81,26 @@ function cptui_settings() {
|
|
81 |
do_action( 'cptui_main_page_before_changelog' );
|
82 |
?>
|
83 |
|
84 |
-
<h2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
<div class="changelog about-integrations">
|
86 |
<div class="cptui-feature feature-section col three-col">
|
87 |
<div class="col">
|
88 |
-
<h2><?php esc_html_e( '
|
89 |
-
<p><?php esc_html_e( '
|
90 |
-
<h2><?php esc_html_e( '
|
91 |
-
<p><?php esc_html_e( '
|
|
|
|
|
|
|
|
|
92 |
</div>
|
93 |
</div>
|
94 |
</div>
|
@@ -114,6 +126,7 @@ function cptui_settings() {
|
|
114 |
* @since 1.4.0
|
115 |
*/
|
116 |
function cptui_pluginize_content() {
|
|
|
117 |
echo '<h1>' . sprintf( esc_html__( 'More from %s', 'custom-post-type-ui' ), 'WebDevStudios' ) . '</h1>';
|
118 |
echo '<div class="wdspromos-about">';
|
119 |
$ads = cptui_get_ads();
|
@@ -131,7 +144,7 @@ function cptui_pluginize_content() {
|
|
131 |
printf(
|
132 |
'<p><a href="%s">%s</a></p>',
|
133 |
esc_url( $ad['url'] ),
|
134 |
-
$the_ad
|
135 |
);
|
136 |
}
|
137 |
}
|
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>
|
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();
|
144 |
printf(
|
145 |
'<p><a href="%s">%s</a></p>',
|
146 |
esc_url( $ad['url'] ),
|
147 |
+
$the_ad // phpcs:ignore
|
148 |
);
|
149 |
}
|
150 |
}
|
inc/listings.php
CHANGED
@@ -44,7 +44,7 @@ add_action( 'admin_enqueue_scripts', 'cptui_listings_assets' );
|
|
44 |
* @internal
|
45 |
*/
|
46 |
function cptui_listings() {
|
47 |
-
|
48 |
<div class="wrap cptui-listings">
|
49 |
<?php
|
50 |
/**
|
@@ -62,35 +62,35 @@ function cptui_listings() {
|
|
62 |
$post_types = cptui_get_post_type_data();
|
63 |
echo '<h2 id="post-types">' . esc_html__( 'Post Types', 'custom-post-type-ui' ) . '</h2>';
|
64 |
if ( ! empty( $post_types ) ) {
|
65 |
-
|
66 |
<p>
|
67 |
-
|
68 |
-
|
69 |
/* translators: %s: Total count of registered CPTUI post types */
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
</p>
|
75 |
|
76 |
-
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
<table class="wp-list-table widefat post-type-listing">
|
95 |
<thead>
|
96 |
<tr>
|
@@ -158,7 +158,7 @@ function cptui_listings() {
|
|
158 |
);
|
159 |
|
160 |
if ( $archive ) {
|
161 |
-
|
162 |
<a href="<?php echo esc_attr( get_post_type_archive_link( $post_type ) ); ?>"><?php esc_html_e( 'View frontend archive', 'custom-post-type-ui' ); ?></a>
|
163 |
<?php } ?>
|
164 |
</td>
|
@@ -263,7 +263,7 @@ function cptui_listings() {
|
|
263 |
</tr>
|
264 |
</tfoot>
|
265 |
</table>
|
266 |
-
|
267 |
/**
|
268 |
* Fires after the listing of registered post type data.
|
269 |
*
|
@@ -451,7 +451,7 @@ function cptui_listings() {
|
|
451 |
</tr>
|
452 |
</tfoot>
|
453 |
</table>
|
454 |
-
|
455 |
/**
|
456 |
* Fires after the listing of registered taxonomy data.
|
457 |
*
|
@@ -487,7 +487,8 @@ function cptui_no_post_types_to_list() {
|
|
487 |
echo '<p>' . sprintf(
|
488 |
/* translators: 1st %s: Link to manage post types section 2nd %s Link text */
|
489 |
esc_html__( 'No post types registered for display. Visit %s to get started.', 'custom-post-type-ui' ),
|
490 |
-
sprintf(
|
|
|
491 |
esc_attr( admin_url( 'admin.php?page=cptui_manage_post_types' ) ),
|
492 |
esc_html__( 'Add/Edit Post Types', 'custom-post-type-ui' )
|
493 |
)
|
@@ -508,7 +509,8 @@ function cptui_no_taxonomies_to_list() {
|
|
508 |
echo '<p>' . sprintf(
|
509 |
/* translators: %s: Link to manage taxonomies section */
|
510 |
esc_html__( 'No taxonomies registered for display. Visit %s to get started.', 'custom-post-type-ui' ),
|
511 |
-
sprintf(
|
|
|
512 |
esc_attr( admin_url( 'admin.php?page=cptui_manage_taxonomies' ) ),
|
513 |
esc_html__( 'Add/Edit Taxonomies', 'custom-post-type-ui' )
|
514 |
)
|
44 |
* @internal
|
45 |
*/
|
46 |
function cptui_listings() {
|
47 |
+
?>
|
48 |
<div class="wrap cptui-listings">
|
49 |
<?php
|
50 |
/**
|
62 |
$post_types = cptui_get_post_type_data();
|
63 |
echo '<h2 id="post-types">' . esc_html__( 'Post Types', 'custom-post-type-ui' ) . '</h2>';
|
64 |
if ( ! empty( $post_types ) ) {
|
65 |
+
?>
|
66 |
<p>
|
67 |
+
<?php
|
68 |
+
printf(
|
69 |
/* translators: %s: Total count of registered CPTUI post types */
|
70 |
+
esc_html__( 'Custom Post Type UI registered post types count total: %d', 'custom-post-type-ui' ),
|
71 |
+
count( $post_types )
|
72 |
+
);
|
73 |
+
?>
|
74 |
</p>
|
75 |
|
76 |
+
<?php
|
77 |
|
78 |
+
$post_type_table_heads = [
|
79 |
+
esc_html__( 'Post Type', 'custom-post-type-ui' ),
|
80 |
+
esc_html__( 'Settings', 'custom-post-type-ui' ),
|
81 |
+
esc_html__( 'Supports', 'custom-post-type-ui' ),
|
82 |
+
esc_html__( 'Taxonomies', 'custom-post-type-ui' ),
|
83 |
+
esc_html__( 'Labels', 'custom-post-type-ui' ),
|
84 |
+
esc_html__( 'Template Hierarchy', 'custom-post-type-ui' ),
|
85 |
+
];
|
86 |
|
87 |
+
/**
|
88 |
+
* Fires before the listing of registered post type data.
|
89 |
+
*
|
90 |
+
* @since 1.1.0
|
91 |
+
*/
|
92 |
+
do_action( 'cptui_before_post_type_listing' );
|
93 |
+
?>
|
94 |
<table class="wp-list-table widefat post-type-listing">
|
95 |
<thead>
|
96 |
<tr>
|
158 |
);
|
159 |
|
160 |
if ( $archive ) {
|
161 |
+
?>
|
162 |
<a href="<?php echo esc_attr( get_post_type_archive_link( $post_type ) ); ?>"><?php esc_html_e( 'View frontend archive', 'custom-post-type-ui' ); ?></a>
|
163 |
<?php } ?>
|
164 |
</td>
|
263 |
</tr>
|
264 |
</tfoot>
|
265 |
</table>
|
266 |
+
<?php
|
267 |
/**
|
268 |
* Fires after the listing of registered post type data.
|
269 |
*
|
451 |
</tr>
|
452 |
</tfoot>
|
453 |
</table>
|
454 |
+
<?php
|
455 |
/**
|
456 |
* Fires after the listing of registered taxonomy data.
|
457 |
*
|
487 |
echo '<p>' . sprintf(
|
488 |
/* translators: 1st %s: Link to manage post types section 2nd %s Link text */
|
489 |
esc_html__( 'No post types registered for display. Visit %s to get started.', 'custom-post-type-ui' ),
|
490 |
+
sprintf(
|
491 |
+
'<a href="%s">%s</a>',
|
492 |
esc_attr( admin_url( 'admin.php?page=cptui_manage_post_types' ) ),
|
493 |
esc_html__( 'Add/Edit Post Types', 'custom-post-type-ui' )
|
494 |
)
|
509 |
echo '<p>' . sprintf(
|
510 |
/* translators: %s: Link to manage taxonomies section */
|
511 |
esc_html__( 'No taxonomies registered for display. Visit %s to get started.', 'custom-post-type-ui' ),
|
512 |
+
sprintf(
|
513 |
+
'<a href="%s">%s</a>',
|
514 |
esc_attr( admin_url( 'admin.php?page=cptui_manage_taxonomies' ) ),
|
515 |
esc_html__( 'Add/Edit Taxonomies', 'custom-post-type-ui' )
|
516 |
)
|
inc/post-types.php
CHANGED
@@ -41,11 +41,23 @@ function cptui_post_type_enqueue_scripts() {
|
|
41 |
wp_enqueue_style( 'cptui-css' );
|
42 |
|
43 |
$core = get_post_types( [ '_builtin' => true ] );
|
44 |
-
$public = get_post_types(
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
$registered_post_types = array_merge( $core, $public, $private );
|
47 |
|
48 |
-
wp_localize_script(
|
|
|
|
|
49 |
[
|
50 |
'confirm' => esc_html__( 'Are you sure you want to delete this? Deleting will NOT remove created content.', 'custom-post-type-ui' ),
|
51 |
'existing_post_types' => $registered_post_types,
|
@@ -128,7 +140,7 @@ add_filter( 'cptui_get_tabs', 'cptui_post_type_tabs', 10, 2 );
|
|
128 |
*/
|
129 |
function cptui_manage_post_types() {
|
130 |
|
131 |
-
$tab = ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) ? 'edit' : 'new';
|
132 |
$tab_class = 'cptui-' . $tab;
|
133 |
$current = null;
|
134 |
?>
|
@@ -175,7 +187,8 @@ function cptui_manage_post_types() {
|
|
175 |
$ui = new cptui_admin_ui();
|
176 |
|
177 |
// Will only be set if we're already on the edit screen.
|
178 |
-
if ( ! empty( $post_types ) ) {
|
|
|
179 |
<form id="cptui_select_post_type" method="post" action="<?php echo esc_url( cptui_get_post_form_action( $ui ) ); ?>">
|
180 |
<label for="post_type"><?php esc_html_e( 'Select: ', 'custom-post-type-ui' ); ?></label>
|
181 |
<?php
|
@@ -193,7 +206,7 @@ function cptui_manage_post_types() {
|
|
193 |
?>
|
194 |
<input type="submit" class="button-secondary" id="cptui_select_post_type_submit" name="cptui_select_post_type_submit" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_select', __( 'Select', 'custom-post-type-ui' ) ) ); ?>" />
|
195 |
</form>
|
196 |
-
|
197 |
|
198 |
/**
|
199 |
* Fires below the post type select input.
|
@@ -203,7 +216,8 @@ function cptui_manage_post_types() {
|
|
203 |
* @param string $value Current post type selected.
|
204 |
*/
|
205 |
do_action( 'cptui_below_post_type_select', $current['name'] );
|
206 |
-
}
|
|
|
207 |
|
208 |
<form class="posttypesui" method="post" action="<?php echo esc_url( cptui_get_post_form_action( $ui ) ); ?>">
|
209 |
<div class="postbox-container">
|
@@ -224,27 +238,29 @@ function cptui_manage_post_types() {
|
|
224 |
<div class="main">
|
225 |
<table class="form-table cptui-table">
|
226 |
<?php
|
227 |
-
echo $ui->get_tr_start() . $ui->get_th_start();
|
228 |
-
echo $ui->get_label( 'name', esc_html__( 'Post Type Slug', 'custom-post-type-ui' ) );
|
229 |
-
echo $ui->get_required_span();
|
230 |
|
231 |
if ( 'edit' === $tab ) {
|
232 |
echo '<p id="slugchanged" class="hidemessage">' . esc_html__( 'Slug has changed', 'custom-post-type-ui' ) . '<span class="dashicons dashicons-warning"></span></p>';
|
233 |
}
|
234 |
echo '<p id="slugexists" class="hidemessage">' . esc_html__( 'Slug already exists', 'custom-post-type-ui' ) . '<span class="dashicons dashicons-warning"></span></p>';
|
235 |
|
236 |
-
echo $ui->get_th_end() . $ui->get_td_start();
|
237 |
-
|
238 |
-
echo $ui->get_text_input(
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
|
|
|
|
248 |
echo '<p class="cptui-slug-details">';
|
249 |
esc_html_e( 'Slugs should only contain alphanumeric, latin characters. Underscores should be used in place of spaces. Set "Custom Rewrite Slug" field to make slug use dashes for URLs.', 'custom-post-type-ui' );
|
250 |
echo '</p>';
|
@@ -255,99 +271,111 @@ function cptui_manage_post_types() {
|
|
255 |
echo '</p>';
|
256 |
|
257 |
echo '<div class="cptui-spacer">';
|
258 |
-
echo $ui->get_check_input(
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
|
|
|
|
268 |
echo '</div>';
|
269 |
}
|
270 |
|
271 |
-
echo $ui->get_td_end(); echo $ui->get_tr_end();
|
272 |
-
|
273 |
-
echo $ui->get_text_input(
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
|
|
|
|
|
|
|
|
292 |
|
293 |
$link_text = ( 'new' === $tab ) ?
|
294 |
esc_html__( 'Populate additional labels based on chosen labels', 'custom-post-type-ui' ) :
|
295 |
esc_html__( 'Populate missing labels based on chosen labels', 'custom-post-type-ui' );
|
296 |
-
echo $ui->get_tr_end();
|
297 |
-
echo $ui->get_th_start() . esc_html__( 'Auto-populate labels', 'custom-post-type-ui' ) . $ui->get_th_end();
|
298 |
-
echo $ui->get_td_start();
|
299 |
-
|
300 |
-
|
301 |
<a href="#" id="auto-clear"><?php esc_html_e( 'Clear labels', 'custom-post-type-ui' ); ?></a>
|
302 |
<?php
|
303 |
-
echo $ui->get_td_end() . $ui->get_tr_end();
|
304 |
|
305 |
-
|
306 |
</table>
|
307 |
<p class="submit">
|
308 |
-
<?php wp_nonce_field( 'cptui_addedit_post_type_nonce_action', 'cptui_addedit_post_type_nonce_field' );
|
309 |
-
if ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) { ?>
|
310 |
<?php
|
|
|
|
|
|
|
|
|
311 |
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
<input type="submit" class="button-primary" name="cpt_submit" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_edit', __( 'Save Post Type', 'custom-post-type-ui' ) ) ); ?>" />
|
321 |
-
|
322 |
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
<input type="submit" class="button-secondary cptui-delete-top" name="cpt_delete" id="cpt_submit_delete" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_delete', __( 'Delete Post Type', 'custom-post-type-ui' ) ) ); ?>" />
|
332 |
<?php } else { ?>
|
333 |
-
|
334 |
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
<input type="submit" class="button-primary" name="cpt_submit" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_add', __( 'Add Post Type', 'custom-post-type-ui' ) ) ); ?>" />
|
344 |
-
|
|
|
345 |
|
346 |
-
if ( ! empty( $current ) ) {
|
|
|
347 |
<input type="hidden" name="cpt_original" id="cpt_original" value="<?php echo esc_attr( $current['name'] ); ?>" />
|
348 |
-
|
|
|
349 |
|
350 |
-
// Used to check and see if we should prevent duplicate slugs.
|
|
|
351 |
<input type="hidden" name="cpt_type_status" id="cpt_type_status" value="<?php echo esc_attr( $tab ); ?>" />
|
352 |
</p>
|
353 |
</div>
|
@@ -373,438 +401,501 @@ function cptui_manage_post_types() {
|
|
373 |
if ( isset( $current['description'] ) ) {
|
374 |
$current['description'] = stripslashes_deep( $current['description'] );
|
375 |
}
|
376 |
-
echo $ui->get_textarea_input( [
|
377 |
-
'namearray' => 'cpt_custom_post_type',
|
378 |
-
'name' => 'description',
|
379 |
-
'rows' => '4',
|
380 |
-
'cols' => '40',
|
381 |
-
'textvalue' => isset( $current['description'] ) ? esc_textarea( $current['description'] ) : '',
|
382 |
-
'labeltext' => esc_html__( 'Post Type Description', 'custom-post-type-ui' ),
|
383 |
-
'helptext' => esc_html__( 'Perhaps describe what your custom post type is used for?', 'custom-post-type-ui' ),
|
384 |
-
] );
|
385 |
-
|
386 |
-
echo $ui->get_text_input( [
|
387 |
-
'labeltext' => esc_html__( 'Menu Name', 'custom-post-type-ui' ),
|
388 |
-
'helptext' => esc_html__( 'Custom admin menu name for your custom post type.', 'custom-post-type-ui' ),
|
389 |
-
'namearray' => 'cpt_labels',
|
390 |
-
'name' => 'menu_name',
|
391 |
-
'textvalue' => isset( $current['labels']['menu_name'] ) ? esc_attr( $current['labels']['menu_name'] ) : '',
|
392 |
-
'aftertext' => esc_html__( '(e.g. My Movies)', 'custom-post-type-ui' ),
|
393 |
-
'data' => [
|
394 |
-
/* translators: Used for autofill */
|
395 |
-
'label' => sprintf( esc_attr__( 'My %s', 'custom-post-type-ui' ), 'item' ),
|
396 |
-
'plurality' => 'plural',
|
397 |
-
],
|
398 |
-
] );
|
399 |
-
|
400 |
-
echo $ui->get_text_input( [
|
401 |
-
'labeltext' => esc_html__( 'All Items', 'custom-post-type-ui' ),
|
402 |
-
'helptext' => esc_html__( 'Used in the post type admin submenu.', 'custom-post-type-ui' ),
|
403 |
-
'namearray' => 'cpt_labels',
|
404 |
-
'name' => 'all_items',
|
405 |
-
'textvalue' => isset( $current['labels']['all_items'] ) ? esc_attr( $current['labels']['all_items'] ) : '',
|
406 |
-
'aftertext' => esc_html__( '(e.g. All Movies)', 'custom-post-type-ui' ),
|
407 |
-
'data' => [
|
408 |
-
/* translators: Used for autofill */
|
409 |
-
'label' => sprintf( esc_attr__( 'All %s', 'custom-post-type-ui' ), 'item' ),
|
410 |
-
'plurality' => 'plural',
|
411 |
-
],
|
412 |
-
] );
|
413 |
-
|
414 |
-
echo $ui->get_text_input( [
|
415 |
-
'labeltext' => esc_html__( 'Add New', 'custom-post-type-ui' ),
|
416 |
-
'helptext' => esc_html__( 'Used in the post type admin submenu.', 'custom-post-type-ui' ),
|
417 |
-
'namearray' => 'cpt_labels',
|
418 |
-
'name' => 'add_new',
|
419 |
-
'textvalue' => isset( $current['labels']['add_new'] ) ? esc_attr( $current['labels']['add_new'] ) : '',
|
420 |
-
'aftertext' => esc_html__( '(e.g. Add New)', 'custom-post-type-ui' ),
|
421 |
-
'data' => [
|
422 |
-
/* translators: Used for autofill */
|
423 |
-
'label' => esc_attr__( 'Add new', 'custom-post-type-ui' ),
|
424 |
-
'plurality' => 'plural',
|
425 |
-
],
|
426 |
-
] );
|
427 |
-
|
428 |
-
echo $ui->get_text_input( [
|
429 |
-
'labeltext' => esc_html__( 'Add New Item', 'custom-post-type-ui' ),
|
430 |
-
'helptext' => esc_html__( 'Used at the top of the post editor screen for a new post type post.', 'custom-post-type-ui' ),
|
431 |
-
'namearray' => 'cpt_labels',
|
432 |
-
'name' => 'add_new_item',
|
433 |
-
'textvalue' => isset( $current['labels']['add_new_item'] ) ? esc_attr( $current['labels']['add_new_item'] ) : '',
|
434 |
-
'aftertext' => esc_html__( '(e.g. Add New Movie)', 'custom-post-type-ui' ),
|
435 |
-
'data' => [
|
436 |
-
/* translators: Used for autofill */
|
437 |
-
'label' => sprintf( esc_attr__( 'Add new %s', 'custom-post-type-ui' ), 'item' ),
|
438 |
-
'plurality' => 'singular',
|
439 |
-
],
|
440 |
-
] );
|
441 |
-
|
442 |
-
echo $ui->get_text_input( [
|
443 |
-
'labeltext' => esc_html__( 'Edit Item', 'custom-post-type-ui' ),
|
444 |
-
'helptext' => esc_html__( 'Used at the top of the post editor screen for an existing post type post.', 'custom-post-type-ui' ),
|
445 |
-
'namearray' => 'cpt_labels',
|
446 |
-
'name' => 'edit_item',
|
447 |
-
'textvalue' => isset( $current['labels']['edit_item'] ) ? esc_attr( $current['labels']['edit_item'] ) : '',
|
448 |
-
'aftertext' => esc_html__( '(e.g. Edit Movie)', 'custom-post-type-ui' ),
|
449 |
-
'data' => [
|
450 |
-
/* translators: Used for autofill */
|
451 |
-
'label' => sprintf( esc_attr__( 'Edit %s', 'custom-post-type-ui' ), 'item' ),
|
452 |
-
'plurality' => 'singular',
|
453 |
-
],
|
454 |
-
] );
|
455 |
-
|
456 |
-
echo $ui->get_text_input( [
|
457 |
-
'labeltext' => esc_html__( 'New Item', 'custom-post-type-ui' ),
|
458 |
-
'helptext' => esc_html__( 'Post type label. Used in the admin menu for displaying post types.', 'custom-post-type-ui' ),
|
459 |
-
'namearray' => 'cpt_labels',
|
460 |
-
'name' => 'new_item',
|
461 |
-
'textvalue' => isset( $current['labels']['new_item'] ) ? esc_attr( $current['labels']['new_item'] ) : '',
|
462 |
-
'aftertext' => esc_html__( '(e.g. New Movie)', 'custom-post-type-ui' ),
|
463 |
-
'data' => [
|
464 |
-
/* translators: Used for autofill */
|
465 |
-
'label' => sprintf( esc_attr__( 'New %s', 'custom-post-type-ui' ), 'item' ),
|
466 |
-
'plurality' => 'singular',
|
467 |
-
],
|
468 |
-
] );
|
469 |
-
|
470 |
-
echo $ui->get_text_input( [
|
471 |
-
'labeltext' => esc_html__( 'View Item', 'custom-post-type-ui' ),
|
472 |
-
'helptext' => esc_html__( 'Used in the admin bar when viewing editor screen for a published post in the post type.', 'custom-post-type-ui' ),
|
473 |
-
'namearray' => 'cpt_labels',
|
474 |
-
'name' => 'view_item',
|
475 |
-
'textvalue' => isset( $current['labels']['view_item'] ) ? esc_attr( $current['labels']['view_item'] ) : '',
|
476 |
-
'aftertext' => esc_html__( '(e.g. View Movie)', 'custom-post-type-ui' ),
|
477 |
-
'data' => [
|
478 |
-
/* translators: Used for autofill */
|
479 |
-
'label' => sprintf( esc_attr__( 'View %s', 'custom-post-type-ui' ), 'item' ),
|
480 |
-
'plurality' => 'singular',
|
481 |
-
],
|
482 |
-
] );
|
483 |
-
|
484 |
-
echo $ui->get_text_input( [
|
485 |
-
'labeltext' => esc_html__( 'View Items', 'custom-post-type-ui' ),
|
486 |
-
'helptext' => esc_html__( 'Used in the admin bar when viewing editor screen for a published post in the post type.', 'custom-post-type-ui' ),
|
487 |
-
'namearray' => 'cpt_labels',
|
488 |
-
'name' => 'view_items',
|
489 |
-
'textvalue' => isset( $current['labels']['view_items'] ) ? esc_attr( $current['labels']['view_items'] ) : '',
|
490 |
-
'aftertext' => esc_html__( '(e.g. View Movies)', 'custom-post-type-ui' ),
|
491 |
-
'data' => [
|
492 |
-
/* translators: Used for autofill */
|
493 |
-
'label' => sprintf( esc_attr__( 'View %s', 'custom-post-type-ui' ), 'item' ),
|
494 |
-
'plurality' => 'plural',
|
495 |
-
],
|
496 |
-
] );
|
497 |
-
|
498 |
-
echo $ui->get_text_input( [
|
499 |
-
'labeltext' => esc_html__( 'Search Item', 'custom-post-type-ui' ),
|
500 |
-
'helptext' => esc_html__( 'Used as the text for the search button on post type list screen.', 'custom-post-type-ui' ),
|
501 |
-
'namearray' => 'cpt_labels',
|
502 |
-
'name' => 'search_items',
|
503 |
-
'textvalue' => isset( $current['labels']['search_items'] ) ? esc_attr( $current['labels']['search_items'] ) : '',
|
504 |
-
'aftertext' => esc_html__( '(e.g. Search Movies)', 'custom-post-type-ui' ),
|
505 |
-
'data' => [
|
506 |
-
/* translators: Used for autofill */
|
507 |
-
'label' => sprintf( esc_attr__( 'Search %s', 'custom-post-type-ui' ), 'item' ),
|
508 |
-
'plurality' => 'plural',
|
509 |
-
],
|
510 |
-
] );
|
511 |
-
|
512 |
-
echo $ui->get_text_input( [
|
513 |
-
'labeltext' => esc_html__( 'Not Found', 'custom-post-type-ui' ),
|
514 |
-
'helptext' => esc_html__( 'Used when there are no posts to display on the post type list screen.', 'custom-post-type-ui' ),
|
515 |
-
'namearray' => 'cpt_labels',
|
516 |
-
'name' => 'not_found',
|
517 |
-
'textvalue' => isset( $current['labels']['not_found'] ) ? esc_attr( $current['labels']['not_found'] ) : '',
|
518 |
-
'aftertext' => esc_html__( '(e.g. No Movies found)', 'custom-post-type-ui' ),
|
519 |
-
'data' => [
|
520 |
-
/* translators: Used for autofill */
|
521 |
-
'label' => sprintf( esc_attr__( 'No %s found', 'custom-post-type-ui' ), 'item' ),
|
522 |
-
'plurality' => 'plural',
|
523 |
-
],
|
524 |
-
] );
|
525 |
-
|
526 |
-
echo $ui->get_text_input( [
|
527 |
-
'labeltext' => esc_html__( 'Not Found in Trash', 'custom-post-type-ui' ),
|
528 |
-
'helptext' => esc_html__( 'Used when there are no posts to display on the post type list trash screen.', 'custom-post-type-ui' ),
|
529 |
-
'namearray' => 'cpt_labels',
|
530 |
-
'name' => 'not_found_in_trash',
|
531 |
-
'textvalue' => isset( $current['labels']['not_found_in_trash'] ) ? esc_attr( $current['labels']['not_found_in_trash'] ) : '',
|
532 |
-
'aftertext' => esc_html__( '(e.g. No Movies found in Trash)', 'custom-post-type-ui' ),
|
533 |
-
'data' => [
|
534 |
-
/* translators: Used for autofill */
|
535 |
-
'label' => sprintf( esc_attr__( 'No %s found in trash', 'custom-post-type-ui' ), 'item' ),
|
536 |
-
'plurality' => 'plural',
|
537 |
-
],
|
538 |
-
] );
|
539 |
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
'
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
'
|
607 |
-
'
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
'
|
621 |
-
'
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
'
|
635 |
-
'
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
'
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
'
|
719 |
-
'
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
'name' => 'item_published',
|
728 |
-
'textvalue' => isset( $current['labels']['item_published'] ) ? esc_attr( $current['labels']['item_published'] ) : '',
|
729 |
-
'aftertext' => esc_html__( '(e.g. Movie published)', 'custom-post-type-ui' ),
|
730 |
-
'data' => [
|
731 |
-
/* translators: Used for autofill */
|
732 |
-
'label' => sprintf( esc_attr__( '%s published', 'custom-post-type-ui' ), 'item' ),
|
733 |
-
'plurality' => 'singular',
|
734 |
-
],
|
735 |
-
] );
|
736 |
-
|
737 |
-
echo $ui->get_text_input( [
|
738 |
-
'labeltext' => esc_html__( 'Item Published Privately', 'custom-post-type-ui' ),
|
739 |
-
'helptext' => esc_html__( 'Used in the editor notice after publishing a private post. Default "Post published privately." / "Page published privately."', 'custom-post-type-ui' ),
|
740 |
-
'namearray' => 'cpt_labels',
|
741 |
-
'name' => 'item_published_privately',
|
742 |
-
'textvalue' => isset( $current['labels']['item_published_privately'] ) ? esc_attr( $current['labels']['item_published_privately'] ) : '',
|
743 |
-
'aftertext' => esc_html__( '(e.g. Movie published privately.)', 'custom-post-type-ui' ),
|
744 |
-
'data' => [
|
745 |
-
/* translators: Used for autofill */
|
746 |
-
'label' => sprintf( esc_attr__( '%s published privately.', 'custom-post-type-ui' ), 'item' ),
|
747 |
-
'plurality' => 'singular',
|
748 |
-
],
|
749 |
-
] );
|
750 |
-
|
751 |
-
echo $ui->get_text_input( [
|
752 |
-
'labeltext' => esc_html__( 'Item Reverted To Draft', 'custom-post-type-ui' ),
|
753 |
-
'helptext' => esc_html__( 'Used in the editor notice after reverting a post to draft. Default "Post reverted to draft." / "Page reverted to draft."', 'custom-post-type-ui' ),
|
754 |
-
'namearray' => 'cpt_labels',
|
755 |
-
'name' => 'item_reverted_to_draft',
|
756 |
-
'textvalue' => isset( $current['labels']['item_reverted_to_draft'] ) ? esc_attr( $current['labels']['item_reverted_to_draft'] ) : '',
|
757 |
-
'aftertext' => esc_html__( '(e.g. Movie reverted to draft)', 'custom-post-type-ui' ),
|
758 |
-
'data' => [
|
759 |
-
/* translators: Used for autofill */
|
760 |
-
'label' => sprintf( esc_attr__( '%s reverted to draft.', 'custom-post-type-ui' ), 'item' ),
|
761 |
-
'plurality' => 'singular',
|
762 |
-
],
|
763 |
-
] );
|
764 |
-
|
765 |
-
echo $ui->get_text_input( [
|
766 |
-
'labeltext' => esc_html__( 'Item Scheduled', 'custom-post-type-ui' ),
|
767 |
-
'helptext' => esc_html__( 'Used in the editor notice after scheduling a post to be published at a later date. Default "Post scheduled." / "Page scheduled."', 'custom-post-type-ui' ),
|
768 |
-
'namearray' => 'cpt_labels',
|
769 |
-
'name' => 'item_scheduled',
|
770 |
-
'textvalue' => isset( $current['labels']['item_scheduled'] ) ? esc_attr( $current['labels']['item_scheduled'] ) : '',
|
771 |
-
'aftertext' => esc_html__( '(e.g. Movie scheduled)', 'custom-post-type-ui' ),
|
772 |
-
'data' => [
|
773 |
-
/* translators: Used for autofill */
|
774 |
-
'label' => sprintf( esc_attr__( '%s scheduled', 'custom-post-type-ui' ), 'item' ),
|
775 |
-
'plurality' => 'singular',
|
776 |
-
],
|
777 |
-
] );
|
778 |
-
|
779 |
-
echo $ui->get_text_input( [
|
780 |
-
'labeltext' => esc_html__( 'Item Updated', 'custom-post-type-ui' ),
|
781 |
-
'helptext' => esc_html__( 'Used in the editor notice after updating a post. Default "Post updated." / "Page updated."', 'custom-post-type-ui' ),
|
782 |
-
'namearray' => 'cpt_labels',
|
783 |
-
'name' => 'item_updated',
|
784 |
-
'textvalue' => isset( $current['labels']['item_updated'] ) ? esc_attr( $current['labels']['item_updated'] ) : '',
|
785 |
-
'aftertext' => esc_html__( '(e.g. Movie updated)', 'custom-post-type-ui' ),
|
786 |
-
'data' => [
|
787 |
-
/* translators: Used for autofill */
|
788 |
-
'label' => sprintf( esc_attr__( '%s updated.', 'custom-post-type-ui' ), 'item' ),
|
789 |
-
'plurality' => 'singular',
|
790 |
-
],
|
791 |
-
] );
|
792 |
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
'
|
803 |
-
|
804 |
-
|
805 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
806 |
|
807 |
-
|
808 |
</table>
|
809 |
</div>
|
810 |
</div>
|
@@ -827,283 +918,428 @@ function cptui_manage_post_types() {
|
|
827 |
<?php
|
828 |
$select = [
|
829 |
'options' => [
|
830 |
-
[
|
831 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
832 |
],
|
833 |
];
|
834 |
-
|
|
|
835 |
$select['selected'] = ! empty( $selected ) ? $current['public'] : '';
|
836 |
-
echo $ui->get_select_input(
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
|
|
|
|
843 |
|
844 |
$select = [
|
845 |
'options' => [
|
846 |
-
[
|
847 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
848 |
],
|
849 |
];
|
850 |
-
|
|
|
851 |
$select['selected'] = ! empty( $selected ) ? $current['publicly_queryable'] : '';
|
852 |
-
echo $ui->get_select_input(
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
|
|
|
|
859 |
|
860 |
$select = [
|
861 |
'options' => [
|
862 |
-
[
|
863 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
864 |
],
|
865 |
];
|
866 |
-
|
|
|
867 |
$select['selected'] = ! empty( $selected ) ? $current['show_ui'] : '';
|
868 |
-
echo $ui->get_select_input(
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
|
|
|
|
875 |
|
876 |
$select = [
|
877 |
'options' => [
|
878 |
-
[
|
879 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
880 |
],
|
881 |
];
|
882 |
-
|
|
|
883 |
$select['selected'] = ( ! empty( $selected ) && ! empty( $current['show_in_nav_menus'] ) ) ? $current['show_in_nav_menus'] : '';
|
884 |
-
echo $ui->get_select_input(
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
|
|
|
|
891 |
|
892 |
$select = [
|
893 |
'options' => [
|
894 |
-
[
|
895 |
-
|
896 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
897 |
];
|
|
|
898 |
$selected = ( isset( $current ) && ! empty( $current['delete_with_user'] ) ) ? disp_boolean( $current['delete_with_user'] ) : '';
|
899 |
$select['selected'] = ( ! empty( $selected ) && ! empty( $current['delete_with_user'] ) ) ? $current['delete_with_user'] : '';
|
900 |
-
echo $ui->get_select_input(
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
|
|
|
|
907 |
|
908 |
$select = [
|
909 |
'options' => [
|
910 |
-
[
|
911 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
912 |
],
|
913 |
];
|
914 |
-
|
|
|
915 |
$select['selected'] = ( ! empty( $selected ) && ! empty( $current['show_in_rest'] ) ) ? $current['show_in_rest'] : '';
|
916 |
-
echo $ui->get_select_input(
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
'namearray' => 'cpt_custom_post_type',
|
926 |
-
'name' => 'rest_base',
|
927 |
-
'labeltext' => esc_html__( 'REST API base slug', 'custom-post-type-ui' ),
|
928 |
-
'aftertext' => esc_attr__( 'Slug to use in REST API URLs.', 'custom-post-type-ui' ),
|
929 |
-
'textvalue' => isset( $current['rest_base'] ) ? esc_attr( $current['rest_base'] ) : '',
|
930 |
-
] );
|
931 |
|
932 |
-
echo $ui->get_text_input(
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
|
|
|
|
939 |
|
940 |
-
echo $ui->get_text_input(
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
|
|
|
|
947 |
|
948 |
-
echo $ui->
|
949 |
-
|
950 |
-
|
951 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
952 |
|
953 |
$select = [
|
954 |
'options' => [
|
955 |
-
[
|
956 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
957 |
],
|
958 |
];
|
959 |
-
|
|
|
960 |
$select['selected'] = ! empty( $selected ) ? $current['has_archive'] : '';
|
961 |
-
echo $ui->get_select_input(
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
|
|
|
|
968 |
|
969 |
echo '<br/>';
|
970 |
|
971 |
-
echo $ui->get_text_input(
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
|
|
|
|
980 |
|
981 |
$select = [
|
982 |
'options' => [
|
983 |
-
[
|
984 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
985 |
],
|
986 |
];
|
987 |
-
|
|
|
988 |
$select['selected'] = ! empty( $selected ) ? $current['exclude_from_search'] : '';
|
989 |
-
echo $ui->get_select_input(
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
|
|
|
|
|
|
|
|
1004 |
|
1005 |
$select = [
|
1006 |
'options' => [
|
1007 |
-
[
|
1008 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1009 |
],
|
1010 |
];
|
1011 |
-
|
|
|
1012 |
$select['selected'] = ! empty( $selected ) ? $current['hierarchical'] : '';
|
1013 |
-
echo $ui->get_select_input(
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
|
|
|
|
1020 |
|
1021 |
$select = [
|
1022 |
'options' => [
|
1023 |
-
[
|
1024 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1025 |
],
|
1026 |
];
|
|
|
1027 |
$selected = isset( $current ) ? disp_boolean( $current['can_export'] ) : '';
|
1028 |
$select['selected'] = ! empty( $selected ) ? $current['can_export'] : '';
|
1029 |
-
echo $ui->get_select_input(
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
|
|
|
|
1036 |
|
1037 |
$select = [
|
1038 |
'options' => [
|
1039 |
-
[
|
1040 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1041 |
],
|
1042 |
];
|
1043 |
-
|
|
|
1044 |
$select['selected'] = ! empty( $selected ) ? $current['rewrite'] : '';
|
1045 |
-
echo $ui->get_select_input(
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
|
|
|
|
|
|
|
|
1061 |
|
1062 |
$select = [
|
1063 |
'options' => [
|
1064 |
-
[
|
1065 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1066 |
],
|
1067 |
];
|
1068 |
-
|
|
|
1069 |
$select['selected'] = ! empty( $selected ) ? $current['rewrite_withfront'] : '';
|
1070 |
-
echo $ui->get_select_input(
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
|
|
|
|
1077 |
|
1078 |
$select = [
|
1079 |
'options' => [
|
1080 |
-
[
|
1081 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1082 |
],
|
1083 |
];
|
1084 |
-
|
|
|
1085 |
$select['selected'] = ! empty( $selected ) ? $current['query_var'] : '';
|
1086 |
-
echo $ui->get_select_input(
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
|
|
|
|
|
|
|
|
1106 |
sprintf(
|
|
|
1107 |
esc_html__(
|
1108 |
'See %s in the "menu_position" section. Range of 5-100',
|
1109 |
'custom-post-type-ui'
|
@@ -1115,270 +1351,332 @@ function cptui_manage_post_types() {
|
|
1115 |
)
|
1116 |
);
|
1117 |
|
1118 |
-
echo $ui->get_th_end() . $ui->get_td_start();
|
1119 |
-
echo $ui->get_text_input(
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
echo $ui->
|
1129 |
-
|
1130 |
-
echo $ui->
|
1131 |
-
echo $ui->
|
|
|
|
|
1132 |
|
1133 |
$select = [
|
1134 |
'options' => [
|
1135 |
-
[
|
1136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1137 |
],
|
1138 |
];
|
1139 |
-
|
|
|
1140 |
$select['selected'] = ! empty( $selected ) ? $current['show_in_menu'] : '';
|
1141 |
-
echo $ui->get_select_input(
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
|
|
|
|
1148 |
|
1149 |
echo '<br/>';
|
1150 |
|
1151 |
-
echo $ui->get_text_input(
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
|
|
|
|
1160 |
|
1161 |
-
echo $ui->get_tr_start() . $ui->get_th_start();
|
1162 |
|
1163 |
$current_menu_icon = isset( $current['menu_icon'] ) ? esc_attr( $current['menu_icon'] ) : '';
|
1164 |
-
echo $ui->get_menu_icon_preview( $current_menu_icon );
|
1165 |
-
echo $ui->get_label( 'menu_icon', esc_html__( 'Menu Icon', 'custom-post-type-ui' ) );
|
1166 |
-
echo $ui->get_th_end() . $ui->get_td_start();
|
1167 |
-
echo $ui->get_text_input(
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
|
|
|
|
1179 |
|
1180 |
echo '<div class="cptui-spacer">';
|
1181 |
|
1182 |
-
echo $ui->get_button(
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
|
|
|
|
1187 |
|
1188 |
echo '<div class="cptui-spacer">';
|
1189 |
|
1190 |
-
echo $ui->get_button(
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
|
|
|
|
1194 |
echo '</div>';
|
1195 |
|
1196 |
-
echo $ui->get_td_end() . $ui->get_tr_end();
|
1197 |
|
1198 |
-
echo $ui->get_text_input(
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
|
|
|
|
1205 |
|
1206 |
-
echo $ui->get_tr_start() . $ui->get_th_start() . esc_html__( 'Supports', 'custom-post-type-ui' );
|
1207 |
|
1208 |
-
echo $ui->get_p( esc_html__( 'Add support for various available post editor features on the right. A checked value means the post type feature is supported.', 'custom-post-type-ui' ) );
|
1209 |
|
1210 |
-
echo $ui->get_p( esc_html__( 'Use the "None" option to explicitly set "supports" to false.', 'custom-post-type-ui' ) );
|
1211 |
|
1212 |
-
echo $ui->
|
1213 |
|
1214 |
-
echo $ui->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1215 |
|
1216 |
-
$
|
|
|
|
|
1217 |
if ( 'new' === $tab ) {
|
1218 |
$title_checked = 'true';
|
1219 |
}
|
1220 |
-
echo $ui->get_check_input(
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
|
|
|
|
1232 |
if ( 'new' === $tab ) {
|
1233 |
$editor_checked = 'true';
|
1234 |
}
|
1235 |
-
echo $ui->get_check_input(
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
|
|
|
|
1247 |
if ( 'new' === $tab ) {
|
1248 |
$thumb_checked = 'true';
|
1249 |
}
|
1250 |
-
echo $ui->get_check_input(
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1382 |
/**
|
1383 |
* Filters the arguments for taxonomies to list for post type association.
|
1384 |
*
|
@@ -1405,19 +1703,21 @@ function cptui_manage_post_types() {
|
|
1405 |
unset( $add_taxes['nav_menu'], $add_taxes['post_format'] );
|
1406 |
foreach ( $add_taxes as $add_tax ) {
|
1407 |
|
1408 |
-
$core_label = in_array( $add_tax->name, [ 'category', 'post_tag' ] ) ? __( '(WP Core)', 'custom-post-type-ui' ) : '';
|
1409 |
-
echo $ui->get_check_input(
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
|
|
|
|
1419 |
}
|
1420 |
-
echo $ui->get_fieldset_end() . $ui->get_td_end() . $ui->get_tr_end();
|
1421 |
?>
|
1422 |
</table>
|
1423 |
</div>
|
@@ -1432,11 +1732,12 @@ function cptui_manage_post_types() {
|
|
1432 |
*
|
1433 |
* @param cptui_admin_ui $ui Admin UI instance.
|
1434 |
*/
|
1435 |
-
do_action( 'cptui_post_type_after_fieldsets', $ui );
|
|
|
1436 |
|
1437 |
<p>
|
1438 |
<?php
|
1439 |
-
if ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) {
|
1440 |
/**
|
1441 |
* Filters the text value to use on the button when editing.
|
1442 |
*
|
@@ -1444,7 +1745,7 @@ function cptui_manage_post_types() {
|
|
1444 |
*
|
1445 |
* @param string $value Text to use for the button.
|
1446 |
*/
|
1447 |
-
|
1448 |
<input type="submit" class="button-primary" name="cpt_submit" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_edit', __( 'Save Post Type', 'custom-post-type-ui' ) ) ); ?>" />
|
1449 |
<?php
|
1450 |
|
@@ -1455,10 +1756,10 @@ function cptui_manage_post_types() {
|
|
1455 |
*
|
1456 |
* @param string $value Text to use for the button.
|
1457 |
*/
|
1458 |
-
|
1459 |
<input type="submit" class="button-secondary cptui-delete-bottom" name="cpt_delete" id="cpt_submit_delete" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_delete', __( 'Delete Post Type', 'custom-post-type-ui' ) ) ); ?>" />
|
1460 |
-
|
1461 |
-
|
1462 |
|
1463 |
/**
|
1464 |
* Filters the text value to use on the button when adding.
|
@@ -1467,14 +1768,14 @@ function cptui_manage_post_types() {
|
|
1467 |
*
|
1468 |
* @param string $value Text to use for the button.
|
1469 |
*/
|
1470 |
-
|
1471 |
<input type="submit" class="button-primary" name="cpt_submit" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_add', __( 'Add Post Type', 'custom-post-type-ui' ) ) ); ?>" />
|
1472 |
<?php } ?>
|
1473 |
</p>
|
1474 |
</div>
|
1475 |
</form>
|
1476 |
</div><!-- End .wrap -->
|
1477 |
-
<?php
|
1478 |
}
|
1479 |
|
1480 |
/**
|
@@ -1489,12 +1790,15 @@ function cptui_post_types_dropdown( $post_types = [] ) {
|
|
1489 |
$ui = new cptui_admin_ui();
|
1490 |
|
1491 |
if ( ! empty( $post_types ) ) {
|
1492 |
-
$select
|
1493 |
$select['options'] = [];
|
1494 |
|
1495 |
foreach ( $post_types as $type ) {
|
1496 |
$text = ! empty( $type['label'] ) ? esc_html( $type['label'] ) : esc_html( $type['name'] );
|
1497 |
-
$select['options'][] = [
|
|
|
|
|
|
|
1498 |
}
|
1499 |
|
1500 |
$current = cptui_get_current_post_type();
|
@@ -1503,19 +1807,21 @@ function cptui_post_types_dropdown( $post_types = [] ) {
|
|
1503 |
|
1504 |
/**
|
1505 |
* Filters the post type dropdown options before rendering.
|
1506 |
-
* @since 1.6.0
|
1507 |
*
|
|
|
1508 |
* @param array $select Array of options for the dropdown.
|
1509 |
* @param array $post_types Array of original passed in post types.
|
1510 |
*/
|
1511 |
$select = apply_filters( 'cptui_post_types_dropdown_options', $select, $post_types );
|
1512 |
|
1513 |
-
echo $ui->get_select_input(
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
|
|
|
|
1519 |
}
|
1520 |
}
|
1521 |
|
@@ -1538,21 +1844,21 @@ function cptui_get_current_post_type( $post_type_deleted = false ) {
|
|
1538 |
check_admin_referer( 'cptui_select_post_type_nonce_action', 'cptui_select_post_type_nonce_field' );
|
1539 |
}
|
1540 |
if ( isset( $_POST['cptui_selected_post_type']['post_type'] ) ) {
|
1541 |
-
$type = sanitize_text_field( $_POST['cptui_selected_post_type']['post_type'] );
|
1542 |
-
}
|
1543 |
$post_types = cptui_get_post_type_data();
|
1544 |
-
$type
|
1545 |
-
}
|
1546 |
// Return the submitted value.
|
1547 |
if ( ! in_array( $_POST['cpt_custom_post_type']['name'], cptui_reserved_post_types(), true ) ) {
|
1548 |
-
$type = sanitize_text_field( $_POST['cpt_custom_post_type']['name'] );
|
1549 |
} else {
|
1550 |
// Return the original value since user tried to submit a reserved term.
|
1551 |
-
$type = sanitize_text_field( $_POST['cpt_original'] );
|
1552 |
}
|
1553 |
}
|
1554 |
-
}
|
1555 |
-
$type = sanitize_text_field( $_GET['cptui_post_type'] );
|
1556 |
} else {
|
1557 |
$post_types = cptui_get_post_type_data();
|
1558 |
if ( ! empty( $post_types ) ) {
|
@@ -1618,7 +1924,7 @@ function cptui_delete_post_type( $data = [] ) {
|
|
1618 |
* @param array $post_types Array of our updated post types data.
|
1619 |
* @param array $data Array of submitted post type to update.
|
1620 |
*/
|
1621 |
-
if ( false === ( $success = apply_filters( 'cptui_post_type_delete_type', false, $post_types, $data ) ) ) {
|
1622 |
$success = update_option( 'cptui_post_types', $post_types );
|
1623 |
}
|
1624 |
}
|
@@ -1667,7 +1973,7 @@ function cptui_update_post_type( $data = [] ) {
|
|
1667 |
return cptui_admin_notices( 'error', '', false, __( 'Please provide a post type name', 'custom-post-type-ui' ) );
|
1668 |
}
|
1669 |
|
1670 |
-
if ( ! empty( $data['cpt_original'] ) && $data['cpt_original'] != $data['cpt_custom_post_type']['name'] ) {
|
1671 |
if ( ! empty( $data['update_post_types'] ) ) {
|
1672 |
add_filter( 'cptui_convert_post_type_posts', '__return_true' );
|
1673 |
}
|
@@ -1684,9 +1990,9 @@ function cptui_update_post_type( $data = [] ) {
|
|
1684 |
|
1685 |
// Check if they didn't put quotes in the name or rewrite slug.
|
1686 |
if ( false !== strpos( $data['cpt_custom_post_type']['name'], '\'' ) ||
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
|
1691 |
add_filter( 'cptui_custom_error_message', 'cptui_slug_has_quotes' );
|
1692 |
return 'error';
|
@@ -1729,9 +2035,9 @@ function cptui_update_post_type( $data = [] ) {
|
|
1729 |
unset( $data['cpt_labels'][ $key ] );
|
1730 |
}
|
1731 |
|
1732 |
-
$label
|
1733 |
-
$label
|
1734 |
-
$label
|
1735 |
if ( 'parent' === $key ) {
|
1736 |
$data['cpt_labels']['parent_item_colon'] = stripslashes_deep( $label );
|
1737 |
} else {
|
@@ -1760,8 +2066,12 @@ function cptui_update_post_type( $data = [] ) {
|
|
1760 |
$singular_label = htmlspecialchars( stripslashes( $singular_label ), ENT_QUOTES );
|
1761 |
}
|
1762 |
|
|
|
|
|
|
|
|
|
|
|
1763 |
$name = trim( $data['cpt_custom_post_type']['name'] );
|
1764 |
-
$description = stripslashes_deep( $data['cpt_custom_post_type']['description'] );
|
1765 |
$rest_base = trim( $data['cpt_custom_post_type']['rest_base'] );
|
1766 |
$rest_controller_class = trim( $data['cpt_custom_post_type']['rest_controller_class'] );
|
1767 |
$rest_namespace = trim( $data['cpt_custom_post_type']['rest_namespace'] );
|
@@ -1831,7 +2141,7 @@ function cptui_update_post_type( $data = [] ) {
|
|
1831 |
* @param array $post_types Array of our updated post types data.
|
1832 |
* @param array $data Array of submitted post type to update.
|
1833 |
*/
|
1834 |
-
if ( false === ( $success = apply_filters( 'cptui_post_type_update_save', false, $post_types, $data ) ) ) {
|
1835 |
$success = update_option( 'cptui_post_types', $post_types );
|
1836 |
}
|
1837 |
|
@@ -1899,7 +2209,7 @@ function cptui_reserved_post_types() {
|
|
1899 |
|
1900 |
if ( is_string( $custom_reserved ) && ! empty( $custom_reserved ) ) {
|
1901 |
$reserved[] = $custom_reserved;
|
1902 |
-
}
|
1903 |
foreach ( $custom_reserved as $slug ) {
|
1904 |
$reserved[] = $slug;
|
1905 |
}
|
@@ -1919,7 +2229,7 @@ function cptui_reserved_post_types() {
|
|
1919 |
* @param string $new_slug New post type slug. Optional. Default empty string.
|
1920 |
*/
|
1921 |
function cptui_convert_post_type_posts( $original_slug = '', $new_slug = '' ) {
|
1922 |
-
$args
|
1923 |
'posts_per_page' => -1,
|
1924 |
'post_type' => $original_slug,
|
1925 |
];
|
@@ -1958,15 +2268,27 @@ function cptui_check_existing_post_type_slugs( $slug_exists = false, $post_type_
|
|
1958 |
}
|
1959 |
|
1960 |
// Check if we're registering a reserved post type slug.
|
1961 |
-
if ( in_array( $post_type_slug, cptui_reserved_post_types() ) ) {
|
1962 |
return true;
|
1963 |
}
|
1964 |
|
1965 |
// Check if other plugins have registered non-public this same slug.
|
1966 |
-
$public = get_post_types(
|
1967 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1968 |
$registered_post_types = array_merge( $public, $private );
|
1969 |
-
if ( in_array( $post_type_slug, $registered_post_types ) ) {
|
1970 |
return true;
|
1971 |
}
|
1972 |
|
@@ -2020,13 +2342,13 @@ function cptui_process_post_type() {
|
|
2020 |
$result = '';
|
2021 |
if ( isset( $_POST['cpt_submit'] ) ) {
|
2022 |
check_admin_referer( 'cptui_addedit_post_type_nonce_action', 'cptui_addedit_post_type_nonce_field' );
|
2023 |
-
$data
|
2024 |
$result = cptui_update_post_type( $data );
|
2025 |
} elseif ( isset( $_POST['cpt_delete'] ) ) {
|
2026 |
check_admin_referer( 'cptui_addedit_post_type_nonce_action', 'cptui_addedit_post_type_nonce_field' );
|
2027 |
|
2028 |
$filtered_data = filter_input( INPUT_POST, 'cpt_custom_post_type', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
2029 |
-
$result
|
2030 |
add_filter( 'cptui_post_type_deleted', '__return_true' );
|
2031 |
}
|
2032 |
|
@@ -2038,7 +2360,9 @@ function cptui_process_post_type() {
|
|
2038 |
if ( isset( $_POST['cpt_delete'] ) && empty( cptui_get_post_type_slugs() ) ) {
|
2039 |
wp_safe_redirect(
|
2040 |
add_query_arg(
|
2041 |
-
[
|
|
|
|
|
2042 |
cptui_admin_url( 'admin.php?page=cptui_manage_post_types' )
|
2043 |
)
|
2044 |
);
|
@@ -2091,11 +2415,10 @@ add_action( 'init', 'cptui_do_convert_post_type_posts' );
|
|
2091 |
*/
|
2092 |
function cptui_updated_post_type_slug_exists( $slug_exists, $post_type_slug = '', $post_types = [] ) {
|
2093 |
if (
|
2094 |
-
( ! empty( $_POST['cpt_type_status'] ) && 'edit' === $_POST['cpt_type_status'] )
|
2095 |
-
! in_array( $post_type_slug, cptui_reserved_post_types() )
|
2096 |
-
( ! empty( $_POST['cpt_original'] ) && $post_type_slug === $_POST['cpt_original'] )
|
2097 |
-
)
|
2098 |
-
{
|
2099 |
$slug_exists = false;
|
2100 |
}
|
2101 |
return $slug_exists;
|
@@ -2120,13 +2443,14 @@ function cptui_filtered_post_type_post_global() {
|
|
2120 |
'cpt_addon_taxes',
|
2121 |
'update_post_types',
|
2122 |
];
|
|
|
2123 |
$third_party_items_arrays = apply_filters(
|
2124 |
'cptui_filtered_post_type_post_global_arrays',
|
2125 |
-
(array) []
|
2126 |
);
|
2127 |
|
2128 |
$items_arrays = array_merge( $default_arrays, $third_party_items_arrays );
|
2129 |
-
foreach( $items_arrays as $item ) {
|
2130 |
$first_result = filter_input( INPUT_POST, $item, FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
2131 |
|
2132 |
if ( $first_result ) {
|
@@ -2138,9 +2462,10 @@ function cptui_filtered_post_type_post_global() {
|
|
2138 |
'cpt_original',
|
2139 |
'cpt_type_status',
|
2140 |
];
|
|
|
2141 |
$third_party_items_strings = apply_filters(
|
2142 |
'cptui_filtered_post_type_post_global_strings',
|
2143 |
-
(array) []
|
2144 |
);
|
2145 |
|
2146 |
$items_string = array_merge( $default_strings, $third_party_items_strings );
|
@@ -2155,6 +2480,7 @@ function cptui_filtered_post_type_post_global() {
|
|
2155 |
return $filtered_data;
|
2156 |
}
|
2157 |
|
|
|
2158 |
function cptui_custom_enter_title_here( $text, $post ) {
|
2159 |
$cptui_obj = cptui_get_cptui_post_type_object( $post->post_type );
|
2160 |
if ( empty( $cptui_obj ) ) {
|
41 |
wp_enqueue_style( 'cptui-css' );
|
42 |
|
43 |
$core = get_post_types( [ '_builtin' => true ] );
|
44 |
+
$public = get_post_types(
|
45 |
+
[
|
46 |
+
'_builtin' => false,
|
47 |
+
'public' => true,
|
48 |
+
]
|
49 |
+
);
|
50 |
+
$private = get_post_types(
|
51 |
+
[
|
52 |
+
'_builtin' => false,
|
53 |
+
'public' => false,
|
54 |
+
]
|
55 |
+
);
|
56 |
$registered_post_types = array_merge( $core, $public, $private );
|
57 |
|
58 |
+
wp_localize_script(
|
59 |
+
'cptui',
|
60 |
+
'cptui_type_data',
|
61 |
[
|
62 |
'confirm' => esc_html__( 'Are you sure you want to delete this? Deleting will NOT remove created content.', 'custom-post-type-ui' ),
|
63 |
'existing_post_types' => $registered_post_types,
|
140 |
*/
|
141 |
function cptui_manage_post_types() {
|
142 |
|
143 |
+
$tab = ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) ? 'edit' : 'new'; // phpcs:ignore.
|
144 |
$tab_class = 'cptui-' . $tab;
|
145 |
$current = null;
|
146 |
?>
|
187 |
$ui = new cptui_admin_ui();
|
188 |
|
189 |
// Will only be set if we're already on the edit screen.
|
190 |
+
if ( ! empty( $post_types ) ) {
|
191 |
+
?>
|
192 |
<form id="cptui_select_post_type" method="post" action="<?php echo esc_url( cptui_get_post_form_action( $ui ) ); ?>">
|
193 |
<label for="post_type"><?php esc_html_e( 'Select: ', 'custom-post-type-ui' ); ?></label>
|
194 |
<?php
|
206 |
?>
|
207 |
<input type="submit" class="button-secondary" id="cptui_select_post_type_submit" name="cptui_select_post_type_submit" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_select', __( 'Select', 'custom-post-type-ui' ) ) ); ?>" />
|
208 |
</form>
|
209 |
+
<?php
|
210 |
|
211 |
/**
|
212 |
* Fires below the post type select input.
|
216 |
* @param string $value Current post type selected.
|
217 |
*/
|
218 |
do_action( 'cptui_below_post_type_select', $current['name'] );
|
219 |
+
}
|
220 |
+
?>
|
221 |
|
222 |
<form class="posttypesui" method="post" action="<?php echo esc_url( cptui_get_post_form_action( $ui ) ); ?>">
|
223 |
<div class="postbox-container">
|
238 |
<div class="main">
|
239 |
<table class="form-table cptui-table">
|
240 |
<?php
|
241 |
+
echo $ui->get_tr_start() . $ui->get_th_start(); // phpcs:ignore.
|
242 |
+
echo $ui->get_label( 'name', esc_html__( 'Post Type Slug', 'custom-post-type-ui' ) ); // phpcs:ignore.
|
243 |
+
echo $ui->get_required_span(); // phpcs:ignore.
|
244 |
|
245 |
if ( 'edit' === $tab ) {
|
246 |
echo '<p id="slugchanged" class="hidemessage">' . esc_html__( 'Slug has changed', 'custom-post-type-ui' ) . '<span class="dashicons dashicons-warning"></span></p>';
|
247 |
}
|
248 |
echo '<p id="slugexists" class="hidemessage">' . esc_html__( 'Slug already exists', 'custom-post-type-ui' ) . '<span class="dashicons dashicons-warning"></span></p>';
|
249 |
|
250 |
+
echo $ui->get_th_end() . $ui->get_td_start(); // phpcs:ignore.
|
251 |
+
|
252 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
253 |
+
[
|
254 |
+
'namearray' => 'cpt_custom_post_type',
|
255 |
+
'name' => 'name',
|
256 |
+
'textvalue' => isset( $current['name'] ) ? esc_attr( $current['name'] ) : '', // phpcs:ignore.
|
257 |
+
'maxlength' => '20',
|
258 |
+
'helptext' => esc_html__( 'The post type name/slug. Used for various queries for post type content.', 'custom-post-type-ui' ),
|
259 |
+
'required' => true,
|
260 |
+
'placeholder' => false,
|
261 |
+
'wrap' => false,
|
262 |
+
]
|
263 |
+
);
|
264 |
echo '<p class="cptui-slug-details">';
|
265 |
esc_html_e( 'Slugs should only contain alphanumeric, latin characters. Underscores should be used in place of spaces. Set "Custom Rewrite Slug" field to make slug use dashes for URLs.', 'custom-post-type-ui' );
|
266 |
echo '</p>';
|
271 |
echo '</p>';
|
272 |
|
273 |
echo '<div class="cptui-spacer">';
|
274 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
275 |
+
[
|
276 |
+
'checkvalue' => 'update_post_types',
|
277 |
+
'checked' => 'false',
|
278 |
+
'name' => 'update_post_types',
|
279 |
+
'namearray' => 'update_post_types',
|
280 |
+
'labeltext' => esc_html__( 'Migrate posts to newly renamed post type?', 'custom-post-type-ui' ),
|
281 |
+
'helptext' => false,
|
282 |
+
'default' => false,
|
283 |
+
'wrap' => false,
|
284 |
+
]
|
285 |
+
);
|
286 |
echo '</div>';
|
287 |
}
|
288 |
|
289 |
+
echo $ui->get_td_end(); echo $ui->get_tr_end(); // phpcs:ignore.
|
290 |
+
|
291 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
292 |
+
[
|
293 |
+
'namearray' => 'cpt_custom_post_type',
|
294 |
+
'name' => 'label',
|
295 |
+
'textvalue' => isset( $current['label'] ) ? esc_attr( $current['label'] ) : '', // phpcs:ignore.
|
296 |
+
'labeltext' => esc_html__( 'Plural Label', 'custom-post-type-ui' ),
|
297 |
+
'aftertext' => esc_html__( '(e.g. Movies)', 'custom-post-type-ui' ),
|
298 |
+
'helptext' => esc_html__( 'Used for the post type admin menu item.', 'custom-post-type-ui' ),
|
299 |
+
'required' => true,
|
300 |
+
]
|
301 |
+
);
|
302 |
+
|
303 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
304 |
+
[
|
305 |
+
'namearray' => 'cpt_custom_post_type',
|
306 |
+
'name' => 'singular_label',
|
307 |
+
'textvalue' => isset( $current['singular_label'] ) ? esc_attr( $current['singular_label'] ) : '', // phpcs:ignore.
|
308 |
+
'labeltext' => esc_html__( 'Singular Label', 'custom-post-type-ui' ),
|
309 |
+
'aftertext' => esc_html__( '(e.g. Movie)', 'custom-post-type-ui' ),
|
310 |
+
'helptext' => esc_html__( 'Used when a singular label is needed.', 'custom-post-type-ui' ),
|
311 |
+
'required' => true,
|
312 |
+
]
|
313 |
+
);
|
314 |
|
315 |
$link_text = ( 'new' === $tab ) ?
|
316 |
esc_html__( 'Populate additional labels based on chosen labels', 'custom-post-type-ui' ) :
|
317 |
esc_html__( 'Populate missing labels based on chosen labels', 'custom-post-type-ui' );
|
318 |
+
echo $ui->get_tr_end(); // phpcs:ignore.
|
319 |
+
echo $ui->get_th_start() . esc_html__( 'Auto-populate labels', 'custom-post-type-ui' ) . $ui->get_th_end(); // phpcs:ignore.
|
320 |
+
echo $ui->get_td_start(); // phpcs:ignore.
|
321 |
+
?>
|
322 |
+
<a href="#" id="auto-populate"><?php echo esc_html( $link_text ); ?></a> |
|
323 |
<a href="#" id="auto-clear"><?php esc_html_e( 'Clear labels', 'custom-post-type-ui' ); ?></a>
|
324 |
<?php
|
325 |
+
echo $ui->get_td_end() . $ui->get_tr_end(); // phpcs:ignore.
|
326 |
|
327 |
+
?>
|
328 |
</table>
|
329 |
<p class="submit">
|
|
|
|
|
330 |
<?php
|
331 |
+
wp_nonce_field( 'cptui_addedit_post_type_nonce_action', 'cptui_addedit_post_type_nonce_field' );
|
332 |
+
if ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) { // phpcs:ignore.
|
333 |
+
?>
|
334 |
+
<?php
|
335 |
|
336 |
+
/**
|
337 |
+
* Filters the text value to use on the button when editing.
|
338 |
+
*
|
339 |
+
* @since 1.0.0
|
340 |
+
*
|
341 |
+
* @param string $value Text to use for the button.
|
342 |
+
*/
|
343 |
+
?>
|
344 |
<input type="submit" class="button-primary" name="cpt_submit" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_edit', __( 'Save Post Type', 'custom-post-type-ui' ) ) ); ?>" />
|
345 |
+
<?php
|
346 |
|
347 |
+
/**
|
348 |
+
* Filters the text value to use on the button when deleting.
|
349 |
+
*
|
350 |
+
* @since 1.0.0
|
351 |
+
*
|
352 |
+
* @param string $value Text to use for the button.
|
353 |
+
*/
|
354 |
+
?>
|
355 |
<input type="submit" class="button-secondary cptui-delete-top" name="cpt_delete" id="cpt_submit_delete" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_delete', __( 'Delete Post Type', 'custom-post-type-ui' ) ) ); ?>" />
|
356 |
<?php } else { ?>
|
357 |
+
<?php
|
358 |
|
359 |
+
/**
|
360 |
+
* Filters the text value to use on the button when adding.
|
361 |
+
*
|
362 |
+
* @since 1.0.0
|
363 |
+
*
|
364 |
+
* @param string $value Text to use for the button.
|
365 |
+
*/
|
366 |
+
?>
|
367 |
<input type="submit" class="button-primary" name="cpt_submit" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_add', __( 'Add Post Type', 'custom-post-type-ui' ) ) ); ?>" />
|
368 |
+
<?php
|
369 |
+
}
|
370 |
|
371 |
+
if ( ! empty( $current ) ) {
|
372 |
+
?>
|
373 |
<input type="hidden" name="cpt_original" id="cpt_original" value="<?php echo esc_attr( $current['name'] ); ?>" />
|
374 |
+
<?php
|
375 |
+
}
|
376 |
|
377 |
+
// Used to check and see if we should prevent duplicate slugs.
|
378 |
+
?>
|
379 |
<input type="hidden" name="cpt_type_status" id="cpt_type_status" value="<?php echo esc_attr( $tab ); ?>" />
|
380 |
</p>
|
381 |
</div>
|
401 |
if ( isset( $current['description'] ) ) {
|
402 |
$current['description'] = stripslashes_deep( $current['description'] );
|
403 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
404 |
|
405 |
+
echo $ui->get_textarea_input( // phpcs:ignore.
|
406 |
+
[
|
407 |
+
'namearray' => 'cpt_custom_post_type',
|
408 |
+
'name' => 'description',
|
409 |
+
'rows' => '4',
|
410 |
+
'cols' => '40',
|
411 |
+
'textvalue' => isset( $current['description'] ) ? esc_textarea( $current['description'] ) : '', // phpcs:ignore.
|
412 |
+
'labeltext' => esc_html__( 'Post Type Description', 'custom-post-type-ui' ),
|
413 |
+
'helptext' => esc_html__( 'Perhaps describe what your custom post type is used for?', 'custom-post-type-ui' ),
|
414 |
+
]
|
415 |
+
);
|
416 |
+
|
417 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
418 |
+
[
|
419 |
+
'labeltext' => esc_html__( 'Menu Name', 'custom-post-type-ui' ),
|
420 |
+
'helptext' => esc_html__( 'Custom admin menu name for your custom post type.', 'custom-post-type-ui' ),
|
421 |
+
'namearray' => 'cpt_labels',
|
422 |
+
'name' => 'menu_name',
|
423 |
+
'textvalue' => isset( $current['labels']['menu_name'] ) ? esc_attr( $current['labels']['menu_name'] ) : '', // phpcs:ignore.
|
424 |
+
'aftertext' => esc_html__( '(e.g. My Movies)', 'custom-post-type-ui' ),
|
425 |
+
'data' => [
|
426 |
+
/* translators: Used for autofill */
|
427 |
+
'label' => sprintf( esc_attr__( 'My %s', 'custom-post-type-ui' ), 'item' ),
|
428 |
+
'plurality' => 'plural',
|
429 |
+
],
|
430 |
+
]
|
431 |
+
);
|
432 |
+
|
433 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
434 |
+
[
|
435 |
+
'labeltext' => esc_html__( 'All Items', 'custom-post-type-ui' ),
|
436 |
+
'helptext' => esc_html__( 'Used in the post type admin submenu.', 'custom-post-type-ui' ),
|
437 |
+
'namearray' => 'cpt_labels',
|
438 |
+
'name' => 'all_items',
|
439 |
+
'textvalue' => isset( $current['labels']['all_items'] ) ? esc_attr( $current['labels']['all_items'] ) : '', // phpcs:ignore.
|
440 |
+
'aftertext' => esc_html__( '(e.g. All Movies)', 'custom-post-type-ui' ),
|
441 |
+
'data' => [
|
442 |
+
/* translators: Used for autofill */
|
443 |
+
'label' => sprintf( esc_attr__( 'All %s', 'custom-post-type-ui' ), 'item' ),
|
444 |
+
'plurality' => 'plural',
|
445 |
+
],
|
446 |
+
]
|
447 |
+
);
|
448 |
+
|
449 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
450 |
+
[
|
451 |
+
'labeltext' => esc_html__( 'Add New', 'custom-post-type-ui' ),
|
452 |
+
'helptext' => esc_html__( 'Used in the post type admin submenu.', 'custom-post-type-ui' ),
|
453 |
+
'namearray' => 'cpt_labels',
|
454 |
+
'name' => 'add_new',
|
455 |
+
'textvalue' => isset( $current['labels']['add_new'] ) ? esc_attr( $current['labels']['add_new'] ) : '', // phpcs:ignore.
|
456 |
+
'aftertext' => esc_html__( '(e.g. Add New)', 'custom-post-type-ui' ),
|
457 |
+
'data' => [
|
458 |
+
/* translators: Used for autofill */
|
459 |
+
'label' => esc_attr__( 'Add new', 'custom-post-type-ui' ),
|
460 |
+
'plurality' => 'plural',
|
461 |
+
],
|
462 |
+
]
|
463 |
+
);
|
464 |
+
|
465 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
466 |
+
[
|
467 |
+
'labeltext' => esc_html__( 'Add New Item', 'custom-post-type-ui' ),
|
468 |
+
'helptext' => esc_html__( 'Used at the top of the post editor screen for a new post type post.', 'custom-post-type-ui' ),
|
469 |
+
'namearray' => 'cpt_labels',
|
470 |
+
'name' => 'add_new_item',
|
471 |
+
'textvalue' => isset( $current['labels']['add_new_item'] ) ? esc_attr( $current['labels']['add_new_item'] ) : '', // phpcs:ignore.
|
472 |
+
'aftertext' => esc_html__( '(e.g. Add New Movie)', 'custom-post-type-ui' ),
|
473 |
+
'data' => [
|
474 |
+
/* translators: Used for autofill */
|
475 |
+
'label' => sprintf( esc_attr__( 'Add new %s', 'custom-post-type-ui' ), 'item' ),
|
476 |
+
'plurality' => 'singular',
|
477 |
+
],
|
478 |
+
]
|
479 |
+
);
|
480 |
+
|
481 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
482 |
+
[
|
483 |
+
'labeltext' => esc_html__( 'Edit Item', 'custom-post-type-ui' ),
|
484 |
+
'helptext' => esc_html__( 'Used at the top of the post editor screen for an existing post type post.', 'custom-post-type-ui' ),
|
485 |
+
'namearray' => 'cpt_labels',
|
486 |
+
'name' => 'edit_item',
|
487 |
+
'textvalue' => isset( $current['labels']['edit_item'] ) ? esc_attr( $current['labels']['edit_item'] ) : '', // phpcs:ignore.
|
488 |
+
'aftertext' => esc_html__( '(e.g. Edit Movie)', 'custom-post-type-ui' ),
|
489 |
+
'data' => [
|
490 |
+
/* translators: Used for autofill */
|
491 |
+
'label' => sprintf( esc_attr__( 'Edit %s', 'custom-post-type-ui' ), 'item' ),
|
492 |
+
'plurality' => 'singular',
|
493 |
+
],
|
494 |
+
]
|
495 |
+
);
|
496 |
+
|
497 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
498 |
+
[
|
499 |
+
'labeltext' => esc_html__( 'New Item', 'custom-post-type-ui' ),
|
500 |
+
'helptext' => esc_html__( 'Post type label. Used in the admin menu for displaying post types.', 'custom-post-type-ui' ),
|
501 |
+
'namearray' => 'cpt_labels',
|
502 |
+
'name' => 'new_item',
|
503 |
+
'textvalue' => isset( $current['labels']['new_item'] ) ? esc_attr( $current['labels']['new_item'] ) : '', // phpcs:ignore.
|
504 |
+
'aftertext' => esc_html__( '(e.g. New Movie)', 'custom-post-type-ui' ),
|
505 |
+
'data' => [
|
506 |
+
/* translators: Used for autofill */
|
507 |
+
'label' => sprintf( esc_attr__( 'New %s', 'custom-post-type-ui' ), 'item' ),
|
508 |
+
'plurality' => 'singular',
|
509 |
+
],
|
510 |
+
]
|
511 |
+
);
|
512 |
+
|
513 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
514 |
+
[
|
515 |
+
'labeltext' => esc_html__( 'View Item', 'custom-post-type-ui' ),
|
516 |
+
'helptext' => esc_html__( 'Used in the admin bar when viewing editor screen for a published post in the post type.', 'custom-post-type-ui' ),
|
517 |
+
'namearray' => 'cpt_labels',
|
518 |
+
'name' => 'view_item',
|
519 |
+
'textvalue' => isset( $current['labels']['view_item'] ) ? esc_attr( $current['labels']['view_item'] ) : '', // phpcs:ignore.
|
520 |
+
'aftertext' => esc_html__( '(e.g. View Movie)', 'custom-post-type-ui' ),
|
521 |
+
'data' => [
|
522 |
+
/* translators: Used for autofill */
|
523 |
+
'label' => sprintf( esc_attr__( 'View %s', 'custom-post-type-ui' ), 'item' ),
|
524 |
+
'plurality' => 'singular',
|
525 |
+
],
|
526 |
+
]
|
527 |
+
);
|
528 |
+
|
529 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
530 |
+
[
|
531 |
+
'labeltext' => esc_html__( 'View Items', 'custom-post-type-ui' ),
|
532 |
+
'helptext' => esc_html__( 'Used in the admin bar when viewing editor screen for a published post in the post type.', 'custom-post-type-ui' ),
|
533 |
+
'namearray' => 'cpt_labels',
|
534 |
+
'name' => 'view_items',
|
535 |
+
'textvalue' => isset( $current['labels']['view_items'] ) ? esc_attr( $current['labels']['view_items'] ) : '', // phpcs:ignore.
|
536 |
+
'aftertext' => esc_html__( '(e.g. View Movies)', 'custom-post-type-ui' ),
|
537 |
+
'data' => [
|
538 |
+
/* translators: Used for autofill */
|
539 |
+
'label' => sprintf( esc_attr__( 'View %s', 'custom-post-type-ui' ), 'item' ),
|
540 |
+
'plurality' => 'plural',
|
541 |
+
],
|
542 |
+
]
|
543 |
+
);
|
544 |
+
|
545 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
546 |
+
[
|
547 |
+
'labeltext' => esc_html__( 'Search Item', 'custom-post-type-ui' ),
|
548 |
+
'helptext' => esc_html__( 'Used as the text for the search button on post type list screen.', 'custom-post-type-ui' ),
|
549 |
+
'namearray' => 'cpt_labels',
|
550 |
+
'name' => 'search_items',
|
551 |
+
'textvalue' => isset( $current['labels']['search_items'] ) ? esc_attr( $current['labels']['search_items'] ) : '', // phpcs:ignore.
|
552 |
+
'aftertext' => esc_html__( '(e.g. Search Movies)', 'custom-post-type-ui' ),
|
553 |
+
'data' => [
|
554 |
+
/* translators: Used for autofill */
|
555 |
+
'label' => sprintf( esc_attr__( 'Search %s', 'custom-post-type-ui' ), 'item' ),
|
556 |
+
'plurality' => 'plural',
|
557 |
+
],
|
558 |
+
]
|
559 |
+
);
|
560 |
+
|
561 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
562 |
+
[
|
563 |
+
'labeltext' => esc_html__( 'Not Found', 'custom-post-type-ui' ),
|
564 |
+
'helptext' => esc_html__( 'Used when there are no posts to display on the post type list screen.', 'custom-post-type-ui' ),
|
565 |
+
'namearray' => 'cpt_labels',
|
566 |
+
'name' => 'not_found',
|
567 |
+
'textvalue' => isset( $current['labels']['not_found'] ) ? esc_attr( $current['labels']['not_found'] ) : '', // phpcs:ignore.
|
568 |
+
'aftertext' => esc_html__( '(e.g. No Movies found)', 'custom-post-type-ui' ),
|
569 |
+
'data' => [
|
570 |
+
/* translators: Used for autofill */
|
571 |
+
'label' => sprintf( esc_attr__( 'No %s found', 'custom-post-type-ui' ), 'item' ),
|
572 |
+
'plurality' => 'plural',
|
573 |
+
],
|
574 |
+
]
|
575 |
+
);
|
576 |
+
|
577 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
578 |
+
[
|
579 |
+
'labeltext' => esc_html__( 'Not Found in Trash', 'custom-post-type-ui' ),
|
580 |
+
'helptext' => esc_html__( 'Used when there are no posts to display on the post type list trash screen.', 'custom-post-type-ui' ),
|
581 |
+
'namearray' => 'cpt_labels',
|
582 |
+
'name' => 'not_found_in_trash',
|
583 |
+
'textvalue' => isset( $current['labels']['not_found_in_trash'] ) ? esc_attr( $current['labels']['not_found_in_trash'] ) : '', // phpcs:ignore.
|
584 |
+
'aftertext' => esc_html__( '(e.g. No Movies found in Trash)', 'custom-post-type-ui' ),
|
585 |
+
'data' => [
|
586 |
+
/* translators: Used for autofill */
|
587 |
+
'label' => sprintf( esc_attr__( 'No %s found in trash', 'custom-post-type-ui' ), 'item' ),
|
588 |
+
'plurality' => 'plural',
|
589 |
+
],
|
590 |
+
]
|
591 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
592 |
|
593 |
+
// As of 1.4.0, this will register into `parent_item_colon` paramter upon registration and export.
|
594 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
595 |
+
[
|
596 |
+
'labeltext' => esc_html__( 'Parent', 'custom-post-type-ui' ),
|
597 |
+
'helptext' => esc_html__( 'Used for hierarchical types that need a colon.', 'custom-post-type-ui' ),
|
598 |
+
'namearray' => 'cpt_labels',
|
599 |
+
'name' => 'parent',
|
600 |
+
'textvalue' => isset( $current['labels']['parent'] ) ? esc_attr( $current['labels']['parent'] ) : '', // phpcs:ignore.
|
601 |
+
'aftertext' => esc_html__( '(e.g. Parent Movie:)', 'custom-post-type-ui' ),
|
602 |
+
'data' => [
|
603 |
+
/* translators: Used for autofill */
|
604 |
+
'label' => sprintf( esc_attr__( 'Parent %s:', 'custom-post-type-ui' ), 'item' ),
|
605 |
+
'plurality' => 'singular',
|
606 |
+
],
|
607 |
+
]
|
608 |
+
);
|
609 |
+
|
610 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
611 |
+
[
|
612 |
+
'labeltext' => esc_html__( 'Featured Image', 'custom-post-type-ui' ),
|
613 |
+
'helptext' => esc_html__( 'Used as the "Featured Image" phrase for the post type.', 'custom-post-type-ui' ),
|
614 |
+
'namearray' => 'cpt_labels',
|
615 |
+
'name' => 'featured_image',
|
616 |
+
'textvalue' => isset( $current['labels']['featured_image'] ) ? esc_attr( $current['labels']['featured_image'] ) : '', // phpcs:ignore.
|
617 |
+
'aftertext' => esc_html__( '(e.g. Featured image for this movie)', 'custom-post-type-ui' ),
|
618 |
+
'data' => [
|
619 |
+
/* translators: Used for autofill */
|
620 |
+
'label' => sprintf( esc_attr__( 'Featured image for this %s', 'custom-post-type-ui' ), 'item' ),
|
621 |
+
'plurality' => 'singular',
|
622 |
+
],
|
623 |
+
]
|
624 |
+
);
|
625 |
+
|
626 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
627 |
+
[
|
628 |
+
'labeltext' => esc_html__( 'Set Featured Image', 'custom-post-type-ui' ),
|
629 |
+
'helptext' => esc_html__( 'Used as the "Set featured image" phrase for the post type.', 'custom-post-type-ui' ),
|
630 |
+
'namearray' => 'cpt_labels',
|
631 |
+
'name' => 'set_featured_image',
|
632 |
+
'textvalue' => isset( $current['labels']['set_featured_image'] ) ? esc_attr( $current['labels']['set_featured_image'] ) : '', // phpcs:ignore.
|
633 |
+
'aftertext' => esc_html__( '(e.g. Set featured image for this movie)', 'custom-post-type-ui' ),
|
634 |
+
'data' => [
|
635 |
+
/* translators: Used for autofill */
|
636 |
+
'label' => sprintf( esc_attr__( 'Set featured image for this %s', 'custom-post-type-ui' ), 'item' ),
|
637 |
+
'plurality' => 'singular',
|
638 |
+
],
|
639 |
+
]
|
640 |
+
);
|
641 |
+
|
642 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
643 |
+
[
|
644 |
+
'labeltext' => esc_html__( 'Remove Featured Image', 'custom-post-type-ui' ),
|
645 |
+
'helptext' => esc_html__( 'Used as the "Remove featured image" phrase for the post type.', 'custom-post-type-ui' ),
|
646 |
+
'namearray' => 'cpt_labels',
|
647 |
+
'name' => 'remove_featured_image',
|
648 |
+
'textvalue' => isset( $current['labels']['remove_featured_image'] ) ? esc_attr( $current['labels']['remove_featured_image'] ) : '', // phpcs:ignore.
|
649 |
+
'aftertext' => esc_html__( '(e.g. Remove featured image for this movie)', 'custom-post-type-ui' ),
|
650 |
+
'data' => [
|
651 |
+
/* translators: Used for autofill */
|
652 |
+
'label' => sprintf( esc_attr__( 'Remove featured image for this %s', 'custom-post-type-ui' ), 'item' ),
|
653 |
+
'plurality' => 'singular',
|
654 |
+
],
|
655 |
+
]
|
656 |
+
);
|
657 |
+
|
658 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
659 |
+
[
|
660 |
+
'labeltext' => esc_html__( 'Use Featured Image', 'custom-post-type-ui' ),
|
661 |
+
'helptext' => esc_html__( 'Used as the "Use as featured image" phrase for the post type.', 'custom-post-type-ui' ),
|
662 |
+
'namearray' => 'cpt_labels',
|
663 |
+
'name' => 'use_featured_image',
|
664 |
+
'textvalue' => isset( $current['labels']['use_featured_image'] ) ? esc_attr( $current['labels']['use_featured_image'] ) : '', // phpcs:ignore.
|
665 |
+
'aftertext' => esc_html__( '(e.g. Use as featured image for this movie)', 'custom-post-type-ui' ),
|
666 |
+
'data' => [
|
667 |
+
/* translators: Used for autofill */
|
668 |
+
'label' => sprintf( esc_attr__( 'Use as featured image for this %s', 'custom-post-type-ui' ), 'item' ),
|
669 |
+
'plurality' => 'singular',
|
670 |
+
],
|
671 |
+
]
|
672 |
+
);
|
673 |
+
|
674 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
675 |
+
[
|
676 |
+
'labeltext' => esc_html__( 'Archives', 'custom-post-type-ui' ),
|
677 |
+
'helptext' => esc_html__( 'Post type archive label used in nav menus.', 'custom-post-type-ui' ),
|
678 |
+
'namearray' => 'cpt_labels',
|
679 |
+
'name' => 'archives',
|
680 |
+
'textvalue' => isset( $current['labels']['archives'] ) ? esc_attr( $current['labels']['archives'] ) : '', // phpcs:ignore.
|
681 |
+
'aftertext' => esc_html__( '(e.g. Movie archives)', 'custom-post-type-ui' ),
|
682 |
+
'data' => [
|
683 |
+
/* translators: Used for autofill */
|
684 |
+
'label' => sprintf( esc_attr__( '%s archives', 'custom-post-type-ui' ), 'item' ),
|
685 |
+
'plurality' => 'singular',
|
686 |
+
],
|
687 |
+
]
|
688 |
+
);
|
689 |
+
|
690 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
691 |
+
[
|
692 |
+
'labeltext' => esc_html__( 'Insert into item', 'custom-post-type-ui' ),
|
693 |
+
'helptext' => esc_html__( 'Used as the "Insert into post" or "Insert into page" phrase for the post type.', 'custom-post-type-ui' ),
|
694 |
+
'namearray' => 'cpt_labels',
|
695 |
+
'name' => 'insert_into_item',
|
696 |
+
'textvalue' => isset( $current['labels']['insert_into_item'] ) ? esc_attr( $current['labels']['insert_into_item'] ) : '', // phpcs:ignore.
|
697 |
+
'aftertext' => esc_html__( '(e.g. Insert into movie)', 'custom-post-type-ui' ),
|
698 |
+
'data' => [
|
699 |
+
/* translators: Used for autofill */
|
700 |
+
'label' => sprintf( esc_attr__( 'Insert into %s', 'custom-post-type-ui' ), 'item' ),
|
701 |
+
'plurality' => 'singular',
|
702 |
+
],
|
703 |
+
]
|
704 |
+
);
|
705 |
+
|
706 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
707 |
+
[
|
708 |
+
'labeltext' => esc_html__( 'Uploaded to this Item', 'custom-post-type-ui' ),
|
709 |
+
'helptext' => esc_html__( 'Used as the "Uploaded to this post" or "Uploaded to this page" phrase for the post type.', 'custom-post-type-ui' ),
|
710 |
+
'namearray' => 'cpt_labels',
|
711 |
+
'name' => 'uploaded_to_this_item',
|
712 |
+
'textvalue' => isset( $current['labels']['uploaded_to_this_item'] ) ? esc_attr( $current['labels']['uploaded_to_this_item'] ) : '', // phpcs:ignore.
|
713 |
+
'aftertext' => esc_html__( '(e.g. Uploaded to this movie)', 'custom-post-type-ui' ),
|
714 |
+
'data' => [
|
715 |
+
/* translators: Used for autofill */
|
716 |
+
'label' => sprintf( esc_attr__( 'Upload to this %s', 'custom-post-type-ui' ), 'item' ),
|
717 |
+
'plurality' => 'singular',
|
718 |
+
],
|
719 |
+
]
|
720 |
+
);
|
721 |
+
|
722 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
723 |
+
[
|
724 |
+
'labeltext' => esc_html__( 'Filter Items List', 'custom-post-type-ui' ),
|
725 |
+
'helptext' => esc_html__( 'Screen reader text for the filter links heading on the post type listing screen.', 'custom-post-type-ui' ),
|
726 |
+
'namearray' => 'cpt_labels',
|
727 |
+
'name' => 'filter_items_list',
|
728 |
+
'textvalue' => isset( $current['labels']['filter_items_list'] ) ? esc_attr( $current['labels']['filter_items_list'] ) : '', // phpcs:ignore.
|
729 |
+
'aftertext' => esc_html__( '(e.g. Filter movies list)', 'custom-post-type-ui' ),
|
730 |
+
'data' => [
|
731 |
+
/* translators: Used for autofill */
|
732 |
+
'label' => sprintf( esc_attr__( 'Filter %s list', 'custom-post-type-ui' ), 'item' ),
|
733 |
+
'plurality' => 'plural',
|
734 |
+
],
|
735 |
+
]
|
736 |
+
);
|
737 |
+
|
738 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
739 |
+
[
|
740 |
+
'labeltext' => esc_html__( 'Items List Navigation', 'custom-post-type-ui' ),
|
741 |
+
'helptext' => esc_html__( 'Screen reader text for the pagination heading on the post type listing screen.', 'custom-post-type-ui' ),
|
742 |
+
'namearray' => 'cpt_labels',
|
743 |
+
'name' => 'items_list_navigation',
|
744 |
+
'textvalue' => isset( $current['labels']['items_list_navigation'] ) ? esc_attr( $current['labels']['items_list_navigation'] ) : '', // phpcs:ignore.
|
745 |
+
'aftertext' => esc_html__( '(e.g. Movies list navigation)', 'custom-post-type-ui' ),
|
746 |
+
'data' => [
|
747 |
+
/* translators: Used for autofill */
|
748 |
+
'label' => sprintf( esc_attr__( '%s list navigation', 'custom-post-type-ui' ), 'item' ),
|
749 |
+
'plurality' => 'plural',
|
750 |
+
],
|
751 |
+
]
|
752 |
+
);
|
753 |
+
|
754 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
755 |
+
[
|
756 |
+
'labeltext' => esc_html__( 'Items List', 'custom-post-type-ui' ),
|
757 |
+
'helptext' => esc_html__( 'Screen reader text for the items list heading on the post type listing screen.', 'custom-post-type-ui' ),
|
758 |
+
'namearray' => 'cpt_labels',
|
759 |
+
'name' => 'items_list',
|
760 |
+
'textvalue' => isset( $current['labels']['items_list'] ) ? esc_attr( $current['labels']['items_list'] ) : '', // phpcs:ignore.
|
761 |
+
'aftertext' => esc_html__( '(e.g. Movies list)', 'custom-post-type-ui' ),
|
762 |
+
'data' => [
|
763 |
+
/* translators: Used for autofill */
|
764 |
+
'label' => sprintf( esc_attr__( '%s list', 'custom-post-type-ui' ), 'item' ),
|
765 |
+
'plurality' => 'plural',
|
766 |
+
],
|
767 |
+
]
|
768 |
+
);
|
769 |
+
|
770 |
+
echo $ui->get_text_input( // phpcs:ignore.Z
|
771 |
+
[
|
772 |
+
'labeltext' => esc_html__( 'Attributes', 'custom-post-type-ui' ),
|
773 |
+
'helptext' => esc_html__( 'Used for the title of the post attributes meta box.', 'custom-post-type-ui' ),
|
774 |
+
'namearray' => 'cpt_labels',
|
775 |
+
'name' => 'attributes',
|
776 |
+
'textvalue' => isset( $current['labels']['attributes'] ) ? esc_attr( $current['labels']['attributes'] ) : '', // phpcs:ignore.
|
777 |
+
'aftertext' => esc_html__( '(e.g. Movies Attributes)', 'custom-post-type-ui' ),
|
778 |
+
'data' => [
|
779 |
+
/* translators: Used for autofill */
|
780 |
+
'label' => sprintf( esc_attr__( '%s attributes', 'custom-post-type-ui' ), 'item' ),
|
781 |
+
'plurality' => 'plural',
|
782 |
+
],
|
783 |
+
]
|
784 |
+
);
|
785 |
+
|
786 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
787 |
+
[
|
788 |
+
'labeltext' => esc_html__( '"New" menu in admin bar', 'custom-post-type-ui' ),
|
789 |
+
'helptext' => esc_html__( 'Used in New in Admin menu bar. Default "singular name" label.', 'custom-post-type-ui' ),
|
790 |
+
'namearray' => 'cpt_labels',
|
791 |
+
'name' => 'name_admin_bar',
|
792 |
+
'textvalue' => isset( $current['labels']['name_admin_bar'] ) ? esc_attr( $current['labels']['name_admin_bar'] ) : '', // phpcs:ignore.
|
793 |
+
'aftertext' => esc_html__( '(e.g. Movie)', 'custom-post-type-ui' ),
|
794 |
+
'data' => [
|
795 |
+
/* translators: Used for autofill */
|
796 |
+
'label' => 'item', // not localizing because it's so isolated.
|
797 |
+
'plurality' => 'singular',
|
798 |
+
],
|
799 |
+
]
|
800 |
+
);
|
801 |
+
|
802 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
803 |
+
[
|
804 |
+
'labeltext' => esc_html__( 'Item Published', 'custom-post-type-ui' ),
|
805 |
+
'helptext' => esc_html__( 'Used in the editor notice after publishing a post. Default "Post published." / "Page published."', 'custom-post-type-ui' ),
|
806 |
+
'namearray' => 'cpt_labels',
|
807 |
+
'name' => 'item_published',
|
808 |
+
'textvalue' => isset( $current['labels']['item_published'] ) ? esc_attr( $current['labels']['item_published'] ) : '', // phpcs:ignore.
|
809 |
+
'aftertext' => esc_html__( '(e.g. Movie published)', 'custom-post-type-ui' ),
|
810 |
+
'data' => [
|
811 |
+
/* translators: Used for autofill */
|
812 |
+
'label' => sprintf( esc_attr__( '%s published', 'custom-post-type-ui' ), 'item' ),
|
813 |
+
'plurality' => 'singular',
|
814 |
+
],
|
815 |
+
]
|
816 |
+
);
|
817 |
+
|
818 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
819 |
+
[
|
820 |
+
'labeltext' => esc_html__( 'Item Published Privately', 'custom-post-type-ui' ),
|
821 |
+
'helptext' => esc_html__( 'Used in the editor notice after publishing a private post. Default "Post published privately." / "Page published privately."', 'custom-post-type-ui' ),
|
822 |
+
'namearray' => 'cpt_labels',
|
823 |
+
'name' => 'item_published_privately',
|
824 |
+
'textvalue' => isset( $current['labels']['item_published_privately'] ) ? esc_attr( $current['labels']['item_published_privately'] ) : '', // phpcs:ignore.
|
825 |
+
'aftertext' => esc_html__( '(e.g. Movie published privately.)', 'custom-post-type-ui' ),
|
826 |
+
'data' => [
|
827 |
+
/* translators: Used for autofill */
|
828 |
+
'label' => sprintf( esc_attr__( '%s published privately.', 'custom-post-type-ui' ), 'item' ),
|
829 |
+
'plurality' => 'singular',
|
830 |
+
],
|
831 |
+
]
|
832 |
+
);
|
833 |
+
|
834 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
835 |
+
[
|
836 |
+
'labeltext' => esc_html__( 'Item Reverted To Draft', 'custom-post-type-ui' ),
|
837 |
+
'helptext' => esc_html__( 'Used in the editor notice after reverting a post to draft. Default "Post reverted to draft." / "Page reverted to draft."', 'custom-post-type-ui' ),
|
838 |
+
'namearray' => 'cpt_labels',
|
839 |
+
'name' => 'item_reverted_to_draft',
|
840 |
+
'textvalue' => isset( $current['labels']['item_reverted_to_draft'] ) ? esc_attr( $current['labels']['item_reverted_to_draft'] ) : '', // phpcs:ignore.
|
841 |
+
'aftertext' => esc_html__( '(e.g. Movie reverted to draft)', 'custom-post-type-ui' ),
|
842 |
+
'data' => [
|
843 |
+
/* translators: Used for autofill */
|
844 |
+
'label' => sprintf( esc_attr__( '%s reverted to draft.', 'custom-post-type-ui' ), 'item' ),
|
845 |
+
'plurality' => 'singular',
|
846 |
+
],
|
847 |
+
]
|
848 |
+
);
|
849 |
+
|
850 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
851 |
+
[
|
852 |
+
'labeltext' => esc_html__( 'Item Scheduled', 'custom-post-type-ui' ),
|
853 |
+
'helptext' => esc_html__( 'Used in the editor notice after scheduling a post to be published at a later date. Default "Post scheduled." / "Page scheduled."', 'custom-post-type-ui' ),
|
854 |
+
'namearray' => 'cpt_labels',
|
855 |
+
'name' => 'item_scheduled',
|
856 |
+
'textvalue' => isset( $current['labels']['item_scheduled'] ) ? esc_attr( $current['labels']['item_scheduled'] ) : '', // phpcs:ignore.
|
857 |
+
'aftertext' => esc_html__( '(e.g. Movie scheduled)', 'custom-post-type-ui' ),
|
858 |
+
'data' => [
|
859 |
+
/* translators: Used for autofill */
|
860 |
+
'label' => sprintf( esc_attr__( '%s scheduled', 'custom-post-type-ui' ), 'item' ),
|
861 |
+
'plurality' => 'singular',
|
862 |
+
],
|
863 |
+
]
|
864 |
+
);
|
865 |
+
|
866 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
867 |
+
[
|
868 |
+
'labeltext' => esc_html__( 'Item Updated', 'custom-post-type-ui' ),
|
869 |
+
'helptext' => esc_html__( 'Used in the editor notice after updating a post. Default "Post updated." / "Page updated."', 'custom-post-type-ui' ),
|
870 |
+
'namearray' => 'cpt_labels',
|
871 |
+
'name' => 'item_updated',
|
872 |
+
'textvalue' => isset( $current['labels']['item_updated'] ) ? esc_attr( $current['labels']['item_updated'] ) : '', // phpcs:ignore.
|
873 |
+
'aftertext' => esc_html__( '(e.g. Movie updated)', 'custom-post-type-ui' ),
|
874 |
+
'data' => [
|
875 |
+
/* translators: Used for autofill */
|
876 |
+
'label' => sprintf( esc_attr__( '%s updated.', 'custom-post-type-ui' ), 'item' ),
|
877 |
+
'plurality' => 'singular',
|
878 |
+
],
|
879 |
+
]
|
880 |
+
);
|
881 |
+
|
882 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
883 |
+
[
|
884 |
+
'labeltext' => esc_html__( 'Add Title', 'custom-post-type-ui' ),
|
885 |
+
'helptext' => esc_html__( 'Placeholder text in the "title" input when creating a post. Not exportable.', 'custom-post-type-ui' ),
|
886 |
+
'namearray' => 'cpt_custom_post_type',
|
887 |
+
'name' => 'enter_title_here',
|
888 |
+
'textvalue' => isset( $current['enter_title_here'] ) ? esc_attr( $current['enter_title_here'] ) : '', // phpcs:ignore.
|
889 |
+
'aftertext' => esc_html__( '(e.g. Add Movie)', 'custom-post-type-ui' ),
|
890 |
+
'data' => [
|
891 |
+
/* translators: Used for autofill */
|
892 |
+
'label' => sprintf( esc_attr__( 'Add %s', 'custom-post-type-ui' ), 'item' ),
|
893 |
+
'plurality' => 'singular',
|
894 |
+
],
|
895 |
+
]
|
896 |
+
);
|
897 |
|
898 |
+
?>
|
899 |
</table>
|
900 |
</div>
|
901 |
</div>
|
918 |
<?php
|
919 |
$select = [
|
920 |
'options' => [
|
921 |
+
[
|
922 |
+
'attr' => '0',
|
923 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
924 |
+
],
|
925 |
+
[
|
926 |
+
'attr' => '1',
|
927 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
928 |
+
'default' => 'true',
|
929 |
+
],
|
930 |
],
|
931 |
];
|
932 |
+
|
933 |
+
$selected = isset( $current ) ? disp_boolean( $current['public'] ) : '';
|
934 |
$select['selected'] = ! empty( $selected ) ? $current['public'] : '';
|
935 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
936 |
+
[
|
937 |
+
'namearray' => 'cpt_custom_post_type',
|
938 |
+
'name' => 'public',
|
939 |
+
'labeltext' => esc_html__( 'Public', 'custom-post-type-ui' ),
|
940 |
+
'aftertext' => esc_html__( '(Custom Post Type UI default: true) Whether or not posts of this type should be shown in the admin UI and is publicly queryable.', 'custom-post-type-ui' ),
|
941 |
+
'selections' => $select, // phpcs:ignore.
|
942 |
+
]
|
943 |
+
);
|
944 |
|
945 |
$select = [
|
946 |
'options' => [
|
947 |
+
[
|
948 |
+
'attr' => '0',
|
949 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
950 |
+
],
|
951 |
+
[
|
952 |
+
'attr' => '1',
|
953 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
954 |
+
'default' => 'true',
|
955 |
+
],
|
956 |
],
|
957 |
];
|
958 |
+
|
959 |
+
$selected = isset( $current ) && ! empty( $current['publicly_queryable'] ) ? disp_boolean( $current['publicly_queryable'] ) : '';
|
960 |
$select['selected'] = ! empty( $selected ) ? $current['publicly_queryable'] : '';
|
961 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
962 |
+
[
|
963 |
+
'namearray' => 'cpt_custom_post_type',
|
964 |
+
'name' => 'publicly_queryable',
|
965 |
+
'labeltext' => esc_html__( 'Publicly Queryable', 'custom-post-type-ui' ),
|
966 |
+
'aftertext' => esc_html__( '(default: true) Whether or not queries can be performed on the front end as part of parse_request()', 'custom-post-type-ui' ),
|
967 |
+
'selections' => $select, // phpcs:ignore.
|
968 |
+
]
|
969 |
+
);
|
970 |
|
971 |
$select = [
|
972 |
'options' => [
|
973 |
+
[
|
974 |
+
'attr' => '0',
|
975 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
976 |
+
],
|
977 |
+
[
|
978 |
+
'attr' => '1',
|
979 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
980 |
+
'default' => 'true',
|
981 |
+
],
|
982 |
],
|
983 |
];
|
984 |
+
|
985 |
+
$selected = isset( $current ) ? disp_boolean( $current['show_ui'] ) : '';
|
986 |
$select['selected'] = ! empty( $selected ) ? $current['show_ui'] : '';
|
987 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
988 |
+
[
|
989 |
+
'namearray' => 'cpt_custom_post_type',
|
990 |
+
'name' => 'show_ui',
|
991 |
+
'labeltext' => esc_html__( 'Show UI', 'custom-post-type-ui' ),
|
992 |
+
'aftertext' => esc_html__( '(default: true) Whether or not to generate a default UI for managing this post type.', 'custom-post-type-ui' ),
|
993 |
+
'selections' => $select, // phpcs:ignore.
|
994 |
+
]
|
995 |
+
);
|
996 |
|
997 |
$select = [
|
998 |
'options' => [
|
999 |
+
[
|
1000 |
+
'attr' => '0',
|
1001 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
1002 |
+
],
|
1003 |
+
[
|
1004 |
+
'attr' => '1',
|
1005 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
1006 |
+
'default' => 'true',
|
1007 |
+
],
|
1008 |
],
|
1009 |
];
|
1010 |
+
|
1011 |
+
$selected = isset( $current ) && ! empty( $current['show_in_nav_menus'] ) ? disp_boolean( $current['show_in_nav_menus'] ) : '';
|
1012 |
$select['selected'] = ( ! empty( $selected ) && ! empty( $current['show_in_nav_menus'] ) ) ? $current['show_in_nav_menus'] : '';
|
1013 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1014 |
+
[
|
1015 |
+
'namearray' => 'cpt_custom_post_type',
|
1016 |
+
'name' => 'show_in_nav_menus',
|
1017 |
+
'labeltext' => esc_html__( 'Show in Nav Menus', 'custom-post-type-ui' ),
|
1018 |
+
'aftertext' => esc_html__( '(Custom Post Type UI default: true) Whether or not this post type is available for selection in navigation menus.', 'custom-post-type-ui' ),
|
1019 |
+
'selections' => $select, // phpcs:ignore.
|
1020 |
+
]
|
1021 |
+
);
|
1022 |
|
1023 |
$select = [
|
1024 |
'options' => [
|
1025 |
+
[
|
1026 |
+
'attr' => '0',
|
1027 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
1028 |
+
'default' => 'false',
|
1029 |
+
],
|
1030 |
+
[
|
1031 |
+
'attr' => '1',
|
1032 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
1033 |
+
],
|
1034 |
+
],
|
1035 |
];
|
1036 |
+
|
1037 |
$selected = ( isset( $current ) && ! empty( $current['delete_with_user'] ) ) ? disp_boolean( $current['delete_with_user'] ) : '';
|
1038 |
$select['selected'] = ( ! empty( $selected ) && ! empty( $current['delete_with_user'] ) ) ? $current['delete_with_user'] : '';
|
1039 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1040 |
+
[
|
1041 |
+
'namearray' => 'cpt_custom_post_type',
|
1042 |
+
'name' => 'delete_with_user',
|
1043 |
+
'labeltext' => esc_html__( 'Delete with user', 'custom-post-type-ui' ),
|
1044 |
+
'aftertext' => esc_html__( '(CPTUI default: false) Whether to delete posts of this type when deleting a user.', 'custom-post-type-ui' ),
|
1045 |
+
'selections' => $select, // phpcs:ignore.
|
1046 |
+
]
|
1047 |
+
);
|
1048 |
|
1049 |
$select = [
|
1050 |
'options' => [
|
1051 |
+
[
|
1052 |
+
'attr' => '0',
|
1053 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
1054 |
+
],
|
1055 |
+
[
|
1056 |
+
'attr' => '1',
|
1057 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
1058 |
+
'default' => 'true',
|
1059 |
+
],
|
1060 |
],
|
1061 |
];
|
1062 |
+
|
1063 |
+
$selected = ( isset( $current ) && ! empty( $current['show_in_rest'] ) ) ? disp_boolean( $current['show_in_rest'] ) : '';
|
1064 |
$select['selected'] = ( ! empty( $selected ) && ! empty( $current['show_in_rest'] ) ) ? $current['show_in_rest'] : '';
|
1065 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1066 |
+
[
|
1067 |
+
'namearray' => 'cpt_custom_post_type',
|
1068 |
+
'name' => 'show_in_rest',
|
1069 |
+
'labeltext' => esc_html__( 'Show in REST API', 'custom-post-type-ui' ),
|
1070 |
+
'aftertext' => esc_html__( '(Custom Post Type UI default: true) Whether or not to show this post type data in the WP REST API.', 'custom-post-type-ui' ),
|
1071 |
+
'selections' => $select, // phpcs:ignore.
|
1072 |
+
]
|
1073 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
1074 |
|
1075 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1076 |
+
[
|
1077 |
+
'namearray' => 'cpt_custom_post_type',
|
1078 |
+
'name' => 'rest_base',
|
1079 |
+
'labeltext' => esc_html__( 'REST API base slug', 'custom-post-type-ui' ),
|
1080 |
+
'aftertext' => esc_attr__( 'Slug to use in REST API URLs.', 'custom-post-type-ui' ),
|
1081 |
+
'textvalue' => isset( $current['rest_base'] ) ? esc_attr( $current['rest_base'] ) : '', // phpcs:ignore.
|
1082 |
+
]
|
1083 |
+
);
|
1084 |
|
1085 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1086 |
+
[
|
1087 |
+
'namearray' => 'cpt_custom_post_type',
|
1088 |
+
'name' => 'rest_controller_class',
|
1089 |
+
'labeltext' => esc_html__( 'REST API controller class', 'custom-post-type-ui' ),
|
1090 |
+
'aftertext' => esc_attr__( '(default: WP_REST_Posts_Controller) Custom controller to use instead of WP_REST_Posts_Controller.', 'custom-post-type-ui' ),
|
1091 |
+
'textvalue' => isset( $current['rest_controller_class'] ) ? esc_attr( $current['rest_controller_class'] ) : '', // phpcs:ignore.
|
1092 |
+
]
|
1093 |
+
);
|
1094 |
|
1095 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1096 |
+
[
|
1097 |
+
'namearray' => 'cpt_custom_post_type',
|
1098 |
+
'name' => 'rest_namespace',
|
1099 |
+
'labeltext' => esc_html__( 'REST API namespace', 'custom-post-type-ui' ),
|
1100 |
+
'aftertext' => esc_attr__( '(default: wp/v2) To change the namespace URL of REST API route.', 'custom-post-type-ui' ),
|
1101 |
+
'textvalue' => isset( $current['rest_namespace'] ) ? esc_attr( $current['rest_namespace'] ) : '', // phpcs:ignore.
|
1102 |
+
]
|
1103 |
+
);
|
1104 |
+
|
1105 |
+
echo $ui->get_tr_start() . $ui->get_th_start(); // phpcs:ignore.
|
1106 |
+
echo $ui->get_label( 'has_archive', esc_html__( 'Has Archive', 'custom-post-type-ui' ) ); // phpcs:ignore.
|
1107 |
+
echo $ui->get_p( esc_html__( 'If left blank, the archive slug will default to the post type slug.', 'custom-post-type-ui' ) ); // phpcs:ignore.
|
1108 |
+
echo $ui->get_th_end() . $ui->get_td_start(); // phpcs:ignore.
|
1109 |
|
1110 |
$select = [
|
1111 |
'options' => [
|
1112 |
+
[
|
1113 |
+
'attr' => '0',
|
1114 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
1115 |
+
'default' => 'true',
|
1116 |
+
],
|
1117 |
+
[
|
1118 |
+
'attr' => '1',
|
1119 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
1120 |
+
],
|
1121 |
],
|
1122 |
];
|
1123 |
+
|
1124 |
+
$selected = isset( $current ) ? disp_boolean( $current['has_archive'] ) : '';
|
1125 |
$select['selected'] = ! empty( $selected ) ? $current['has_archive'] : '';
|
1126 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1127 |
+
[
|
1128 |
+
'namearray' => 'cpt_custom_post_type',
|
1129 |
+
'name' => 'has_archive',
|
1130 |
+
'aftertext' => esc_html__( '(default: false) Whether or not the post type will have a post type archive URL.', 'custom-post-type-ui' ),
|
1131 |
+
'selections' => $select, // phpcs:ignore.
|
1132 |
+
'wrap' => false,
|
1133 |
+
]
|
1134 |
+
);
|
1135 |
|
1136 |
echo '<br/>';
|
1137 |
|
1138 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1139 |
+
[
|
1140 |
+
'namearray' => 'cpt_custom_post_type',
|
1141 |
+
'name' => 'has_archive_string',
|
1142 |
+
'textvalue' => isset( $current['has_archive_string'] ) ? esc_attr( $current['has_archive_string'] ) : '', // phpcs:ignore.
|
1143 |
+
'aftertext' => esc_attr__( 'Slug to be used for archive URL.', 'custom-post-type-ui' ),
|
1144 |
+
'helptext_after' => true,
|
1145 |
+
'wrap' => false,
|
1146 |
+
]
|
1147 |
+
);
|
1148 |
+
echo $ui->get_td_end() . $ui->get_tr_end(); // phpcs:ignore.
|
1149 |
|
1150 |
$select = [
|
1151 |
'options' => [
|
1152 |
+
[
|
1153 |
+
'attr' => '0',
|
1154 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
1155 |
+
'default' => 'true',
|
1156 |
+
],
|
1157 |
+
[
|
1158 |
+
'attr' => '1',
|
1159 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
1160 |
+
],
|
1161 |
],
|
1162 |
];
|
1163 |
+
|
1164 |
+
$selected = isset( $current ) ? disp_boolean( $current['exclude_from_search'] ) : '';
|
1165 |
$select['selected'] = ! empty( $selected ) ? $current['exclude_from_search'] : '';
|
1166 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1167 |
+
[
|
1168 |
+
'namearray' => 'cpt_custom_post_type',
|
1169 |
+
'name' => 'exclude_from_search',
|
1170 |
+
'labeltext' => esc_html__( 'Exclude From Search', 'custom-post-type-ui' ),
|
1171 |
+
'aftertext' => esc_html__( '(default: false) Whether or not to exclude posts with this post type from front end search results. This also excludes from taxonomy term archives.', 'custom-post-type-ui' ),
|
1172 |
+
'selections' => $select, // phpcs:ignore.
|
1173 |
+
]
|
1174 |
+
);
|
1175 |
+
|
1176 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1177 |
+
[
|
1178 |
+
'namearray' => 'cpt_custom_post_type',
|
1179 |
+
'name' => 'capability_type',
|
1180 |
+
'textvalue' => isset( $current['capability_type'] ) ? esc_attr( $current['capability_type'] ) : 'post', // phpcs:ignore.
|
1181 |
+
'labeltext' => esc_html__( 'Capability Type', 'custom-post-type-ui' ),
|
1182 |
+
'helptext' => esc_html__( 'The post type to use for checking read, edit, and delete capabilities. A comma-separated second value can be used for plural version.', 'custom-post-type-ui' ),
|
1183 |
+
]
|
1184 |
+
);
|
1185 |
|
1186 |
$select = [
|
1187 |
'options' => [
|
1188 |
+
[
|
1189 |
+
'attr' => '0',
|
1190 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
1191 |
+
'default' => 'true',
|
1192 |
+
],
|
1193 |
+
[
|
1194 |
+
'attr' => '1',
|
1195 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
1196 |
+
],
|
1197 |
],
|
1198 |
];
|
1199 |
+
|
1200 |
+
$selected = isset( $current ) ? disp_boolean( $current['hierarchical'] ) : '';
|
1201 |
$select['selected'] = ! empty( $selected ) ? $current['hierarchical'] : '';
|
1202 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1203 |
+
[
|
1204 |
+
'namearray' => 'cpt_custom_post_type',
|
1205 |
+
'name' => 'hierarchical',
|
1206 |
+
'labeltext' => esc_html__( 'Hierarchical', 'custom-post-type-ui' ),
|
1207 |
+
'aftertext' => esc_html__( '(default: false) Whether or not the post type can have parent-child relationships. At least one published content item is needed in order to select a parent.', 'custom-post-type-ui' ),
|
1208 |
+
'selections' => $select, // phpcs:ignore.
|
1209 |
+
]
|
1210 |
+
);
|
1211 |
|
1212 |
$select = [
|
1213 |
'options' => [
|
1214 |
+
[
|
1215 |
+
'attr' => '0',
|
1216 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
1217 |
+
'default' => 'false',
|
1218 |
+
],
|
1219 |
+
[
|
1220 |
+
'attr' => '1',
|
1221 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
1222 |
+
],
|
1223 |
],
|
1224 |
];
|
1225 |
+
|
1226 |
$selected = isset( $current ) ? disp_boolean( $current['can_export'] ) : '';
|
1227 |
$select['selected'] = ! empty( $selected ) ? $current['can_export'] : '';
|
1228 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1229 |
+
[
|
1230 |
+
'namearray' => 'cpt_custom_post_type',
|
1231 |
+
'name' => 'can_export',
|
1232 |
+
'labeltext' => esc_html__( 'Can Export', 'custom-post-type-ui' ),
|
1233 |
+
'aftertext' => esc_html__( '(default: false) Can this post_type be exported.', 'custom-post-type-ui' ),
|
1234 |
+
'selections' => $select, // phpcs:ignore.
|
1235 |
+
]
|
1236 |
+
);
|
1237 |
|
1238 |
$select = [
|
1239 |
'options' => [
|
1240 |
+
[
|
1241 |
+
'attr' => '0',
|
1242 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
1243 |
+
],
|
1244 |
+
[
|
1245 |
+
'attr' => '1',
|
1246 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
1247 |
+
'default' => 'true',
|
1248 |
+
],
|
1249 |
],
|
1250 |
];
|
1251 |
+
|
1252 |
+
$selected = isset( $current ) ? disp_boolean( $current['rewrite'] ) : '';
|
1253 |
$select['selected'] = ! empty( $selected ) ? $current['rewrite'] : '';
|
1254 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1255 |
+
[
|
1256 |
+
'namearray' => 'cpt_custom_post_type',
|
1257 |
+
'name' => 'rewrite',
|
1258 |
+
'labeltext' => esc_html__( 'Rewrite', 'custom-post-type-ui' ),
|
1259 |
+
'aftertext' => esc_html__( '(default: true) Whether or not WordPress should use rewrites for this post type.', 'custom-post-type-ui' ),
|
1260 |
+
'selections' => $select, // phpcs:ignore.
|
1261 |
+
]
|
1262 |
+
);
|
1263 |
+
|
1264 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1265 |
+
[
|
1266 |
+
'namearray' => 'cpt_custom_post_type',
|
1267 |
+
'name' => 'rewrite_slug',
|
1268 |
+
'textvalue' => isset( $current['rewrite_slug'] ) ? esc_attr( $current['rewrite_slug'] ) : '', // phpcs:ignore.
|
1269 |
+
'labeltext' => esc_html__( 'Custom Rewrite Slug', 'custom-post-type-ui' ),
|
1270 |
+
'aftertext' => esc_attr__( '(default: post type slug)', 'custom-post-type-ui' ),
|
1271 |
+
'helptext' => esc_html__( 'Custom post type slug to use instead of the default.', 'custom-post-type-ui' ),
|
1272 |
+
]
|
1273 |
+
);
|
1274 |
|
1275 |
$select = [
|
1276 |
'options' => [
|
1277 |
+
[
|
1278 |
+
'attr' => '0',
|
1279 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
1280 |
+
],
|
1281 |
+
[
|
1282 |
+
'attr' => '1',
|
1283 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
1284 |
+
'default' => 'true',
|
1285 |
+
],
|
1286 |
],
|
1287 |
];
|
1288 |
+
|
1289 |
+
$selected = isset( $current ) ? disp_boolean( $current['rewrite_withfront'] ) : '';
|
1290 |
$select['selected'] = ! empty( $selected ) ? $current['rewrite_withfront'] : '';
|
1291 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1292 |
+
[
|
1293 |
+
'namearray' => 'cpt_custom_post_type',
|
1294 |
+
'name' => 'rewrite_withfront',
|
1295 |
+
'labeltext' => esc_html__( 'With Front', 'custom-post-type-ui' ),
|
1296 |
+
'aftertext' => esc_html__( '(default: true) Should the permalink structure be prepended with the front base. (example: if your permalink structure is /blog/, then your links will be: false->/news/, true->/blog/news/).', 'custom-post-type-ui' ),
|
1297 |
+
'selections' => $select, // phpcs:ignore.
|
1298 |
+
]
|
1299 |
+
);
|
1300 |
|
1301 |
$select = [
|
1302 |
'options' => [
|
1303 |
+
[
|
1304 |
+
'attr' => '0',
|
1305 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
1306 |
+
],
|
1307 |
+
[
|
1308 |
+
'attr' => '1',
|
1309 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
1310 |
+
'default' => 'true',
|
1311 |
+
],
|
1312 |
],
|
1313 |
];
|
1314 |
+
|
1315 |
+
$selected = isset( $current ) ? disp_boolean( $current['query_var'] ) : '';
|
1316 |
$select['selected'] = ! empty( $selected ) ? $current['query_var'] : '';
|
1317 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1318 |
+
[
|
1319 |
+
'namearray' => 'cpt_custom_post_type',
|
1320 |
+
'name' => 'query_var',
|
1321 |
+
'labeltext' => esc_html__( 'Query Var', 'custom-post-type-ui' ),
|
1322 |
+
'aftertext' => esc_html__( '(default: true) Sets the query_var key for this post type.', 'custom-post-type-ui' ),
|
1323 |
+
'selections' => $select, // phpcs:ignore.
|
1324 |
+
]
|
1325 |
+
);
|
1326 |
+
|
1327 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1328 |
+
[
|
1329 |
+
'namearray' => 'cpt_custom_post_type',
|
1330 |
+
'name' => 'query_var_slug',
|
1331 |
+
'textvalue' => isset( $current['query_var_slug'] ) ? esc_attr( $current['query_var_slug'] ) : '', // phpcs:ignore.
|
1332 |
+
'labeltext' => esc_html__( 'Custom Query Var Slug', 'custom-post-type-ui' ),
|
1333 |
+
'aftertext' => esc_attr__( '(default: post type slug) Query var needs to be true to use.', 'custom-post-type-ui' ),
|
1334 |
+
'helptext' => esc_html__( 'Custom query var slug to use instead of the default.', 'custom-post-type-ui' ),
|
1335 |
+
]
|
1336 |
+
);
|
1337 |
+
|
1338 |
+
echo $ui->get_tr_start() . $ui->get_th_start(); // phpcs:ignore.
|
1339 |
+
echo $ui->get_label( 'menu_position', esc_html__( 'Menu Position', 'custom-post-type-ui' ) ); // phpcs:ignore.
|
1340 |
+
echo $ui->get_p( // phpcs:ignore.
|
1341 |
sprintf(
|
1342 |
+
// phpcs:ignore.
|
1343 |
esc_html__(
|
1344 |
'See %s in the "menu_position" section. Range of 5-100',
|
1345 |
'custom-post-type-ui'
|
1351 |
)
|
1352 |
);
|
1353 |
|
1354 |
+
echo $ui->get_th_end() . $ui->get_td_start(); // phpcs:ignore.
|
1355 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1356 |
+
[
|
1357 |
+
'namearray' => 'cpt_custom_post_type',
|
1358 |
+
'name' => 'menu_position',
|
1359 |
+
'textvalue' => isset( $current['menu_position'] ) ? esc_attr( $current['menu_position'] ) : '', // phpcs:ignore.
|
1360 |
+
'helptext' => esc_html__( 'The position in the menu order the post type should appear. show_in_menu must be true.', 'custom-post-type-ui' ),
|
1361 |
+
'wrap' => false,
|
1362 |
+
]
|
1363 |
+
);
|
1364 |
+
echo $ui->get_td_end() . $ui->get_tr_end(); // phpcs:ignore.
|
1365 |
+
|
1366 |
+
echo $ui->get_tr_start() . $ui->get_th_start(); // phpcs:ignore.
|
1367 |
+
echo $ui->get_label( 'show_in_menu', esc_html__( 'Show in Menu', 'custom-post-type-ui' ) ); // phpcs:ignore.
|
1368 |
+
echo $ui->get_p( esc_html__( '"Show UI" must be "true". If an existing top level page such as "tools.php" is indicated for second input, post type will be sub menu of that.', 'custom-post-type-ui' ) ); // phpcs:ignore.
|
1369 |
+
echo $ui->get_th_end() . $ui->get_td_start(); // phpcs:ignore.
|
1370 |
|
1371 |
$select = [
|
1372 |
'options' => [
|
1373 |
+
[
|
1374 |
+
'attr' => '0',
|
1375 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
1376 |
+
],
|
1377 |
+
[
|
1378 |
+
'attr' => '1',
|
1379 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
1380 |
+
'default' => 'true',
|
1381 |
+
],
|
1382 |
],
|
1383 |
];
|
1384 |
+
|
1385 |
+
$selected = isset( $current ) ? disp_boolean( $current['show_in_menu'] ) : '';
|
1386 |
$select['selected'] = ! empty( $selected ) ? $current['show_in_menu'] : '';
|
1387 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1388 |
+
[
|
1389 |
+
'namearray' => 'cpt_custom_post_type',
|
1390 |
+
'name' => 'show_in_menu',
|
1391 |
+
'aftertext' => esc_html__( '(default: true) Whether or not to show the post type in the admin menu and where to show that menu.', 'custom-post-type-ui' ),
|
1392 |
+
'selections' => $select, // phpcs:ignore.
|
1393 |
+
'wrap' => false,
|
1394 |
+
]
|
1395 |
+
);
|
1396 |
|
1397 |
echo '<br/>';
|
1398 |
|
1399 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1400 |
+
[
|
1401 |
+
'namearray' => 'cpt_custom_post_type',
|
1402 |
+
'name' => 'show_in_menu_string',
|
1403 |
+
'textvalue' => isset( $current['show_in_menu_string'] ) ? esc_attr( $current['show_in_menu_string'] ) : '', // phpcs:ignore.
|
1404 |
+
'helptext' => esc_attr__( 'The top-level admin menu page file name for which the post type should be in the sub menu of.', 'custom-post-type-ui' ),
|
1405 |
+
'helptext_after' => true,
|
1406 |
+
'wrap' => false,
|
1407 |
+
]
|
1408 |
+
);
|
1409 |
+
echo $ui->get_td_end() . $ui->get_tr_end(); // phpcs:ignore.
|
1410 |
|
1411 |
+
echo $ui->get_tr_start() . $ui->get_th_start(); // phpcs:ignore.
|
1412 |
|
1413 |
$current_menu_icon = isset( $current['menu_icon'] ) ? esc_attr( $current['menu_icon'] ) : '';
|
1414 |
+
echo $ui->get_menu_icon_preview( $current_menu_icon ); // phpcs:ignore.
|
1415 |
+
echo $ui->get_label( 'menu_icon', esc_html__( 'Menu Icon', 'custom-post-type-ui' ) ); // phpcs:ignore.
|
1416 |
+
echo $ui->get_th_end() . $ui->get_td_start(); // phpcs:ignore.
|
1417 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1418 |
+
[
|
1419 |
+
'namearray' => 'cpt_custom_post_type',
|
1420 |
+
'name' => 'menu_icon',
|
1421 |
+
'textvalue' => $current_menu_icon, // phpcs:ignore.
|
1422 |
+
'aftertext' => esc_attr__( '(Full URL for icon or Dashicon class)', 'custom-post-type-ui' ),
|
1423 |
+
'helptext' => sprintf(
|
1424 |
+
esc_html__( 'Image URL or %sDashicon class name%s to use for icon. Custom image should be 20px by 20px.', 'custom-post-type-ui' ), // phpcs:ignore.
|
1425 |
+
'<a href="https://developer.wordpress.org/resource/dashicons/" target="_blank" rel="noopener">',
|
1426 |
+
'</a>'
|
1427 |
+
),
|
1428 |
+
'wrap' => false,
|
1429 |
+
]
|
1430 |
+
);
|
1431 |
|
1432 |
echo '<div class="cptui-spacer">';
|
1433 |
|
1434 |
+
echo $ui->get_button( // phpcs:ignore.
|
1435 |
+
[
|
1436 |
+
'id' => 'cptui_choose_dashicon',
|
1437 |
+
'classes' => 'dashicons-picker',
|
1438 |
+
'textvalue' => esc_attr__( 'Choose dashicon', 'custom-post-type-ui' ),
|
1439 |
+
]
|
1440 |
+
);
|
1441 |
|
1442 |
echo '<div class="cptui-spacer">';
|
1443 |
|
1444 |
+
echo $ui->get_button( // phpcs:ignore.
|
1445 |
+
[
|
1446 |
+
'id' => 'cptui_choose_icon',
|
1447 |
+
'textvalue' => esc_attr__( 'Choose image icon', 'custom-post-type-ui' ),
|
1448 |
+
]
|
1449 |
+
);
|
1450 |
echo '</div>';
|
1451 |
|
1452 |
+
echo $ui->get_td_end() . $ui->get_tr_end(); // phpcs:ignore.
|
1453 |
|
1454 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1455 |
+
[
|
1456 |
+
'namearray' => 'cpt_custom_post_type',
|
1457 |
+
'name' => 'register_meta_box_cb',
|
1458 |
+
'textvalue' => isset( $current['register_meta_box_cb'] ) ? esc_attr( $current['register_meta_box_cb'] ) : '', // phpcs:ignore.
|
1459 |
+
'labeltext' => esc_html__( 'Metabox callback', 'custom-post-type-ui' ),
|
1460 |
+
'helptext' => esc_html__( 'Provide a callback function that sets up the meta boxes for the edit form. Do `remove_meta_box()` and `add_meta_box()` calls in the callback. Default null.', 'custom-post-type-ui' ),
|
1461 |
+
]
|
1462 |
+
);
|
1463 |
|
1464 |
+
echo $ui->get_tr_start() . $ui->get_th_start() . esc_html__( 'Supports', 'custom-post-type-ui' ); // phpcs:ignore.
|
1465 |
|
1466 |
+
echo $ui->get_p( esc_html__( 'Add support for various available post editor features on the right. A checked value means the post type feature is supported.', 'custom-post-type-ui' ) ); // phpcs:ignore.
|
1467 |
|
1468 |
+
echo $ui->get_p( esc_html__( 'Use the "None" option to explicitly set "supports" to false.', 'custom-post-type-ui' ) ); // phpcs:ignore.
|
1469 |
|
1470 |
+
echo $ui->get_p( esc_html__( 'Featured images and Post Formats need theme support added, to be used.', 'custom-post-type-ui' ) ); // phpcs:ignore.
|
1471 |
|
1472 |
+
echo $ui->get_p(
|
1473 |
+
sprintf(
|
1474 |
+
'<a href="%s" target="_blank" rel="noopener">%s</a><br/><a href="%s" target="_blank" rel="noopener">%s</a>',
|
1475 |
+
esc_url( 'https://developer.wordpress.org/reference/functions/add_theme_support/#post-thumbnails' ),
|
1476 |
+
/* translators: Link text for WordPress Developer site. */
|
1477 |
+
esc_html__( 'Theme support for featured images', 'custom-post-type-ui' ),
|
1478 |
+
esc_url( 'https://wordpress.org/support/article/post-formats/' ),
|
1479 |
+
/* translators: Link text for WordPress Developer site. */
|
1480 |
+
esc_html__( 'Theme support for post formats', 'custom-post-type-ui' )
|
1481 |
+
)
|
1482 |
+
);
|
1483 |
+
|
1484 |
+
echo $ui->get_th_end() . $ui->get_td_start() . $ui->get_fieldset_start(); // phpcs:ignore.
|
1485 |
|
1486 |
+
echo $ui->get_legend_start() . esc_html__( 'Post type options', 'custom-post-type-ui' ) . $ui->get_legend_end(); // phpcs:ignore.
|
1487 |
+
|
1488 |
+
$title_checked = ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'title', $current['supports'] ) ) ? 'true' : 'false'; // phpcs:ignore.
|
1489 |
if ( 'new' === $tab ) {
|
1490 |
$title_checked = 'true';
|
1491 |
}
|
1492 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
1493 |
+
[
|
1494 |
+
'checkvalue' => 'title',
|
1495 |
+
'checked' => $title_checked, // phpcs:ignore.
|
1496 |
+
'name' => 'title',
|
1497 |
+
'namearray' => 'cpt_supports',
|
1498 |
+
'textvalue' => 'title',
|
1499 |
+
'labeltext' => esc_html__( 'Title', 'custom-post-type-ui' ),
|
1500 |
+
'default' => true,
|
1501 |
+
'wrap' => false,
|
1502 |
+
]
|
1503 |
+
);
|
1504 |
+
|
1505 |
+
$editor_checked = ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'editor', $current['supports'] ) ) ? 'true' : 'false'; // phpcs:ignore.
|
1506 |
if ( 'new' === $tab ) {
|
1507 |
$editor_checked = 'true';
|
1508 |
}
|
1509 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
1510 |
+
[
|
1511 |
+
'checkvalue' => 'editor',
|
1512 |
+
'checked' => $editor_checked, // phpcs:ignore.
|
1513 |
+
'name' => 'editor',
|
1514 |
+
'namearray' => 'cpt_supports',
|
1515 |
+
'textvalue' => 'editor',
|
1516 |
+
'labeltext' => esc_html__( 'Editor', 'custom-post-type-ui' ),
|
1517 |
+
'default' => true,
|
1518 |
+
'wrap' => false,
|
1519 |
+
]
|
1520 |
+
);
|
1521 |
+
|
1522 |
+
$thumb_checked = ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'thumbnail', $current['supports'] ) ) ? 'true' : 'false'; // phpcs:ignore.
|
1523 |
if ( 'new' === $tab ) {
|
1524 |
$thumb_checked = 'true';
|
1525 |
}
|
1526 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
1527 |
+
[
|
1528 |
+
'checkvalue' => 'thumbnail',
|
1529 |
+
'checked' => $thumb_checked, // phpcs:ignore.
|
1530 |
+
'name' => 'thumbnail',
|
1531 |
+
'namearray' => 'cpt_supports',
|
1532 |
+
'textvalue' => 'thumbnail',
|
1533 |
+
'labeltext' => esc_html__( 'Featured Image', 'custom-post-type-ui' ),
|
1534 |
+
'default' => true,
|
1535 |
+
'wrap' => false,
|
1536 |
+
]
|
1537 |
+
);
|
1538 |
+
|
1539 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
1540 |
+
[
|
1541 |
+
'checkvalue' => 'excerpt',
|
1542 |
+
'checked' => ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'excerpt', $current['supports'] ) ) ? 'true' : 'false', // phpcs:ignore.
|
1543 |
+
'name' => 'excerpts',
|
1544 |
+
'namearray' => 'cpt_supports',
|
1545 |
+
'textvalue' => 'excerpt',
|
1546 |
+
'labeltext' => esc_html__( 'Excerpt', 'custom-post-type-ui' ),
|
1547 |
+
'default' => true,
|
1548 |
+
'wrap' => false,
|
1549 |
+
]
|
1550 |
+
);
|
1551 |
+
|
1552 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
1553 |
+
[
|
1554 |
+
'checkvalue' => 'trackbacks',
|
1555 |
+
'checked' => ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'trackbacks', $current['supports'] ) ) ? 'true' : 'false', // phpcs:ignore.
|
1556 |
+
'name' => 'trackbacks',
|
1557 |
+
'namearray' => 'cpt_supports',
|
1558 |
+
'textvalue' => 'trackbacks',
|
1559 |
+
'labeltext' => esc_html__( 'Trackbacks', 'custom-post-type-ui' ),
|
1560 |
+
'default' => true,
|
1561 |
+
'wrap' => false,
|
1562 |
+
]
|
1563 |
+
);
|
1564 |
+
|
1565 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
1566 |
+
[
|
1567 |
+
'checkvalue' => 'custom-fields',
|
1568 |
+
'checked' => ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'custom-fields', $current['supports'] ) ) ? 'true' : 'false', // phpcs:ignore.
|
1569 |
+
'name' => 'custom-fields',
|
1570 |
+
'namearray' => 'cpt_supports',
|
1571 |
+
'textvalue' => 'custom-fields',
|
1572 |
+
'labeltext' => esc_html__( 'Custom Fields', 'custom-post-type-ui' ),
|
1573 |
+
'default' => true,
|
1574 |
+
'wrap' => false,
|
1575 |
+
]
|
1576 |
+
);
|
1577 |
+
|
1578 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
1579 |
+
[
|
1580 |
+
'checkvalue' => 'comments',
|
1581 |
+
'checked' => ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'comments', $current['supports'] ) ) ? 'true' : 'false', // phpcs:ignore.
|
1582 |
+
'name' => 'comments',
|
1583 |
+
'namearray' => 'cpt_supports',
|
1584 |
+
'textvalue' => 'comments',
|
1585 |
+
'labeltext' => esc_html__( 'Comments', 'custom-post-type-ui' ),
|
1586 |
+
'default' => true,
|
1587 |
+
'wrap' => false,
|
1588 |
+
]
|
1589 |
+
);
|
1590 |
+
|
1591 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
1592 |
+
[
|
1593 |
+
'checkvalue' => 'revisions',
|
1594 |
+
'checked' => ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'revisions', $current['supports'] ) ) ? 'true' : 'false', // phpcs:ignore.
|
1595 |
+
'name' => 'revisions',
|
1596 |
+
'namearray' => 'cpt_supports',
|
1597 |
+
'textvalue' => 'revisions',
|
1598 |
+
'labeltext' => esc_html__( 'Revisions', 'custom-post-type-ui' ),
|
1599 |
+
'default' => true,
|
1600 |
+
'wrap' => false,
|
1601 |
+
]
|
1602 |
+
);
|
1603 |
+
|
1604 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
1605 |
+
[
|
1606 |
+
'checkvalue' => 'author',
|
1607 |
+
'checked' => ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'author', $current['supports'] ) ) ? 'true' : 'false', // phpcs:ignore.
|
1608 |
+
'name' => 'author',
|
1609 |
+
'namearray' => 'cpt_supports',
|
1610 |
+
'textvalue' => 'author',
|
1611 |
+
'labeltext' => esc_html__( 'Author', 'custom-post-type-ui' ),
|
1612 |
+
'default' => true,
|
1613 |
+
'wrap' => false,
|
1614 |
+
]
|
1615 |
+
);
|
1616 |
+
|
1617 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
1618 |
+
[
|
1619 |
+
'checkvalue' => 'page-attributes',
|
1620 |
+
'checked' => ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'page-attributes', $current['supports'] ) ) ? 'true' : 'false', // phpcs:ignore.
|
1621 |
+
'name' => 'page-attributes',
|
1622 |
+
'namearray' => 'cpt_supports',
|
1623 |
+
'textvalue' => 'page-attributes',
|
1624 |
+
'labeltext' => esc_html__( 'Page Attributes', 'custom-post-type-ui' ),
|
1625 |
+
'default' => true,
|
1626 |
+
'wrap' => false,
|
1627 |
+
]
|
1628 |
+
);
|
1629 |
+
|
1630 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
1631 |
+
[
|
1632 |
+
'checkvalue' => 'post-formats',
|
1633 |
+
'checked' => ( ! empty( $current['supports'] ) && is_array( $current['supports'] ) && in_array( 'post-formats', $current['supports'] ) ) ? 'true' : 'false', // phpcs:ignore.
|
1634 |
+
'name' => 'post-formats',
|
1635 |
+
'namearray' => 'cpt_supports',
|
1636 |
+
'textvalue' => 'post-formats',
|
1637 |
+
'labeltext' => esc_html__( 'Post Formats', 'custom-post-type-ui' ),
|
1638 |
+
'default' => true,
|
1639 |
+
'wrap' => false,
|
1640 |
+
]
|
1641 |
+
);
|
1642 |
+
|
1643 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
1644 |
+
[
|
1645 |
+
'checkvalue' => 'none',
|
1646 |
+
'checked' => ( ! empty( $current['supports'] ) && ( is_array( $current['supports'] ) && in_array( 'none', $current['supports'] ) ) ) ? 'true' : 'false', // phpcs:ignore.
|
1647 |
+
'name' => 'none',
|
1648 |
+
'namearray' => 'cpt_supports',
|
1649 |
+
'textvalue' => 'none',
|
1650 |
+
'labeltext' => esc_html__( 'None', 'custom-post-type-ui' ),
|
1651 |
+
'default' => false,
|
1652 |
+
'wrap' => false,
|
1653 |
+
]
|
1654 |
+
);
|
1655 |
+
|
1656 |
+
echo $ui->get_fieldset_end() . $ui->get_td_end() . $ui->get_tr_end(); // phpcs:ignore.
|
1657 |
+
|
1658 |
+
echo $ui->get_tr_start() . $ui->get_th_start() . '<label for="custom_supports">' . esc_html__( 'Custom "Supports"', 'custom-post-type-ui' ) . '</label>'; // phpcs:ignore.
|
1659 |
+
echo $ui->get_p( sprintf( esc_html__( 'Use this input to register custom "supports" values, separated by commas. Learn about this at %s', 'custom-post-type-ui' ), '<a href="http://docs.pluginize.com/article/28-third-party-support-upon-registration" target="_blank" rel="noopener">' . esc_html__( 'Custom "Supports"', 'custom-post-type-ui' ) . '</a>' ) ); // phpcs:ignore.
|
1660 |
+
echo $ui->get_th_end() . $ui->get_td_start(); // phpcs:ignore.
|
1661 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1662 |
+
[
|
1663 |
+
'namearray' => 'cpt_custom_post_type',
|
1664 |
+
'name' => 'custom_supports',
|
1665 |
+
'textvalue' => isset( $current['custom_supports'] ) ? esc_attr( $current['custom_supports'] ) : '', // phpcs:ignore.
|
1666 |
+
'helptext' => esc_attr__( 'Provide custom support slugs here.', 'custom-post-type-ui' ),
|
1667 |
+
'helptext_after' => true,
|
1668 |
+
'wrap' => false,
|
1669 |
+
]
|
1670 |
+
);
|
1671 |
+
echo $ui->get_td_end() . $ui->get_tr_end(); // phpcs:ignore.
|
1672 |
+
|
1673 |
+
echo $ui->get_tr_start() . $ui->get_th_start() . esc_html__( 'Taxonomies', 'custom-post-type-ui' ); // phpcs:ignore.
|
1674 |
+
|
1675 |
+
echo $ui->get_p( esc_html__( 'Add support for available registered taxonomies.', 'custom-post-type-ui' ) ); // phpcs:ignore.
|
1676 |
+
|
1677 |
+
echo $ui->get_th_end() . $ui->get_td_start() . $ui->get_fieldset_start(); // phpcs:ignore.
|
1678 |
+
|
1679 |
+
echo $ui->get_legend_start() . esc_html__( 'Taxonomy options', 'custom-post-type-ui' ) . $ui->get_legend_end(); // phpcs:ignore.
|
1680 |
/**
|
1681 |
* Filters the arguments for taxonomies to list for post type association.
|
1682 |
*
|
1703 |
unset( $add_taxes['nav_menu'], $add_taxes['post_format'] );
|
1704 |
foreach ( $add_taxes as $add_tax ) {
|
1705 |
|
1706 |
+
$core_label = in_array( $add_tax->name, [ 'category', 'post_tag' ], true ) ? __( '(WP Core)', 'custom-post-type-ui' ) : '';
|
1707 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
1708 |
+
[
|
1709 |
+
'checkvalue' => esc_attr( $add_tax->name ),
|
1710 |
+
'checked' => ( ! empty( $current['taxonomies'] ) && is_array( $current['taxonomies'] ) && in_array( $add_tax->name, $current['taxonomies'] ) ) ? 'true' : 'false', // phpcs:ignore.
|
1711 |
+
'name' => esc_attr( $add_tax->name ),
|
1712 |
+
'namearray' => 'cpt_addon_taxes',
|
1713 |
+
'textvalue' => esc_attr( $add_tax->name ),
|
1714 |
+
'labeltext' => $add_tax->label . ' ' . $core_label, // phpcs:ignore.
|
1715 |
+
'helptext' => sprintf( esc_attr__( 'Adds %s support', 'custom-post-type-ui' ), $add_tax->label ), // phpcs:ignore.
|
1716 |
+
'wrap' => false,
|
1717 |
+
]
|
1718 |
+
);
|
1719 |
}
|
1720 |
+
echo $ui->get_fieldset_end() . $ui->get_td_end() . $ui->get_tr_end(); // phpcs:ignore.
|
1721 |
?>
|
1722 |
</table>
|
1723 |
</div>
|
1732 |
*
|
1733 |
* @param cptui_admin_ui $ui Admin UI instance.
|
1734 |
*/
|
1735 |
+
do_action( 'cptui_post_type_after_fieldsets', $ui );
|
1736 |
+
?>
|
1737 |
|
1738 |
<p>
|
1739 |
<?php
|
1740 |
+
if ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) { // phpcs:ignore.
|
1741 |
/**
|
1742 |
* Filters the text value to use on the button when editing.
|
1743 |
*
|
1745 |
*
|
1746 |
* @param string $value Text to use for the button.
|
1747 |
*/
|
1748 |
+
?>
|
1749 |
<input type="submit" class="button-primary" name="cpt_submit" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_edit', __( 'Save Post Type', 'custom-post-type-ui' ) ) ); ?>" />
|
1750 |
<?php
|
1751 |
|
1756 |
*
|
1757 |
* @param string $value Text to use for the button.
|
1758 |
*/
|
1759 |
+
?>
|
1760 |
<input type="submit" class="button-secondary cptui-delete-bottom" name="cpt_delete" id="cpt_submit_delete" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_delete', __( 'Delete Post Type', 'custom-post-type-ui' ) ) ); ?>" />
|
1761 |
+
<?php
|
1762 |
+
} else {
|
1763 |
|
1764 |
/**
|
1765 |
* Filters the text value to use on the button when adding.
|
1768 |
*
|
1769 |
* @param string $value Text to use for the button.
|
1770 |
*/
|
1771 |
+
?>
|
1772 |
<input type="submit" class="button-primary" name="cpt_submit" value="<?php echo esc_attr( apply_filters( 'cptui_post_type_submit_add', __( 'Add Post Type', 'custom-post-type-ui' ) ) ); ?>" />
|
1773 |
<?php } ?>
|
1774 |
</p>
|
1775 |
</div>
|
1776 |
</form>
|
1777 |
</div><!-- End .wrap -->
|
1778 |
+
<?php
|
1779 |
}
|
1780 |
|
1781 |
/**
|
1790 |
$ui = new cptui_admin_ui();
|
1791 |
|
1792 |
if ( ! empty( $post_types ) ) {
|
1793 |
+
$select = [];
|
1794 |
$select['options'] = [];
|
1795 |
|
1796 |
foreach ( $post_types as $type ) {
|
1797 |
$text = ! empty( $type['label'] ) ? esc_html( $type['label'] ) : esc_html( $type['name'] );
|
1798 |
+
$select['options'][] = [
|
1799 |
+
'attr' => esc_html( $type['name'] ),
|
1800 |
+
'text' => $text,
|
1801 |
+
];
|
1802 |
}
|
1803 |
|
1804 |
$current = cptui_get_current_post_type();
|
1807 |
|
1808 |
/**
|
1809 |
* Filters the post type dropdown options before rendering.
|
|
|
1810 |
*
|
1811 |
+
* @since 1.6.0
|
1812 |
* @param array $select Array of options for the dropdown.
|
1813 |
* @param array $post_types Array of original passed in post types.
|
1814 |
*/
|
1815 |
$select = apply_filters( 'cptui_post_types_dropdown_options', $select, $post_types );
|
1816 |
|
1817 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1818 |
+
[
|
1819 |
+
'namearray' => 'cptui_selected_post_type',
|
1820 |
+
'name' => 'post_type',
|
1821 |
+
'selections' => $select, // phpcs:ignore.
|
1822 |
+
'wrap' => false,
|
1823 |
+
]
|
1824 |
+
);
|
1825 |
}
|
1826 |
}
|
1827 |
|
1844 |
check_admin_referer( 'cptui_select_post_type_nonce_action', 'cptui_select_post_type_nonce_field' );
|
1845 |
}
|
1846 |
if ( isset( $_POST['cptui_selected_post_type']['post_type'] ) ) {
|
1847 |
+
$type = sanitize_text_field( wp_unslash( $_POST['cptui_selected_post_type']['post_type'] ) );
|
1848 |
+
} elseif ( $post_type_deleted ) {
|
1849 |
$post_types = cptui_get_post_type_data();
|
1850 |
+
$type = key( $post_types );
|
1851 |
+
} elseif ( isset( $_POST['cpt_custom_post_type']['name'] ) ) {
|
1852 |
// Return the submitted value.
|
1853 |
if ( ! in_array( $_POST['cpt_custom_post_type']['name'], cptui_reserved_post_types(), true ) ) {
|
1854 |
+
$type = sanitize_text_field( wp_unslash( $_POST['cpt_custom_post_type']['name'] ) );
|
1855 |
} else {
|
1856 |
// Return the original value since user tried to submit a reserved term.
|
1857 |
+
$type = sanitize_text_field( wp_unslash( $_POST['cpt_original'] ) ); // phpcs:ignore.
|
1858 |
}
|
1859 |
}
|
1860 |
+
} elseif ( ! empty( $_GET ) && isset( $_GET['cptui_post_type'] ) ) {
|
1861 |
+
$type = sanitize_text_field( wp_unslash( $_GET['cptui_post_type'] ) );
|
1862 |
} else {
|
1863 |
$post_types = cptui_get_post_type_data();
|
1864 |
if ( ! empty( $post_types ) ) {
|
1924 |
* @param array $post_types Array of our updated post types data.
|
1925 |
* @param array $data Array of submitted post type to update.
|
1926 |
*/
|
1927 |
+
if ( false === ( $success = apply_filters( 'cptui_post_type_delete_type', false, $post_types, $data ) ) ) { // phpcs:ignore.
|
1928 |
$success = update_option( 'cptui_post_types', $post_types );
|
1929 |
}
|
1930 |
}
|
1973 |
return cptui_admin_notices( 'error', '', false, __( 'Please provide a post type name', 'custom-post-type-ui' ) );
|
1974 |
}
|
1975 |
|
1976 |
+
if ( ! empty( $data['cpt_original'] ) && $data['cpt_original'] != $data['cpt_custom_post_type']['name'] ) { // phpcs:ignore.
|
1977 |
if ( ! empty( $data['update_post_types'] ) ) {
|
1978 |
add_filter( 'cptui_convert_post_type_posts', '__return_true' );
|
1979 |
}
|
1990 |
|
1991 |
// Check if they didn't put quotes in the name or rewrite slug.
|
1992 |
if ( false !== strpos( $data['cpt_custom_post_type']['name'], '\'' ) ||
|
1993 |
+
false !== strpos( $data['cpt_custom_post_type']['name'], '\"' ) ||
|
1994 |
+
false !== strpos( $data['cpt_custom_post_type']['rewrite_slug'], '\'' ) ||
|
1995 |
+
false !== strpos( $data['cpt_custom_post_type']['rewrite_slug'], '\"' ) ) {
|
1996 |
|
1997 |
add_filter( 'cptui_custom_error_message', 'cptui_slug_has_quotes' );
|
1998 |
return 'error';
|
2035 |
unset( $data['cpt_labels'][ $key ] );
|
2036 |
}
|
2037 |
|
2038 |
+
$label = str_replace( '"', '', htmlspecialchars_decode( $label ) );
|
2039 |
+
$label = htmlspecialchars( $label, ENT_QUOTES );
|
2040 |
+
$label = trim( $label );
|
2041 |
if ( 'parent' === $key ) {
|
2042 |
$data['cpt_labels']['parent_item_colon'] = stripslashes_deep( $label );
|
2043 |
} else {
|
2066 |
$singular_label = htmlspecialchars( stripslashes( $singular_label ), ENT_QUOTES );
|
2067 |
}
|
2068 |
|
2069 |
+
// We are handling this special because we can't accurately get to exclude the description index
|
2070 |
+
// in the cptui_filtered_post_type_post_global() function. So we clean this up from the $_POST
|
2071 |
+
// global afterwards here.
|
2072 |
+
$description = wp_kses_post( stripslashes_deep( $_POST['cpt_custom_post_type']['description'] ) );
|
2073 |
+
|
2074 |
$name = trim( $data['cpt_custom_post_type']['name'] );
|
|
|
2075 |
$rest_base = trim( $data['cpt_custom_post_type']['rest_base'] );
|
2076 |
$rest_controller_class = trim( $data['cpt_custom_post_type']['rest_controller_class'] );
|
2077 |
$rest_namespace = trim( $data['cpt_custom_post_type']['rest_namespace'] );
|
2141 |
* @param array $post_types Array of our updated post types data.
|
2142 |
* @param array $data Array of submitted post type to update.
|
2143 |
*/
|
2144 |
+
if ( false === ( $success = apply_filters( 'cptui_post_type_update_save', false, $post_types, $data ) ) ) { // phpcs:ignore.
|
2145 |
$success = update_option( 'cptui_post_types', $post_types );
|
2146 |
}
|
2147 |
|
2209 |
|
2210 |
if ( is_string( $custom_reserved ) && ! empty( $custom_reserved ) ) {
|
2211 |
$reserved[] = $custom_reserved;
|
2212 |
+
} elseif ( is_array( $custom_reserved ) && ! empty( $custom_reserved ) ) {
|
2213 |
foreach ( $custom_reserved as $slug ) {
|
2214 |
$reserved[] = $slug;
|
2215 |
}
|
2229 |
* @param string $new_slug New post type slug. Optional. Default empty string.
|
2230 |
*/
|
2231 |
function cptui_convert_post_type_posts( $original_slug = '', $new_slug = '' ) {
|
2232 |
+
$args = [
|
2233 |
'posts_per_page' => -1,
|
2234 |
'post_type' => $original_slug,
|
2235 |
];
|
2268 |
}
|
2269 |
|
2270 |
// Check if we're registering a reserved post type slug.
|
2271 |
+
if ( in_array( $post_type_slug, cptui_reserved_post_types() ) ) { // phpcs:ignore.
|
2272 |
return true;
|
2273 |
}
|
2274 |
|
2275 |
// Check if other plugins have registered non-public this same slug.
|
2276 |
+
$public = get_post_types(
|
2277 |
+
[
|
2278 |
+
'_builtin' => false,
|
2279 |
+
'public' => true,
|
2280 |
+
]
|
2281 |
+
);
|
2282 |
+
|
2283 |
+
$private = get_post_types(
|
2284 |
+
[
|
2285 |
+
'_builtin' => false,
|
2286 |
+
'public' => false,
|
2287 |
+
]
|
2288 |
+
);
|
2289 |
+
|
2290 |
$registered_post_types = array_merge( $public, $private );
|
2291 |
+
if ( in_array( $post_type_slug, $registered_post_types ) ) { // phpcs:ignore.
|
2292 |
return true;
|
2293 |
}
|
2294 |
|
2342 |
$result = '';
|
2343 |
if ( isset( $_POST['cpt_submit'] ) ) {
|
2344 |
check_admin_referer( 'cptui_addedit_post_type_nonce_action', 'cptui_addedit_post_type_nonce_field' );
|
2345 |
+
$data = cptui_filtered_post_type_post_global();
|
2346 |
$result = cptui_update_post_type( $data );
|
2347 |
} elseif ( isset( $_POST['cpt_delete'] ) ) {
|
2348 |
check_admin_referer( 'cptui_addedit_post_type_nonce_action', 'cptui_addedit_post_type_nonce_field' );
|
2349 |
|
2350 |
$filtered_data = filter_input( INPUT_POST, 'cpt_custom_post_type', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
2351 |
+
$result = cptui_delete_post_type( $filtered_data );
|
2352 |
add_filter( 'cptui_post_type_deleted', '__return_true' );
|
2353 |
}
|
2354 |
|
2360 |
if ( isset( $_POST['cpt_delete'] ) && empty( cptui_get_post_type_slugs() ) ) {
|
2361 |
wp_safe_redirect(
|
2362 |
add_query_arg(
|
2363 |
+
[
|
2364 |
+
'page' => 'cptui_manage_post_types',
|
2365 |
+
],
|
2366 |
cptui_admin_url( 'admin.php?page=cptui_manage_post_types' )
|
2367 |
)
|
2368 |
);
|
2415 |
*/
|
2416 |
function cptui_updated_post_type_slug_exists( $slug_exists, $post_type_slug = '', $post_types = [] ) {
|
2417 |
if (
|
2418 |
+
( ! empty( $_POST['cpt_type_status'] ) && 'edit' === $_POST['cpt_type_status'] ) &&// phpcs:ignore.
|
2419 |
+
! in_array( $post_type_slug, cptui_reserved_post_types() ) &&// phpcs:ignore.
|
2420 |
+
( ! empty( $_POST['cpt_original'] ) && $post_type_slug === $_POST['cpt_original'] ) // phpcs:ignore.
|
2421 |
+
) {
|
|
|
2422 |
$slug_exists = false;
|
2423 |
}
|
2424 |
return $slug_exists;
|
2443 |
'cpt_addon_taxes',
|
2444 |
'update_post_types',
|
2445 |
];
|
2446 |
+
|
2447 |
$third_party_items_arrays = apply_filters(
|
2448 |
'cptui_filtered_post_type_post_global_arrays',
|
2449 |
+
(array) [] // phpcs:ignore.
|
2450 |
);
|
2451 |
|
2452 |
$items_arrays = array_merge( $default_arrays, $third_party_items_arrays );
|
2453 |
+
foreach ( $items_arrays as $item ) {
|
2454 |
$first_result = filter_input( INPUT_POST, $item, FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
2455 |
|
2456 |
if ( $first_result ) {
|
2462 |
'cpt_original',
|
2463 |
'cpt_type_status',
|
2464 |
];
|
2465 |
+
|
2466 |
$third_party_items_strings = apply_filters(
|
2467 |
'cptui_filtered_post_type_post_global_strings',
|
2468 |
+
(array) [] // phpcs:ignore.
|
2469 |
);
|
2470 |
|
2471 |
$items_string = array_merge( $default_strings, $third_party_items_strings );
|
2480 |
return $filtered_data;
|
2481 |
}
|
2482 |
|
2483 |
+
// phpcs:ignore.
|
2484 |
function cptui_custom_enter_title_here( $text, $post ) {
|
2485 |
$cptui_obj = cptui_get_cptui_post_type_object( $post->post_type );
|
2486 |
if ( empty( $cptui_obj ) ) {
|
inc/support.php
CHANGED
@@ -60,14 +60,18 @@ function cptui_support() {
|
|
60 |
<h1><?php esc_html_e( 'Custom Post Type UI Support', 'custom-post-type-ui' ); ?></h1>
|
61 |
|
62 |
<p>
|
63 |
-
<?php
|
64 |
-
|
|
|
|
|
65 |
'<strong>',
|
66 |
'</strong>',
|
67 |
'<a href="https://pluginize.com/plugins/custom-post-type-ui-extended/?utm_source=faq&utm_medium=text&utm_campaign=cptui">' . esc_html__( 'CPTUI Extended', 'custom-post-type-ui' ) . '</a>',
|
68 |
'<a href="https://pluginize.com/cpt-ui-extended-features/?utm_source=faq-layouts&utm_medium=text&utm_campaign=cptui">' . esc_html__( 'View our Layouts page', 'custom-post-type-ui' ) . '</a>',
|
69 |
'<a href="https://www.wordpress.org/support/plugin/custom-post-type-ui/">' . esc_html__( 'Support Forums', 'custom-post-type-ui' ) . '</a>'
|
70 |
-
);
|
|
|
|
|
71 |
|
72 |
<table id="support" class="form-table cptui-table">
|
73 |
<tr>
|
@@ -94,12 +98,15 @@ function cptui_support() {
|
|
94 |
<div class="answer" id="q4">
|
95 |
<?php
|
96 |
printf(
|
|
|
97 |
esc_html__( 'You can have them automatically removed from display via a purchased copy of %s.', 'custom-post-type-ui' ),
|
98 |
-
sprintf(
|
|
|
99 |
'https://pluginize.com/plugins/custom-post-type-ui-extended/?utm_source=faq-remove&utm_medium=text&utm_campaign=cptui',
|
100 |
'Custom Post Type UI Extended'
|
101 |
)
|
102 |
-
);
|
|
|
103 |
</div>
|
104 |
</li>
|
105 |
<li>
|
@@ -173,10 +180,12 @@ function cptui_support() {
|
|
173 |
<div class="answer" id="q15">
|
174 |
<?php
|
175 |
printf(
|
176 |
-
|
|
|
177 |
'<a href="https://codex.wordpress.org/Template_Hierarchy" target="_blank" rel="noopener">',
|
178 |
'</a>'
|
179 |
-
);
|
|
|
180 |
</div>
|
181 |
</li>
|
182 |
<li>
|
@@ -184,13 +193,16 @@ function cptui_support() {
|
|
184 |
<div class="answer" id="q16">
|
185 |
<?php
|
186 |
printf(
|
187 |
-
|
188 |
-
|
|
|
|
|
189 |
'https://pluginize.com/plugins/custom-post-type-ui-extended/?utm_source=faq&utm_medium=text&utm_campaign=cptui',
|
190 |
'Custom Post Type UI Extended'
|
191 |
),
|
192 |
'<a href="https://codex.wordpress.org/Class_Reference/WP_Query" target="_blank" rel="noopener">WP_Query</a>'
|
193 |
-
);
|
|
|
194 |
</div>
|
195 |
</li>
|
196 |
<li>
|
@@ -198,25 +210,31 @@ function cptui_support() {
|
|
198 |
<div class="answer" id="q17">
|
199 |
<?php
|
200 |
printf(
|
|
|
201 |
esc_html__( 'You will need to add your newly created post type to the types that the category and tag archives query for. You can see a tutorial on how to do that at %s', 'custom-post-type-ui' ),
|
202 |
'<a href="http://docs.pluginize.com/article/17-post-types-in-category-tag-archives" target="_blank" rel="noopener">http://docs.pluginize.com/article/17-post-types-in-category-tag-archives</a>'
|
203 |
-
);
|
|
|
|
|
204 |
</li>
|
205 |
<li>
|
206 |
<span tabindex="0" class="question" aria-controls="q18" aria-expanded="false"><?php esc_html_e( 'How do I add custom post type support for custom templates selection like pages have?', 'custom-post-type-ui' ); ?></span>
|
207 |
<div class="answer" id="q18">
|
208 |
<?php
|
209 |
printf(
|
210 |
-
|
|
|
211 |
'<a href="https://make.wordpress.org/core/2016/11/03/post-type-templates-in-4-7/" target="_blank" rel="noopener">',
|
212 |
'</a>'
|
213 |
-
);
|
|
|
214 |
</div>
|
215 |
</li>
|
216 |
<li>
|
217 |
<span tabindex="0" class="question" aria-controls="q19" aria-expanded="false"><?php esc_html_e( 'Why are my post types not showing in taxonomy term archives?', 'custom-post-type-ui' ); ?></span>
|
218 |
<div class="answer" id="q19">
|
219 |
-
<?php
|
|
|
220 |
?>
|
221 |
</div>
|
222 |
</li>
|
@@ -230,9 +248,11 @@ function cptui_support() {
|
|
230 |
<div class="answer" id="q20">
|
231 |
<?php
|
232 |
printf(
|
|
|
233 |
esc_html__( 'We recommend checking out %s, the latest iteration of "CMB2". Both are supported by WebDevStudios.', 'custom-post-type-ui' ),
|
234 |
'<a href="https://wordpress.org/plugins/cmb2/" target="_blank" rel="noopener">CMB2</a>'
|
235 |
-
);
|
|
|
236 |
</div>
|
237 |
</li>
|
238 |
<li>
|
@@ -240,9 +260,11 @@ function cptui_support() {
|
|
240 |
<div class="answer" id="q21">
|
241 |
<?php
|
242 |
printf(
|
|
|
243 |
esc_html__( 'Check out the %s function for documentation and usage examples.', 'custom-post-type-ui' ),
|
244 |
'<a href="https://codex.wordpress.org/Function_Reference/register_taxonomy_for_object_type" target="_blank" rel="noopener">register_taxonomy_for_object_type()</a>'
|
245 |
-
);
|
|
|
246 |
</div>
|
247 |
</li>
|
248 |
<li>
|
@@ -250,18 +272,28 @@ function cptui_support() {
|
|
250 |
<div class="answer" id="q22">
|
251 |
<?php
|
252 |
printf(
|
253 |
-
|
|
|
254 |
'Pippin Williamson',
|
255 |
'<a href="https://pippinsplugins.com/introduction-posts-2-posts-plugin/" target="_blank" rel="noopener">',
|
256 |
'</a>',
|
257 |
'<a href="https://wordpress.org/plugins/posts-to-posts/" target="_blank" rel="noopener">',
|
258 |
'</a>'
|
259 |
-
);
|
|
|
|
|
260 |
</li>
|
261 |
<li>
|
262 |
<span tabindex="0" class="question" aria-controls="q23" aria-expanded="false"><?php esc_html_e( 'Is there any function reference list?', 'custom-post-type-ui' ); ?></span>
|
263 |
-
<div class="answer" id="q23"
|
264 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
</li>
|
266 |
<li>
|
267 |
<span tabindex="0" class="question" aria-controls="q24" aria-expanded="false"><?php esc_html_e( 'How do I filter the "enter title here" text in the post editor screen?', 'custom-post-type-ui' ); ?></span>
|
@@ -278,8 +310,15 @@ add_filter( 'enter_title_here', 'my_custom_title_text' );
|
|
278 |
<li>
|
279 |
<span tabindex="0" class="question" aria-controls="q25" aria-expanded="false"><?php esc_html_e( 'Any help with customizing capabilities?', 'custom-post-type-ui' ); ?></span>
|
280 |
<div class="answer" id="q25">
|
281 |
-
<p
|
282 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
</div>
|
284 |
</li>
|
285 |
</ol>
|
60 |
<h1><?php esc_html_e( 'Custom Post Type UI Support', 'custom-post-type-ui' ); ?></h1>
|
61 |
|
62 |
<p>
|
63 |
+
<?php
|
64 |
+
printf(
|
65 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
66 |
+
esc_html__( 'Please note that %1$s this plugin will not handle display %2$s of registered post types or taxonomies in your current theme. It simply registers them for you. To display your data, check out %3$s. %4$s to see some examples that are available with Custom Post Type UI Extended. If all else fails, visit us on the %5$s', 'custom-post-type-ui' ),
|
67 |
'<strong>',
|
68 |
'</strong>',
|
69 |
'<a href="https://pluginize.com/plugins/custom-post-type-ui-extended/?utm_source=faq&utm_medium=text&utm_campaign=cptui">' . esc_html__( 'CPTUI Extended', 'custom-post-type-ui' ) . '</a>',
|
70 |
'<a href="https://pluginize.com/cpt-ui-extended-features/?utm_source=faq-layouts&utm_medium=text&utm_campaign=cptui">' . esc_html__( 'View our Layouts page', 'custom-post-type-ui' ) . '</a>',
|
71 |
'<a href="https://www.wordpress.org/support/plugin/custom-post-type-ui/">' . esc_html__( 'Support Forums', 'custom-post-type-ui' ) . '</a>'
|
72 |
+
);
|
73 |
+
?>
|
74 |
+
</p>
|
75 |
|
76 |
<table id="support" class="form-table cptui-table">
|
77 |
<tr>
|
98 |
<div class="answer" id="q4">
|
99 |
<?php
|
100 |
printf(
|
101 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
102 |
esc_html__( 'You can have them automatically removed from display via a purchased copy of %s.', 'custom-post-type-ui' ),
|
103 |
+
sprintf(
|
104 |
+
'<a href="%s">%s</a>',
|
105 |
'https://pluginize.com/plugins/custom-post-type-ui-extended/?utm_source=faq-remove&utm_medium=text&utm_campaign=cptui',
|
106 |
'Custom Post Type UI Extended'
|
107 |
)
|
108 |
+
);
|
109 |
+
?>
|
110 |
</div>
|
111 |
</li>
|
112 |
<li>
|
180 |
<div class="answer" id="q15">
|
181 |
<?php
|
182 |
printf(
|
183 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
184 |
+
esc_html__( 'Please visit the %1$sTemplate Hierarchy%2$s page on the WordPress codex for details about available templates.', 'custom-post-type-ui' ),
|
185 |
'<a href="https://codex.wordpress.org/Template_Hierarchy" target="_blank" rel="noopener">',
|
186 |
'</a>'
|
187 |
+
);
|
188 |
+
?>
|
189 |
</div>
|
190 |
</li>
|
191 |
<li>
|
193 |
<div class="answer" id="q16">
|
194 |
<?php
|
195 |
printf(
|
196 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
197 |
+
esc_html__( 'We encourage checking out %1$s for easily displaying post type content wherever you can utilize a shortcode. If you prefer to handle on your own, you will need to utilize the %2$s class to handle display in custom locations. If you have set the post type to have archives, the archive url should be something like "http://www.mysite.com/post-type-slug"', 'custom-post-type-ui' ),
|
198 |
+
sprintf(
|
199 |
+
'<a href="%s">%s</a>',
|
200 |
'https://pluginize.com/plugins/custom-post-type-ui-extended/?utm_source=faq&utm_medium=text&utm_campaign=cptui',
|
201 |
'Custom Post Type UI Extended'
|
202 |
),
|
203 |
'<a href="https://codex.wordpress.org/Class_Reference/WP_Query" target="_blank" rel="noopener">WP_Query</a>'
|
204 |
+
);
|
205 |
+
?>
|
206 |
</div>
|
207 |
</li>
|
208 |
<li>
|
210 |
<div class="answer" id="q17">
|
211 |
<?php
|
212 |
printf(
|
213 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
214 |
esc_html__( 'You will need to add your newly created post type to the types that the category and tag archives query for. You can see a tutorial on how to do that at %s', 'custom-post-type-ui' ),
|
215 |
'<a href="http://docs.pluginize.com/article/17-post-types-in-category-tag-archives" target="_blank" rel="noopener">http://docs.pluginize.com/article/17-post-types-in-category-tag-archives</a>'
|
216 |
+
);
|
217 |
+
?>
|
218 |
+
</div>
|
219 |
</li>
|
220 |
<li>
|
221 |
<span tabindex="0" class="question" aria-controls="q18" aria-expanded="false"><?php esc_html_e( 'How do I add custom post type support for custom templates selection like pages have?', 'custom-post-type-ui' ); ?></span>
|
222 |
<div class="answer" id="q18">
|
223 |
<?php
|
224 |
printf(
|
225 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
226 |
+
esc_html__( 'Please visit the %1$sPost Type Templates in 4.7%2$s post on the Make WordPress Core blog for details about setting templates for multiple post types.', 'custom-post-type-ui' ),
|
227 |
'<a href="https://make.wordpress.org/core/2016/11/03/post-type-templates-in-4-7/" target="_blank" rel="noopener">',
|
228 |
'</a>'
|
229 |
+
);
|
230 |
+
?>
|
231 |
</div>
|
232 |
</li>
|
233 |
<li>
|
234 |
<span tabindex="0" class="question" aria-controls="q19" aria-expanded="false"><?php esc_html_e( 'Why are my post types not showing in taxonomy term archives?', 'custom-post-type-ui' ); ?></span>
|
235 |
<div class="answer" id="q19">
|
236 |
+
<?php
|
237 |
+
esc_html_e( 'If you have set "exclude from search" to True for the pot type, this would be why. If you need the post types in the archives, but still want to exclude them from search, it is recommended to use the "pre_get_posts" hook to unset the post type from considered types.', 'custom-post-type-ui' );
|
238 |
?>
|
239 |
</div>
|
240 |
</li>
|
248 |
<div class="answer" id="q20">
|
249 |
<?php
|
250 |
printf(
|
251 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
252 |
esc_html__( 'We recommend checking out %s, the latest iteration of "CMB2". Both are supported by WebDevStudios.', 'custom-post-type-ui' ),
|
253 |
'<a href="https://wordpress.org/plugins/cmb2/" target="_blank" rel="noopener">CMB2</a>'
|
254 |
+
);
|
255 |
+
?>
|
256 |
</div>
|
257 |
</li>
|
258 |
<li>
|
260 |
<div class="answer" id="q21">
|
261 |
<?php
|
262 |
printf(
|
263 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
264 |
esc_html__( 'Check out the %s function for documentation and usage examples.', 'custom-post-type-ui' ),
|
265 |
'<a href="https://codex.wordpress.org/Function_Reference/register_taxonomy_for_object_type" target="_blank" rel="noopener">register_taxonomy_for_object_type()</a>'
|
266 |
+
);
|
267 |
+
?>
|
268 |
</div>
|
269 |
</li>
|
270 |
<li>
|
272 |
<div class="answer" id="q22">
|
273 |
<?php
|
274 |
printf(
|
275 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
276 |
+
esc_html__( '%1$s has an excellent %2$spost%3$s introducing users to the %4$sPosts 2 Posts%5$s plugin that should be a good start.', 'custom-post-type-ui' ),
|
277 |
'Pippin Williamson',
|
278 |
'<a href="https://pippinsplugins.com/introduction-posts-2-posts-plugin/" target="_blank" rel="noopener">',
|
279 |
'</a>',
|
280 |
'<a href="https://wordpress.org/plugins/posts-to-posts/" target="_blank" rel="noopener">',
|
281 |
'</a>'
|
282 |
+
);
|
283 |
+
?>
|
284 |
+
</div>
|
285 |
</li>
|
286 |
<li>
|
287 |
<span tabindex="0" class="question" aria-controls="q23" aria-expanded="false"><?php esc_html_e( 'Is there any function reference list?', 'custom-post-type-ui' ); ?></span>
|
288 |
+
<div class="answer" id="q23">
|
289 |
+
<?php
|
290 |
+
printf(
|
291 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
292 |
+
esc_html__( '%s has compiled a nice list of functions used by our plugin. Note not all will be useful as they are attached to hooks.', 'custom-post-type-ui' ),
|
293 |
+
'<a href="http://hookr.io/plugins/custom-post-type-ui/" target="_blank" rel="noopener">Hookr.io</a>'
|
294 |
+
);
|
295 |
+
?>
|
296 |
+
</div>
|
297 |
</li>
|
298 |
<li>
|
299 |
<span tabindex="0" class="question" aria-controls="q24" aria-expanded="false"><?php esc_html_e( 'How do I filter the "enter title here" text in the post editor screen?', 'custom-post-type-ui' ); ?></span>
|
310 |
<li>
|
311 |
<span tabindex="0" class="question" aria-controls="q25" aria-expanded="false"><?php esc_html_e( 'Any help with customizing capabilities?', 'custom-post-type-ui' ); ?></span>
|
312 |
<div class="answer" id="q25">
|
313 |
+
<p>
|
314 |
+
<?php
|
315 |
+
printf(
|
316 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
317 |
+
esc_html__( 'We recommend %s for some extended customization and addition of extra fields regarding roles and capabilities.', 'custom-post-type-ui' ),
|
318 |
+
'<a href="https://github.com/tw2113/custom-post-type-ui-capabilities" target="_blank" rel="noopener">Custom Post Type UI Capabilities on GitHub</a>'
|
319 |
+
);
|
320 |
+
?>
|
321 |
+
</p>
|
322 |
</div>
|
323 |
</li>
|
324 |
</ol>
|
inc/taxonomies.php
CHANGED
@@ -38,17 +38,29 @@ function cptui_taxonomies_enqueue_scripts() {
|
|
38 |
wp_enqueue_script( 'cptui' );
|
39 |
wp_enqueue_style( 'cptui-css' );
|
40 |
|
41 |
-
$core
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
$
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
$registered_taxonomies = array_merge( $core, $public, $private );
|
51 |
-
|
|
|
|
|
|
|
52 |
[
|
53 |
'confirm' => esc_html__( 'Are you sure you want to delete this? Deleting will NOT remove created content.', 'custom-post-type-ui' ),
|
54 |
'no_associated_type' => esc_html__( 'Please select a post type to associate with.', 'custom-post-type-ui' ),
|
@@ -132,7 +144,7 @@ add_filter( 'cptui_get_tabs', 'cptui_taxonomy_tabs', 10, 2 );
|
|
132 |
*/
|
133 |
function cptui_manage_taxonomies() {
|
134 |
|
135 |
-
$tab = ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' == $_GET['action'] ) ? 'edit' : 'new';
|
136 |
$tab_class = 'cptui-' . $tab;
|
137 |
$current = null;
|
138 |
?>
|
@@ -199,7 +211,7 @@ function cptui_manage_taxonomies() {
|
|
199 |
?>
|
200 |
<input type="submit" class="button-secondary" id="cptui_select_taxonomy_submit" name="cptui_select_taxonomy_submit" value="<?php echo esc_attr( apply_filters( 'cptui_taxonomy_submit_select', esc_attr__( 'Select', 'custom-post-type-ui' ) ) ); ?>" />
|
201 |
</form>
|
202 |
-
|
203 |
|
204 |
/**
|
205 |
* Fires below the taxonomy select input.
|
@@ -231,26 +243,28 @@ function cptui_manage_taxonomies() {
|
|
231 |
<div class="main">
|
232 |
<table class="form-table cptui-table">
|
233 |
<?php
|
234 |
-
echo $ui->get_tr_start() . $ui->get_th_start();
|
235 |
-
echo $ui->get_label( 'name', esc_html__( 'Taxonomy Slug', 'custom-post-type-ui' ) ) . $ui->get_required_span();
|
236 |
|
237 |
if ( 'edit' === $tab ) {
|
238 |
echo '<p id="slugchanged" class="hidemessage">' . esc_html__( 'Slug has changed', 'custom-post-type-ui' ) . '<span class="dashicons dashicons-warning"></span></p>';
|
239 |
}
|
240 |
echo '<p id="slugexists" class="hidemessage">' . esc_html__( 'Slug already exists', 'custom-post-type-ui' ) . '<span class="dashicons dashicons-warning"></span></p>';
|
241 |
|
242 |
-
echo $ui->get_th_end() . $ui->get_td_start();
|
243 |
-
|
244 |
-
echo $ui->get_text_input(
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
|
|
|
|
254 |
|
255 |
echo '<p class="cptui-slug-details">';
|
256 |
esc_html_e( 'Slugs should only contain alphanumeric, latin characters. Underscores should be used in place of spaces. Set "Custom Rewrite Slug" field to make slug use dashes for URLs.', 'custom-post-type-ui' );
|
@@ -262,111 +276,122 @@ function cptui_manage_taxonomies() {
|
|
262 |
echo '</p>';
|
263 |
|
264 |
echo '<div class="cptui-spacer">';
|
265 |
-
echo $ui->get_check_input(
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
|
|
|
|
275 |
echo '</div>';
|
276 |
}
|
277 |
|
278 |
-
echo $ui->get_text_input(
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
|
|
|
|
|
|
299 |
|
300 |
$link_text = ( 'new' === $tab ) ?
|
301 |
esc_html__( 'Populate additional labels based on chosen labels', 'custom-post-type-ui' ) :
|
302 |
esc_html__( 'Populate missing labels based on chosen labels', 'custom-post-type-ui' );
|
303 |
-
echo $ui->get_tr_end();
|
304 |
-
echo $ui->get_th_start() . esc_html__( 'Auto-populate labels', 'custom-post-type-ui' ) . $ui->get_th_end();
|
305 |
-
echo $ui->get_td_start();
|
306 |
|
307 |
-
|
308 |
-
|
309 |
<a href="#" id="auto-clear"><?php esc_html_e( 'Clear labels', 'custom-post-type-ui' ); ?></a>
|
310 |
<?php
|
311 |
|
312 |
-
|
313 |
|
314 |
-
echo $ui->get_tr_start() . $ui->get_th_start() . esc_html__( 'Attach to Post Type', 'custom-post-type-ui' ) . $ui->get_required_span();
|
315 |
-
echo $ui->get_p( esc_html__( 'Add support for available registered post types. At least one is required. Only public post types listed by default.', 'custom-post-type-ui' ) );
|
316 |
-
echo $ui->get_th_end() . $ui->get_td_start() . $ui->get_fieldset_start();
|
317 |
|
318 |
-
echo $ui->get_legend_start() . esc_html__( 'Post type options', 'custom-post-type-ui' ) . $ui->get_legend_end();
|
319 |
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
/**
|
336 |
-
* Filters the results returned to display for available post types for taxonomy.
|
337 |
-
*
|
338 |
-
* @since 1.3.0
|
339 |
-
*
|
340 |
-
* @param array $value Array of post type objects.
|
341 |
-
* @param array $args Array of arguments for the post type query.
|
342 |
-
* @param string $output The output type we want for the results.
|
343 |
-
*/
|
344 |
-
$post_types = apply_filters( 'cptui_get_post_types_for_taxonomies', get_post_types( $args, $output ), $args, $output );
|
345 |
-
|
346 |
-
foreach ( $post_types as $post_type ) {
|
347 |
-
$core_label = in_array( $post_type->name, [
|
348 |
-
'post',
|
349 |
-
'page',
|
350 |
-
'attachment',
|
351 |
-
], true ) ? esc_html__( '(WP Core)', 'custom-post-type-ui' ) : '';
|
352 |
-
echo $ui->get_check_input( [
|
353 |
-
'checkvalue' => $post_type->name,
|
354 |
-
'checked' => ( ! empty( $current['object_types'] ) && is_array( $current['object_types'] ) && in_array( $post_type->name, $current['object_types'], true ) ) ? 'true' : 'false',
|
355 |
-
'name' => $post_type->name,
|
356 |
-
'namearray' => 'cpt_post_types',
|
357 |
-
'textvalue' => $post_type->name,
|
358 |
-
'labeltext' => "{$post_type->label} {$core_label}",
|
359 |
-
'wrap' => false,
|
360 |
-
] );
|
361 |
-
}
|
362 |
|
363 |
-
|
364 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
365 |
</table>
|
366 |
<p class="submit">
|
367 |
<?php
|
368 |
wp_nonce_field( 'cptui_addedit_taxonomy_nonce_action', 'cptui_addedit_taxonomy_nonce_field' );
|
369 |
-
if ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) {
|
370 |
|
371 |
/**
|
372 |
* Filters the text value to use on the button when editing.
|
@@ -404,7 +429,7 @@ function cptui_manage_taxonomies() {
|
|
404 |
|
405 |
<?php if ( ! empty( $current ) ) { ?>
|
406 |
<input type="hidden" name="tax_original" id="tax_original" value="<?php echo esc_attr( $current['name'] ); ?>" />
|
407 |
-
|
408 |
}
|
409 |
|
410 |
// Used to check and see if we should prevent duplicate slugs.
|
@@ -434,336 +459,384 @@ function cptui_manage_taxonomies() {
|
|
434 |
if ( isset( $current['description'] ) ) {
|
435 |
$current['description'] = stripslashes_deep( $current['description'] );
|
436 |
}
|
437 |
-
echo $ui->get_textarea_input(
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
'
|
456 |
-
'
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
'
|
470 |
-
'
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
'
|
484 |
-
'
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
'
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
]
|
542 |
-
|
543 |
-
|
544 |
-
echo $ui->get_text_input(
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
'
|
568 |
-
'
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
'
|
582 |
-
'
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
'
|
596 |
-
'
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
'
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
]
|
654 |
-
|
655 |
-
|
656 |
-
echo $ui->get_text_input(
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
'
|
680 |
-
'
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
'
|
694 |
-
'
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
'
|
708 |
-
'
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
'
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
]
|
766 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
767 |
?>
|
768 |
</table>
|
769 |
</div>
|
@@ -801,13 +874,15 @@ function cptui_manage_taxonomies() {
|
|
801 |
];
|
802 |
$selected = isset( $current ) ? disp_boolean( $current['public'] ) : '';
|
803 |
$select['selected'] = ! empty( $selected ) ? $current['public'] : '';
|
804 |
-
echo $ui->get_select_input(
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
|
|
|
|
811 |
|
812 |
$select = [
|
813 |
'options' => [
|
@@ -824,13 +899,15 @@ function cptui_manage_taxonomies() {
|
|
824 |
];
|
825 |
$selected = isset( $current ) ? disp_boolean( $current['publicly_queryable'] ) : '';
|
826 |
$select['selected'] = ! empty( $selected ) ? $current['publicly_queryable'] : '';
|
827 |
-
echo $ui->get_select_input(
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
|
|
|
|
834 |
|
835 |
$select = [
|
836 |
'options' => [
|
@@ -847,13 +924,15 @@ function cptui_manage_taxonomies() {
|
|
847 |
];
|
848 |
$selected = isset( $current ) ? disp_boolean( $current['hierarchical'] ) : '';
|
849 |
$select['selected'] = ! empty( $selected ) ? $current['hierarchical'] : '';
|
850 |
-
echo $ui->get_select_input(
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
|
|
|
|
857 |
|
858 |
$select = [
|
859 |
'options' => [
|
@@ -870,13 +949,15 @@ function cptui_manage_taxonomies() {
|
|
870 |
];
|
871 |
$selected = isset( $current ) ? disp_boolean( $current['show_ui'] ) : '';
|
872 |
$select['selected'] = ! empty( $selected ) ? $current['show_ui'] : '';
|
873 |
-
echo $ui->get_select_input(
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
|
|
|
|
880 |
|
881 |
$select = [
|
882 |
'options' => [
|
@@ -893,13 +974,15 @@ function cptui_manage_taxonomies() {
|
|
893 |
];
|
894 |
$selected = isset( $current ) ? disp_boolean( $current['show_in_menu'] ) : '';
|
895 |
$select['selected'] = ! empty( $selected ) ? $current['show_in_menu'] : '';
|
896 |
-
echo $ui->get_select_input(
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
|
|
|
|
903 |
|
904 |
$select = [
|
905 |
'options' => [
|
@@ -916,13 +999,15 @@ function cptui_manage_taxonomies() {
|
|
916 |
];
|
917 |
$selected = ( isset( $current ) && ! empty( $current['show_in_nav_menus'] ) ) ? disp_boolean( $current['show_in_nav_menus'] ) : '';
|
918 |
$select['selected'] = ! empty( $selected ) ? $current['show_in_nav_menus'] : '';
|
919 |
-
echo $ui->get_select_input(
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
|
|
|
|
926 |
|
927 |
$select = [
|
928 |
'options' => [
|
@@ -939,22 +1024,26 @@ function cptui_manage_taxonomies() {
|
|
939 |
];
|
940 |
$selected = isset( $current ) ? disp_boolean( $current['query_var'] ) : '';
|
941 |
$select['selected'] = ! empty( $selected ) ? $current['query_var'] : '';
|
942 |
-
echo $ui->get_select_input(
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
|
|
|
|
|
|
|
|
958 |
|
959 |
$select = [
|
960 |
'options' => [
|
@@ -971,22 +1060,26 @@ function cptui_manage_taxonomies() {
|
|
971 |
];
|
972 |
$selected = isset( $current ) ? disp_boolean( $current['rewrite'] ) : '';
|
973 |
$select['selected'] = ! empty( $selected ) ? $current['rewrite'] : '';
|
974 |
-
echo $ui->get_select_input(
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
|
|
|
|
|
|
|
|
990 |
|
991 |
$select = [
|
992 |
'options' => [
|
@@ -1003,13 +1096,15 @@ function cptui_manage_taxonomies() {
|
|
1003 |
];
|
1004 |
$selected = isset( $current ) ? disp_boolean( $current['rewrite_withfront'] ) : '';
|
1005 |
$select['selected'] = ! empty( $selected ) ? $current['rewrite_withfront'] : '';
|
1006 |
-
echo $ui->get_select_input(
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
|
|
|
|
1013 |
|
1014 |
$select = [
|
1015 |
'options' => [
|
@@ -1026,13 +1121,15 @@ function cptui_manage_taxonomies() {
|
|
1026 |
];
|
1027 |
$selected = isset( $current ) ? disp_boolean( $current['rewrite_hierarchical'] ) : '';
|
1028 |
$select['selected'] = ! empty( $selected ) ? $current['rewrite_hierarchical'] : '';
|
1029 |
-
echo $ui->get_select_input(
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
|
|
|
|
1036 |
|
1037 |
$select = [
|
1038 |
'options' => [
|
@@ -1049,19 +1146,21 @@ function cptui_manage_taxonomies() {
|
|
1049 |
];
|
1050 |
$selected = isset( $current ) ? disp_boolean( $current['show_admin_column'] ) : '';
|
1051 |
$select['selected'] = ! empty( $selected ) ? $current['show_admin_column'] : '';
|
1052 |
-
echo $ui->get_select_input(
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
|
|
|
|
1059 |
|
1060 |
$select = [
|
1061 |
'options' => [
|
1062 |
[
|
1063 |
-
'attr'
|
1064 |
-
'text'
|
1065 |
],
|
1066 |
[
|
1067 |
'attr' => '1',
|
@@ -1072,37 +1171,45 @@ function cptui_manage_taxonomies() {
|
|
1072 |
];
|
1073 |
$selected = isset( $current ) ? disp_boolean( $current['show_in_rest'] ) : '';
|
1074 |
$select['selected'] = ! empty( $selected ) ? $current['show_in_rest'] : '';
|
1075 |
-
echo $ui->get_select_input(
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1106 |
|
1107 |
$select = [
|
1108 |
'options' => [
|
@@ -1119,13 +1226,15 @@ function cptui_manage_taxonomies() {
|
|
1119 |
];
|
1120 |
$selected = ( isset( $current ) && ! empty( $current['show_tagcloud'] ) ) ? disp_boolean( $current['show_tagcloud'] ) : '';
|
1121 |
$select['selected'] = ! empty( $selected ) ? $current['show_tagcloud'] : '';
|
1122 |
-
echo $ui->get_select_input(
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
|
|
|
|
1129 |
|
1130 |
$select = [
|
1131 |
'options' => [
|
@@ -1142,52 +1251,60 @@ function cptui_manage_taxonomies() {
|
|
1142 |
];
|
1143 |
$selected = ( isset( $current ) && ! empty( $current['show_in_quick_edit'] ) ) ? disp_boolean( $current['show_in_quick_edit'] ) : '';
|
1144 |
$select['selected'] = ! empty( $selected ) ? $current['show_in_quick_edit'] : '';
|
1145 |
-
echo $ui->get_select_input(
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
|
|
|
|
1152 |
|
1153 |
$select = [
|
1154 |
'options' => [
|
1155 |
[
|
1156 |
-
'attr'
|
1157 |
-
'text'
|
1158 |
'default' => 'false',
|
1159 |
],
|
1160 |
[
|
1161 |
-
'attr'
|
1162 |
-
'text'
|
1163 |
],
|
1164 |
],
|
1165 |
];
|
1166 |
$selected = ( isset( $current ) && ! empty( $current['sort'] ) ) ? disp_boolean( $current['sort'] ) : '';
|
1167 |
$select['selected'] = ! empty( $selected ) ? $current['sort'] : '';
|
1168 |
-
echo $ui->get_select_input(
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1191 |
?>
|
1192 |
</table>
|
1193 |
</div>
|
@@ -1208,9 +1325,7 @@ function cptui_manage_taxonomies() {
|
|
1208 |
<p class="submit">
|
1209 |
<?php
|
1210 |
wp_nonce_field( 'cptui_addedit_taxonomy_nonce_action', 'cptui_addedit_taxonomy_nonce_field' );
|
1211 |
-
if ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) {
|
1212 |
-
<?php
|
1213 |
-
|
1214 |
/**
|
1215 |
* Filters the text value to use on the button when editing.
|
1216 |
*
|
@@ -1247,7 +1362,7 @@ function cptui_manage_taxonomies() {
|
|
1247 |
|
1248 |
<?php if ( ! empty( $current ) ) { ?>
|
1249 |
<input type="hidden" name="tax_original" id="tax_original" value="<?php echo esc_attr( $current['name'] ); ?>" />
|
1250 |
-
|
1251 |
}
|
1252 |
|
1253 |
// Used to check and see if we should prevent duplicate slugs.
|
@@ -1258,7 +1373,7 @@ function cptui_manage_taxonomies() {
|
|
1258 |
</div>
|
1259 |
</form>
|
1260 |
</div><!-- End .wrap -->
|
1261 |
-
<?php
|
1262 |
}
|
1263 |
|
1264 |
/**
|
@@ -1297,12 +1412,14 @@ function cptui_taxonomies_dropdown( $taxonomies = [] ) {
|
|
1297 |
*/
|
1298 |
$select = apply_filters( 'cptui_taxonomies_dropdown_options', $select, $taxonomies );
|
1299 |
|
1300 |
-
echo $ui->get_select_input(
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
|
|
|
|
1306 |
}
|
1307 |
}
|
1308 |
|
@@ -1325,21 +1442,21 @@ function cptui_get_current_taxonomy( $taxonomy_deleted = false ) {
|
|
1325 |
check_admin_referer( 'cptui_select_taxonomy_nonce_action', 'cptui_select_taxonomy_nonce_field' );
|
1326 |
}
|
1327 |
if ( isset( $_POST['cptui_selected_taxonomy']['taxonomy'] ) ) {
|
1328 |
-
$tax = sanitize_text_field( $_POST['cptui_selected_taxonomy']['taxonomy'] );
|
1329 |
} elseif ( $taxonomy_deleted ) {
|
1330 |
$taxonomies = cptui_get_taxonomy_data();
|
1331 |
$tax = key( $taxonomies );
|
1332 |
} elseif ( isset( $_POST['cpt_custom_tax']['name'] ) ) {
|
1333 |
// Return the submitted value.
|
1334 |
if ( ! in_array( $_POST['cpt_custom_tax']['name'], cptui_reserved_taxonomies(), true ) ) {
|
1335 |
-
$tax = sanitize_text_field( $_POST['cpt_custom_tax']['name'] );
|
1336 |
} else {
|
1337 |
// Return the original value since user tried to submit a reserved term.
|
1338 |
-
$tax = sanitize_text_field( $_POST['tax_original'] );
|
1339 |
}
|
1340 |
}
|
1341 |
} elseif ( ! empty( $_GET ) && isset( $_GET['cptui_taxonomy'] ) ) {
|
1342 |
-
$tax = sanitize_text_field( $_GET['cptui_taxonomy'] );
|
1343 |
} else {
|
1344 |
$taxonomies = cptui_get_taxonomy_data();
|
1345 |
if ( ! empty( $taxonomies ) ) {
|
@@ -1405,7 +1522,7 @@ function cptui_delete_taxonomy( $data = [] ) {
|
|
1405 |
* @param array $taxonomies Array of our updated taxonomies data.
|
1406 |
* @param array $data Array of submitted taxonomy to update.
|
1407 |
*/
|
1408 |
-
if ( false === ( $success = apply_filters( 'cptui_taxonomy_delete_tax', false, $taxonomies, $data ) ) ) {
|
1409 |
$success = update_option( 'cptui_taxonomies', $taxonomies );
|
1410 |
}
|
1411 |
}
|
@@ -1593,7 +1710,7 @@ function cptui_update_taxonomy( $data = [] ) {
|
|
1593 |
* @param array $taxonomies Array of our updated taxonomies data.
|
1594 |
* @param array $data Array of submitted taxonomy to update.
|
1595 |
*/
|
1596 |
-
if ( false === ( $success = apply_filters( 'cptui_taxonomy_update_save', false, $taxonomies, $data ) ) ) {
|
1597 |
$success = update_option( 'cptui_taxonomies', $taxonomies );
|
1598 |
}
|
1599 |
|
@@ -1768,8 +1885,8 @@ function cptui_convert_taxonomy_terms( $original_slug = '', $new_slug = '' ) {
|
|
1768 |
|
1769 |
$query = "UPDATE `{$wpdb->term_taxonomy}` SET `taxonomy` = %s WHERE `taxonomy` = %s AND `term_id` IN ( {$term_ids} )";
|
1770 |
|
1771 |
-
$wpdb->query(
|
1772 |
-
$wpdb->prepare( $query, $new_slug, $original_slug )
|
1773 |
);
|
1774 |
}
|
1775 |
cptui_delete_taxonomy( $original_slug );
|
@@ -1794,20 +1911,31 @@ function cptui_check_existing_taxonomy_slugs( $slug_exists = false, $taxonomy_sl
|
|
1794 |
}
|
1795 |
|
1796 |
// Check if CPTUI has already registered this slug.
|
1797 |
-
if ( array_key_exists( strtolower( $taxonomy_slug ), $taxonomies ) ) {
|
1798 |
return true;
|
1799 |
}
|
1800 |
|
1801 |
// Check if we're registering a reserved post type slug.
|
1802 |
-
if ( in_array( $taxonomy_slug, cptui_reserved_taxonomies() ) ) {
|
1803 |
return true;
|
1804 |
}
|
1805 |
|
1806 |
// Check if other plugins have registered this same slug.
|
1807 |
-
$public = get_taxonomies(
|
1808 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1809 |
$registered_taxonomies = array_merge( $public, $private );
|
1810 |
-
if ( in_array( $taxonomy_slug, $registered_taxonomies ) ) {
|
1811 |
return true;
|
1812 |
}
|
1813 |
|
@@ -1845,7 +1973,7 @@ function cptui_process_taxonomy() {
|
|
1845 |
check_admin_referer( 'cptui_addedit_taxonomy_nonce_action', 'cptui_addedit_taxonomy_nonce_field' );
|
1846 |
|
1847 |
$filtered_data = filter_input( INPUT_POST, 'cpt_custom_tax', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
1848 |
-
$result
|
1849 |
add_filter( 'cptui_taxonomy_deleted', '__return_true' );
|
1850 |
}
|
1851 |
|
@@ -1909,9 +2037,9 @@ add_action( 'init', 'cptui_do_convert_taxonomy_terms' );
|
|
1909 |
*/
|
1910 |
function cptui_updated_taxonomy_slug_exists( $slug_exists, $taxonomy_slug = '', $taxonomies = [] ) {
|
1911 |
if (
|
1912 |
-
( ! empty( $_POST['cpt_tax_status'] ) && 'edit' === $_POST['cpt_tax_status'] ) &&
|
1913 |
-
! in_array( $taxonomy_slug, cptui_reserved_taxonomies(), true ) &&
|
1914 |
-
( ! empty( $_POST['tax_original'] ) && $taxonomy_slug === $_POST['tax_original'] )
|
1915 |
) {
|
1916 |
$slug_exists = false;
|
1917 |
}
|
@@ -1936,7 +2064,7 @@ function cptui_filtered_taxonomy_post_global() {
|
|
1936 |
'cpt_tax_labels',
|
1937 |
'cpt_post_types',
|
1938 |
'update_taxonomy',
|
1939 |
-
|
1940 |
) {
|
1941 |
$first_result = filter_input( INPUT_POST, $item, FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
1942 |
|
@@ -1949,7 +2077,7 @@ function cptui_filtered_taxonomy_post_global() {
|
|
1949 |
[
|
1950 |
'tax_original',
|
1951 |
'cpt_tax_status',
|
1952 |
-
|
1953 |
) {
|
1954 |
$second_result = filter_input( INPUT_POST, $item, FILTER_SANITIZE_STRING );
|
1955 |
if ( $second_result ) {
|
38 |
wp_enqueue_script( 'cptui' );
|
39 |
wp_enqueue_style( 'cptui-css' );
|
40 |
|
41 |
+
$core = get_taxonomies(
|
42 |
+
[
|
43 |
+
'_builtin' => true,
|
44 |
+
]
|
45 |
+
);
|
46 |
+
$public = get_taxonomies(
|
47 |
+
[
|
48 |
+
'_builtin' => false,
|
49 |
+
'public' => true,
|
50 |
+
]
|
51 |
+
);
|
52 |
+
$private = get_taxonomies(
|
53 |
+
[
|
54 |
+
'_builtin' => false,
|
55 |
+
'public' => false,
|
56 |
+
]
|
57 |
+
);
|
58 |
+
|
59 |
$registered_taxonomies = array_merge( $core, $public, $private );
|
60 |
+
|
61 |
+
wp_localize_script(
|
62 |
+
'cptui',
|
63 |
+
'cptui_tax_data',
|
64 |
[
|
65 |
'confirm' => esc_html__( 'Are you sure you want to delete this? Deleting will NOT remove created content.', 'custom-post-type-ui' ),
|
66 |
'no_associated_type' => esc_html__( 'Please select a post type to associate with.', 'custom-post-type-ui' ),
|
144 |
*/
|
145 |
function cptui_manage_taxonomies() {
|
146 |
|
147 |
+
$tab = ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' == $_GET['action'] ) ? 'edit' : 'new'; // phpcs:ignore.
|
148 |
$tab_class = 'cptui-' . $tab;
|
149 |
$current = null;
|
150 |
?>
|
211 |
?>
|
212 |
<input type="submit" class="button-secondary" id="cptui_select_taxonomy_submit" name="cptui_select_taxonomy_submit" value="<?php echo esc_attr( apply_filters( 'cptui_taxonomy_submit_select', esc_attr__( 'Select', 'custom-post-type-ui' ) ) ); ?>" />
|
213 |
</form>
|
214 |
+
<?php
|
215 |
|
216 |
/**
|
217 |
* Fires below the taxonomy select input.
|
243 |
<div class="main">
|
244 |
<table class="form-table cptui-table">
|
245 |
<?php
|
246 |
+
echo $ui->get_tr_start() . $ui->get_th_start(); // phpcs:ignore.
|
247 |
+
echo $ui->get_label( 'name', esc_html__( 'Taxonomy Slug', 'custom-post-type-ui' ) ) . $ui->get_required_span(); // phpcs:ignore.
|
248 |
|
249 |
if ( 'edit' === $tab ) {
|
250 |
echo '<p id="slugchanged" class="hidemessage">' . esc_html__( 'Slug has changed', 'custom-post-type-ui' ) . '<span class="dashicons dashicons-warning"></span></p>';
|
251 |
}
|
252 |
echo '<p id="slugexists" class="hidemessage">' . esc_html__( 'Slug already exists', 'custom-post-type-ui' ) . '<span class="dashicons dashicons-warning"></span></p>';
|
253 |
|
254 |
+
echo $ui->get_th_end() . $ui->get_td_start(); // phpcs:ignore.
|
255 |
+
|
256 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
257 |
+
[
|
258 |
+
'namearray' => 'cpt_custom_tax',
|
259 |
+
'name' => 'name',
|
260 |
+
'textvalue' => isset( $current['name'] ) ? esc_attr( $current['name'] ) : '', // phpcs:ignore.
|
261 |
+
'maxlength' => '32',
|
262 |
+
'helptext' => esc_attr__( 'The taxonomy name/slug. Used for various queries for taxonomy content.', 'custom-post-type-ui' ),
|
263 |
+
'required' => true,
|
264 |
+
'placeholder' => false,
|
265 |
+
'wrap' => false,
|
266 |
+
]
|
267 |
+
);
|
268 |
|
269 |
echo '<p class="cptui-slug-details">';
|
270 |
esc_html_e( 'Slugs should only contain alphanumeric, latin characters. Underscores should be used in place of spaces. Set "Custom Rewrite Slug" field to make slug use dashes for URLs.', 'custom-post-type-ui' );
|
276 |
echo '</p>';
|
277 |
|
278 |
echo '<div class="cptui-spacer">';
|
279 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
280 |
+
[
|
281 |
+
'checkvalue' => 'update_taxonomy',
|
282 |
+
'checked' => 'false',
|
283 |
+
'name' => 'update_taxonomy',
|
284 |
+
'namearray' => 'update_taxonomy',
|
285 |
+
'labeltext' => esc_html__( 'Migrate terms to newly renamed taxonomy?', 'custom-post-type-ui' ),
|
286 |
+
'helptext' => '',
|
287 |
+
'default' => false,
|
288 |
+
'wrap' => false,
|
289 |
+
]
|
290 |
+
);
|
291 |
echo '</div>';
|
292 |
}
|
293 |
|
294 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
295 |
+
[
|
296 |
+
'namearray' => 'cpt_custom_tax',
|
297 |
+
'name' => 'label',
|
298 |
+
'textvalue' => isset( $current['label'] ) ? esc_attr( $current['label'] ) : '', // phpcs:ignore.
|
299 |
+
'aftertext' => esc_html__( '(e.g. Actors)', 'custom-post-type-ui' ),
|
300 |
+
'labeltext' => esc_html__( 'Plural Label', 'custom-post-type-ui' ),
|
301 |
+
'helptext' => esc_attr__( 'Used for the taxonomy admin menu item.', 'custom-post-type-ui' ),
|
302 |
+
'required' => true,
|
303 |
+
]
|
304 |
+
);
|
305 |
+
|
306 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
307 |
+
[
|
308 |
+
'namearray' => 'cpt_custom_tax',
|
309 |
+
'name' => 'singular_label',
|
310 |
+
'textvalue' => isset( $current['singular_label'] ) ? esc_attr( $current['singular_label'] ) : '', // phpcs:ignore.
|
311 |
+
'aftertext' => esc_html__( '(e.g. Actor)', 'custom-post-type-ui' ),
|
312 |
+
'labeltext' => esc_html__( 'Singular Label', 'custom-post-type-ui' ),
|
313 |
+
'helptext' => esc_attr__( 'Used when a singular label is needed.', 'custom-post-type-ui' ),
|
314 |
+
'required' => true,
|
315 |
+
]
|
316 |
+
);
|
317 |
+
echo $ui->get_td_end() . $ui->get_tr_end(); // phpcs:ignore.
|
318 |
|
319 |
$link_text = ( 'new' === $tab ) ?
|
320 |
esc_html__( 'Populate additional labels based on chosen labels', 'custom-post-type-ui' ) :
|
321 |
esc_html__( 'Populate missing labels based on chosen labels', 'custom-post-type-ui' );
|
322 |
+
echo $ui->get_tr_end(); // phpcs:ignore.
|
323 |
+
echo $ui->get_th_start() . esc_html__( 'Auto-populate labels', 'custom-post-type-ui' ) . $ui->get_th_end(); // phpcs:ignore.
|
324 |
+
echo $ui->get_td_start(); // phpcs:ignore.
|
325 |
|
326 |
+
?>
|
327 |
+
<a href="#" id="auto-populate"><?php echo esc_html( $link_text ); ?></a> |
|
328 |
<a href="#" id="auto-clear"><?php esc_html_e( 'Clear labels', 'custom-post-type-ui' ); ?></a>
|
329 |
<?php
|
330 |
|
331 |
+
echo $ui->get_td_end() . $ui->get_tr_end(); // phpcs:ignore.
|
332 |
|
333 |
+
echo $ui->get_tr_start() . $ui->get_th_start() . esc_html__( 'Attach to Post Type', 'custom-post-type-ui' ) . $ui->get_required_span(); // phpcs:ignore.
|
334 |
+
echo $ui->get_p( esc_html__( 'Add support for available registered post types. At least one is required. Only public post types listed by default.', 'custom-post-type-ui' ) ); // phpcs:ignore.
|
335 |
+
echo $ui->get_th_end() . $ui->get_td_start() . $ui->get_fieldset_start(); // phpcs:ignore.
|
336 |
|
337 |
+
echo $ui->get_legend_start() . esc_html__( 'Post type options', 'custom-post-type-ui' ) . $ui->get_legend_end(); // phpcs:ignore.
|
338 |
|
339 |
+
/**
|
340 |
+
* Filters the arguments for post types to list for taxonomy association.
|
341 |
+
*
|
342 |
+
* @since 1.0.0
|
343 |
+
*
|
344 |
+
* @param array $value Array of default arguments.
|
345 |
+
*/
|
346 |
+
$args = apply_filters( 'cptui_attach_post_types_to_taxonomy', [ 'public' => true ] );
|
347 |
|
348 |
+
// If they don't return an array, fall back to the original default. Don't need to check for empty, because empty array is default for $args param in get_post_types anyway.
|
349 |
+
if ( ! is_array( $args ) ) {
|
350 |
+
$args = [ 'public' => true ];
|
351 |
+
}
|
352 |
+
$output = 'objects'; // Or objects.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
353 |
|
354 |
+
/**
|
355 |
+
* Filters the results returned to display for available post types for taxonomy.
|
356 |
+
*
|
357 |
+
* @since 1.3.0
|
358 |
+
*
|
359 |
+
* @param array $value Array of post type objects.
|
360 |
+
* @param array $args Array of arguments for the post type query.
|
361 |
+
* @param string $output The output type we want for the results.
|
362 |
+
*/
|
363 |
+
$post_types = apply_filters( 'cptui_get_post_types_for_taxonomies', get_post_types( $args, $output ), $args, $output );
|
364 |
+
|
365 |
+
foreach ( $post_types as $post_type ) {
|
366 |
+
$core_label = in_array(
|
367 |
+
$post_type->name,
|
368 |
+
[
|
369 |
+
'post',
|
370 |
+
'page',
|
371 |
+
'attachment',
|
372 |
+
],
|
373 |
+
true
|
374 |
+
) ? esc_html__( '(WP Core)', 'custom-post-type-ui' ) : '';
|
375 |
+
echo $ui->get_check_input( // phpcs:ignore.
|
376 |
+
[
|
377 |
+
'checkvalue' => $post_type->name,
|
378 |
+
'checked' => ( ! empty( $current['object_types'] ) && is_array( $current['object_types'] ) && in_array( $post_type->name, $current['object_types'], true ) ) ? 'true' : 'false', // phpcs:ignore.
|
379 |
+
'name' => esc_attr( $post_type->name ),
|
380 |
+
'namearray' => 'cpt_post_types',
|
381 |
+
'textvalue' => esc_attr( $post_type->name ),
|
382 |
+
'labeltext' => "{$post_type->label} {$core_label}", // phpcs:ignore.
|
383 |
+
'wrap' => false,
|
384 |
+
]
|
385 |
+
);
|
386 |
+
}
|
387 |
+
|
388 |
+
echo $ui->get_fieldset_end() . $ui->get_td_end() . $ui->get_tr_end(); // phpcs:ignore.
|
389 |
+
?>
|
390 |
</table>
|
391 |
<p class="submit">
|
392 |
<?php
|
393 |
wp_nonce_field( 'cptui_addedit_taxonomy_nonce_action', 'cptui_addedit_taxonomy_nonce_field' );
|
394 |
+
if ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) { // phpcs:ignore.
|
395 |
|
396 |
/**
|
397 |
* Filters the text value to use on the button when editing.
|
429 |
|
430 |
<?php if ( ! empty( $current ) ) { ?>
|
431 |
<input type="hidden" name="tax_original" id="tax_original" value="<?php echo esc_attr( $current['name'] ); ?>" />
|
432 |
+
<?php
|
433 |
}
|
434 |
|
435 |
// Used to check and see if we should prevent duplicate slugs.
|
459 |
if ( isset( $current['description'] ) ) {
|
460 |
$current['description'] = stripslashes_deep( $current['description'] );
|
461 |
}
|
462 |
+
echo $ui->get_textarea_input( // phpcs:ignore.
|
463 |
+
[
|
464 |
+
'namearray' => 'cpt_custom_tax',
|
465 |
+
'name' => 'description',
|
466 |
+
'rows' => '4',
|
467 |
+
'cols' => '40',
|
468 |
+
'textvalue' => isset( $current['description'] ) ? esc_textarea( $current['description'] ) : '', // phpcs:ignore.
|
469 |
+
'labeltext' => esc_html__( 'Description', 'custom-post-type-ui' ),
|
470 |
+
'helptext' => esc_attr__( 'Describe what your taxonomy is used for.', 'custom-post-type-ui' ),
|
471 |
+
]
|
472 |
+
);
|
473 |
+
|
474 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
475 |
+
[
|
476 |
+
'namearray' => 'cpt_tax_labels',
|
477 |
+
'name' => 'menu_name',
|
478 |
+
'textvalue' => isset( $current['labels']['menu_name'] ) ? esc_attr( $current['labels']['menu_name'] ) : '', // phpcs:ignore.
|
479 |
+
'aftertext' => esc_attr__( '(e.g. Actors)', 'custom-post-type-ui' ),
|
480 |
+
'labeltext' => esc_html__( 'Menu Name', 'custom-post-type-ui' ),
|
481 |
+
'helptext' => esc_html__( 'Custom admin menu name for your taxonomy.', 'custom-post-type-ui' ),
|
482 |
+
'data' => [
|
483 |
+
'label' => 'item', // Not localizing because it's isolated.
|
484 |
+
'plurality' => 'plural',
|
485 |
+
],
|
486 |
+
]
|
487 |
+
);
|
488 |
+
|
489 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
490 |
+
[
|
491 |
+
'namearray' => 'cpt_tax_labels',
|
492 |
+
'name' => 'all_items',
|
493 |
+
'textvalue' => isset( $current['labels']['all_items'] ) ? esc_attr( $current['labels']['all_items'] ) : '', // phpcs:ignore.
|
494 |
+
'aftertext' => esc_attr__( '(e.g. All Actors)', 'custom-post-type-ui' ),
|
495 |
+
'labeltext' => esc_html__( 'All Items', 'custom-post-type-ui' ),
|
496 |
+
'helptext' => esc_html__( 'Used as tab text when showing all terms for hierarchical taxonomy while editing post.', 'custom-post-type-ui' ),
|
497 |
+
'data' => [
|
498 |
+
/* translators: Used for autofill */
|
499 |
+
'label' => sprintf( esc_attr__( 'All %s', 'custom-post-type-ui' ), 'item' ),
|
500 |
+
'plurality' => 'plural',
|
501 |
+
],
|
502 |
+
]
|
503 |
+
);
|
504 |
+
|
505 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
506 |
+
[
|
507 |
+
'namearray' => 'cpt_tax_labels',
|
508 |
+
'name' => 'edit_item',
|
509 |
+
'textvalue' => isset( $current['labels']['edit_item'] ) ? esc_attr( $current['labels']['edit_item'] ) : '', // phpcs:ignore.
|
510 |
+
'aftertext' => esc_attr__( '(e.g. Edit Actor)', 'custom-post-type-ui' ),
|
511 |
+
'labeltext' => esc_html__( 'Edit Item', 'custom-post-type-ui' ),
|
512 |
+
'helptext' => esc_html__( 'Used at the top of the term editor screen for an existing taxonomy term.', 'custom-post-type-ui' ),
|
513 |
+
'data' => [
|
514 |
+
/* translators: Used for autofill */
|
515 |
+
'label' => sprintf( esc_attr__( 'Edit %s', 'custom-post-type-ui' ), 'item' ),
|
516 |
+
'plurality' => 'singular',
|
517 |
+
],
|
518 |
+
]
|
519 |
+
);
|
520 |
+
|
521 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
522 |
+
[
|
523 |
+
'namearray' => 'cpt_tax_labels',
|
524 |
+
'name' => 'view_item',
|
525 |
+
'textvalue' => isset( $current['labels']['view_item'] ) ? esc_attr( $current['labels']['view_item'] ) : '', // phpcs:ignore.
|
526 |
+
'aftertext' => esc_attr__( '(e.g. View Actor)', 'custom-post-type-ui' ),
|
527 |
+
'labeltext' => esc_html__( 'View Item', 'custom-post-type-ui' ),
|
528 |
+
'helptext' => esc_html__( 'Used in the admin bar when viewing editor screen for an existing taxonomy term.', 'custom-post-type-ui' ),
|
529 |
+
'data' => [
|
530 |
+
/* translators: Used for autofill */
|
531 |
+
'label' => sprintf( esc_attr__( 'View %s', 'custom-post-type-ui' ), 'item' ),
|
532 |
+
'plurality' => 'singular',
|
533 |
+
],
|
534 |
+
]
|
535 |
+
);
|
536 |
+
|
537 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
538 |
+
[
|
539 |
+
'namearray' => 'cpt_tax_labels',
|
540 |
+
'name' => 'update_item',
|
541 |
+
'textvalue' => isset( $current['labels']['update_item'] ) ? esc_attr( $current['labels']['update_item'] ) : '', // phpcs:ignore.
|
542 |
+
'aftertext' => esc_attr__( '(e.g. Update Actor Name)', 'custom-post-type-ui' ),
|
543 |
+
'labeltext' => esc_html__( 'Update Item Name', 'custom-post-type-ui' ),
|
544 |
+
'helptext' => esc_html__( 'Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'custom-post-type-ui' ),
|
545 |
+
'data' => [
|
546 |
+
/* translators: Used for autofill */
|
547 |
+
'label' => sprintf( esc_attr__( 'Update %s name', 'custom-post-type-ui' ), 'item' ),
|
548 |
+
'plurality' => 'singular',
|
549 |
+
],
|
550 |
+
]
|
551 |
+
);
|
552 |
+
|
553 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
554 |
+
[
|
555 |
+
'namearray' => 'cpt_tax_labels',
|
556 |
+
'name' => 'add_new_item',
|
557 |
+
'textvalue' => isset( $current['labels']['add_new_item'] ) ? esc_attr( $current['labels']['add_new_item'] ) : '', // phpcs:ignore.
|
558 |
+
'aftertext' => esc_attr__( '(e.g. Add New Actor)', 'custom-post-type-ui' ),
|
559 |
+
'labeltext' => esc_html__( 'Add New Item', 'custom-post-type-ui' ),
|
560 |
+
'helptext' => esc_html__( 'Used at the top of the term editor screen and button text for a new taxonomy term.', 'custom-post-type-ui' ),
|
561 |
+
'data' => [
|
562 |
+
/* translators: Used for autofill */
|
563 |
+
'label' => sprintf( esc_attr__( 'Add new %s', 'custom-post-type-ui' ), 'item' ),
|
564 |
+
'plurality' => 'singular',
|
565 |
+
],
|
566 |
+
]
|
567 |
+
);
|
568 |
+
|
569 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
570 |
+
[
|
571 |
+
'namearray' => 'cpt_tax_labels',
|
572 |
+
'name' => 'new_item_name',
|
573 |
+
'textvalue' => isset( $current['labels']['new_item_name'] ) ? esc_attr( $current['labels']['new_item_name'] ) : '', // phpcs:ignore.
|
574 |
+
'aftertext' => esc_attr__( '(e.g. New Actor Name)', 'custom-post-type-ui' ),
|
575 |
+
'labeltext' => esc_html__( 'New Item Name', 'custom-post-type-ui' ),
|
576 |
+
'helptext' => esc_html__( 'Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'custom-post-type-ui' ),
|
577 |
+
'data' => [
|
578 |
+
/* translators: Used for autofill */
|
579 |
+
'label' => sprintf( esc_attr__( 'New %s name', 'custom-post-type-ui' ), 'item' ),
|
580 |
+
'plurality' => 'singular',
|
581 |
+
],
|
582 |
+
]
|
583 |
+
);
|
584 |
+
|
585 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
586 |
+
[
|
587 |
+
'namearray' => 'cpt_tax_labels',
|
588 |
+
'name' => 'parent_item',
|
589 |
+
'textvalue' => isset( $current['labels']['parent_item'] ) ? esc_attr( $current['labels']['parent_item'] ) : '', // phpcs:ignore.
|
590 |
+
'aftertext' => esc_attr__( '(e.g. Parent Actor)', 'custom-post-type-ui' ),
|
591 |
+
'labeltext' => esc_html__( 'Parent Item', 'custom-post-type-ui' ),
|
592 |
+
'helptext' => esc_html__( 'Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'custom-post-type-ui' ),
|
593 |
+
'data' => [
|
594 |
+
/* translators: Used for autofill */
|
595 |
+
'label' => sprintf( esc_attr__( 'Parent %s', 'custom-post-type-ui' ), 'item' ),
|
596 |
+
'plurality' => 'singular',
|
597 |
+
],
|
598 |
+
]
|
599 |
+
);
|
600 |
+
|
601 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
602 |
+
[
|
603 |
+
'namearray' => 'cpt_tax_labels',
|
604 |
+
'name' => 'parent_item_colon',
|
605 |
+
'textvalue' => isset( $current['labels']['parent_item_colon'] ) ? esc_attr( $current['labels']['parent_item_colon'] ) : '', // phpcs:ignore.
|
606 |
+
'aftertext' => esc_attr__( '(e.g. Parent Actor:)', 'custom-post-type-ui' ),
|
607 |
+
'labeltext' => esc_html__( 'Parent Item Colon', 'custom-post-type-ui' ),
|
608 |
+
'helptext' => esc_html__( 'Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'custom-post-type-ui' ),
|
609 |
+
'data' => [
|
610 |
+
/* translators: Used for autofill */
|
611 |
+
'label' => sprintf( esc_attr__( 'Parent %s:', 'custom-post-type-ui' ), 'item' ),
|
612 |
+
'plurality' => 'singular',
|
613 |
+
],
|
614 |
+
]
|
615 |
+
);
|
616 |
+
|
617 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
618 |
+
[
|
619 |
+
'namearray' => 'cpt_tax_labels',
|
620 |
+
'name' => 'search_items',
|
621 |
+
'textvalue' => isset( $current['labels']['search_items'] ) ? esc_attr( $current['labels']['search_items'] ) : '', // phpcs:ignore.
|
622 |
+
'aftertext' => esc_attr__( '(e.g. Search Actors)', 'custom-post-type-ui' ),
|
623 |
+
'labeltext' => esc_html__( 'Search Items', 'custom-post-type-ui' ),
|
624 |
+
'helptext' => esc_html__( 'Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'custom-post-type-ui' ),
|
625 |
+
'data' => [
|
626 |
+
/* translators: Used for autofill */
|
627 |
+
'label' => sprintf( esc_attr__( 'Search %s', 'custom-post-type-ui' ), 'item' ),
|
628 |
+
'plurality' => 'plural',
|
629 |
+
],
|
630 |
+
]
|
631 |
+
);
|
632 |
+
|
633 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
634 |
+
[
|
635 |
+
'namearray' => 'cpt_tax_labels',
|
636 |
+
'name' => 'popular_items',
|
637 |
+
'textvalue' => isset( $current['labels']['popular_items'] ) ? esc_attr( $current['labels']['popular_items'] ) : null, // phpcs:ignore.
|
638 |
+
'aftertext' => esc_attr__( '(e.g. Popular Actors)', 'custom-post-type-ui' ),
|
639 |
+
'labeltext' => esc_html__( 'Popular Items', 'custom-post-type-ui' ),
|
640 |
+
'helptext' => esc_html__( 'Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'custom-post-type-ui' ),
|
641 |
+
'data' => [
|
642 |
+
/* translators: Used for autofill */
|
643 |
+
'label' => sprintf( esc_attr__( 'Popular %s', 'custom-post-type-ui' ), 'item' ),
|
644 |
+
'plurality' => 'plural',
|
645 |
+
],
|
646 |
+
]
|
647 |
+
);
|
648 |
+
|
649 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
650 |
+
[
|
651 |
+
'namearray' => 'cpt_tax_labels',
|
652 |
+
'name' => 'separate_items_with_commas',
|
653 |
+
'textvalue' => isset( $current['labels']['separate_items_with_commas'] ) ? esc_attr( $current['labels']['separate_items_with_commas'] ) : null, // phpcs:ignore.
|
654 |
+
'aftertext' => esc_attr__( '(e.g. Separate Actors with commas)', 'custom-post-type-ui' ),
|
655 |
+
'labeltext' => esc_html__( 'Separate Items with Commas', 'custom-post-type-ui' ),
|
656 |
+
'helptext' => esc_html__( 'Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'custom-post-type-ui' ),
|
657 |
+
'data' => [
|
658 |
+
/* translators: Used for autofill */
|
659 |
+
'label' => sprintf( esc_attr__( 'Separate %s with commas', 'custom-post-type-ui' ), 'item' ),
|
660 |
+
'plurality' => 'plural',
|
661 |
+
],
|
662 |
+
]
|
663 |
+
);
|
664 |
+
|
665 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
666 |
+
[
|
667 |
+
'namearray' => 'cpt_tax_labels',
|
668 |
+
'name' => 'add_or_remove_items',
|
669 |
+
'textvalue' => isset( $current['labels']['add_or_remove_items'] ) ? esc_attr( $current['labels']['add_or_remove_items'] ) : null, // phpcs:ignore.
|
670 |
+
'aftertext' => esc_attr__( '(e.g. Add or remove Actors)', 'custom-post-type-ui' ),
|
671 |
+
'labeltext' => esc_html__( 'Add or Remove Items', 'custom-post-type-ui' ),
|
672 |
+
'helptext' => esc_html__( 'Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'custom-post-type-ui' ),
|
673 |
+
'data' => [
|
674 |
+
/* translators: Used for autofill */
|
675 |
+
'label' => sprintf( esc_attr__( 'Add or remove %s', 'custom-post-type-ui' ), 'item' ),
|
676 |
+
'plurality' => 'plural',
|
677 |
+
],
|
678 |
+
]
|
679 |
+
);
|
680 |
+
|
681 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
682 |
+
[
|
683 |
+
'namearray' => 'cpt_tax_labels',
|
684 |
+
'name' => 'choose_from_most_used',
|
685 |
+
'textvalue' => isset( $current['labels']['choose_from_most_used'] ) ? esc_attr( $current['labels']['choose_from_most_used'] ) : null, // phpcs:ignore.
|
686 |
+
'aftertext' => esc_attr__( '(e.g. Choose from the most used Actors)', 'custom-post-type-ui' ),
|
687 |
+
'labeltext' => esc_html__( 'Choose From Most Used', 'custom-post-type-ui' ),
|
688 |
+
'helptext' => esc_attr__( 'The text displayed via clicking ‘Choose from the most used items’ in the taxonomy meta box when no items are available.', 'custom-post-type-ui' ),
|
689 |
+
'data' => [
|
690 |
+
/* translators: Used for autofill */
|
691 |
+
'label' => sprintf( esc_attr__( 'Choose from the most used %s', 'custom-post-type-ui' ), 'item' ),
|
692 |
+
'plurality' => 'plural',
|
693 |
+
],
|
694 |
+
]
|
695 |
+
);
|
696 |
+
|
697 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
698 |
+
[
|
699 |
+
'namearray' => 'cpt_tax_labels',
|
700 |
+
'name' => 'not_found',
|
701 |
+
'textvalue' => isset( $current['labels']['not_found'] ) ? esc_attr( $current['labels']['not_found'] ) : null, // phpcs:ignore.
|
702 |
+
'aftertext' => esc_attr__( '(e.g. No Actors found)', 'custom-post-type-ui' ),
|
703 |
+
'labeltext' => esc_html__( 'Not found', 'custom-post-type-ui' ),
|
704 |
+
'helptext' => esc_html__( 'Used when indicating that there are no terms in the given taxonomy within the meta box and taxonomy list table.', 'custom-post-type-ui' ),
|
705 |
+
'data' => [
|
706 |
+
/* translators: Used for autofill */
|
707 |
+
'label' => sprintf( esc_attr__( 'No %s found', 'custom-post-type-ui' ), 'item' ),
|
708 |
+
'plurality' => 'plural',
|
709 |
+
],
|
710 |
+
]
|
711 |
+
);
|
712 |
+
|
713 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
714 |
+
[
|
715 |
+
'namearray' => 'cpt_tax_labels',
|
716 |
+
'name' => 'no_terms',
|
717 |
+
'textvalue' => isset( $current['labels']['no_terms'] ) ? esc_attr( $current['labels']['no_terms'] ) : null, // phpcs:ignore.
|
718 |
+
'aftertext' => esc_html__( '(e.g. No actors)', 'custom-post-type-ui' ),
|
719 |
+
'labeltext' => esc_html__( 'No terms', 'custom-post-type-ui' ),
|
720 |
+
'helptext' => esc_attr__( 'Used when indicating that there are no terms in the given taxonomy associated with an object.', 'custom-post-type-ui' ),
|
721 |
+
'data' => [
|
722 |
+
/* translators: Used for autofill */
|
723 |
+
'label' => sprintf( esc_attr__( 'No %s', 'custom-post-type-ui' ), 'item' ),
|
724 |
+
'plurality' => 'plural',
|
725 |
+
],
|
726 |
+
]
|
727 |
+
);
|
728 |
+
|
729 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
730 |
+
[
|
731 |
+
'namearray' => 'cpt_tax_labels',
|
732 |
+
'name' => 'items_list_navigation',
|
733 |
+
'textvalue' => isset( $current['labels']['items_list_navigation'] ) ? esc_attr( $current['labels']['items_list_navigation'] ) : null, // phpcs:ignore.
|
734 |
+
'aftertext' => esc_html__( '(e.g. Actors list navigation)', 'custom-post-type-ui' ),
|
735 |
+
'labeltext' => esc_html__( 'Items List Navigation', 'custom-post-type-ui' ),
|
736 |
+
'helptext' => esc_attr__( 'Screen reader text for the pagination heading on the term listing screen.', 'custom-post-type-ui' ),
|
737 |
+
'data' => [
|
738 |
+
/* translators: Used for autofill */
|
739 |
+
'label' => sprintf( esc_attr__( '%s list navigation', 'custom-post-type-ui' ), 'item' ),
|
740 |
+
'plurality' => 'plural',
|
741 |
+
],
|
742 |
+
]
|
743 |
+
);
|
744 |
+
|
745 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
746 |
+
[
|
747 |
+
'namearray' => 'cpt_tax_labels',
|
748 |
+
'name' => 'items_list',
|
749 |
+
'textvalue' => isset( $current['labels']['items_list'] ) ? esc_attr( $current['labels']['items_list'] ) : null, // phpcs:ignore.
|
750 |
+
'aftertext' => esc_html__( '(e.g. Actors list)', 'custom-post-type-ui' ),
|
751 |
+
'labeltext' => esc_html__( 'Items List', 'custom-post-type-ui' ),
|
752 |
+
'helptext' => esc_attr__( 'Screen reader text for the items list heading on the term listing screen.', 'custom-post-type-ui' ),
|
753 |
+
'data' => [
|
754 |
+
/* translators: Used for autofill */
|
755 |
+
'label' => sprintf( esc_attr__( '%s list', 'custom-post-type-ui' ), 'item' ),
|
756 |
+
'plurality' => 'plural',
|
757 |
+
],
|
758 |
+
]
|
759 |
+
);
|
760 |
+
|
761 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
762 |
+
[
|
763 |
+
'namearray' => 'cpt_tax_labels',
|
764 |
+
'name' => 'back_to_items',
|
765 |
+
'textvalue' => isset( $current['labels']['back_to_items'] ) ? esc_attr( $current['labels']['back_to_items'] ) : null, // phpcs:ignore.
|
766 |
+
'aftertext' => esc_html__( '(e.g. ← Back to actors', 'custom-post-type-ui' ),
|
767 |
+
'labeltext' => esc_html__( 'Back to Items', 'custom-post-type-ui' ),
|
768 |
+
'helptext' => esc_attr__( 'The text displayed after a term has been updated for a link back to main index.', 'custom-post-type-ui' ),
|
769 |
+
'data' => [
|
770 |
+
/* translators: Used for autofill */
|
771 |
+
'label' => sprintf( esc_attr__( 'Back to %s', 'custom-post-type-ui' ), 'item' ),
|
772 |
+
'plurality' => 'plural',
|
773 |
+
],
|
774 |
+
]
|
775 |
+
);
|
776 |
+
|
777 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
778 |
+
[
|
779 |
+
'namearray' => 'cpt_tax_labels',
|
780 |
+
'name' => 'name_field_description',
|
781 |
+
'textvalue' => isset( $current['labels']['name_field_description'] ) ? esc_attr( $current['labels']['name_field_description'] ) : null, // phpcs:ignore.
|
782 |
+
'aftertext' => esc_html__( '(e.g. "The name is how it appears on your site."', 'custom-post-type-ui' ),
|
783 |
+
'labeltext' => esc_html__( 'Term Name Field Description', 'custom-post-type-ui' ),
|
784 |
+
'helptext' => esc_attr__( 'Description for the Name field on Edit Tags screen.', 'custom-post-type-ui' ),
|
785 |
+
'data' => [
|
786 |
+
/* translators: Used for autofill */
|
787 |
+
'label' => sprintf( esc_attr__( 'The name is how it appears on your site.', 'custom-post-type-ui' ), 'item' ),
|
788 |
+
'plurality' => 'singular',
|
789 |
+
],
|
790 |
+
]
|
791 |
+
);
|
792 |
+
|
793 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
794 |
+
[
|
795 |
+
'namearray' => 'cpt_tax_labels',
|
796 |
+
'name' => 'parent_field_description',
|
797 |
+
'textvalue' => isset( $current['labels']['parent_field_description'] ) ? esc_attr( $current['labels']['parent_field_description'] ) : null, // phpcs:ignore.
|
798 |
+
'aftertext' => esc_html__( '(e.g. "Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band."', 'custom-post-type-ui' ),
|
799 |
+
'labeltext' => esc_html__( 'Term Parent Field Description', 'custom-post-type-ui' ),
|
800 |
+
'helptext' => esc_attr__( 'Description for the Parent field on Edit Tags screen.', 'custom-post-type-ui' ),
|
801 |
+
'data' => [
|
802 |
+
/* translators: Used for autofill */
|
803 |
+
'label' => sprintf( esc_attr__( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.', 'custom-post-type-ui' ), 'item' ),
|
804 |
+
'plurality' => 'singular',
|
805 |
+
],
|
806 |
+
]
|
807 |
+
);
|
808 |
+
|
809 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
810 |
+
[
|
811 |
+
'namearray' => 'cpt_tax_labels',
|
812 |
+
'name' => 'slug_field_description',
|
813 |
+
'textvalue' => isset( $current['labels']['slug_field_description'] ) ? esc_attr( $current['labels']['slug_field_description'] ) : null, // phpcs:ignore.
|
814 |
+
'aftertext' => esc_html__( '(e.g. "The « slug » is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens."', 'custom-post-type-ui' ),
|
815 |
+
'labeltext' => esc_html__( 'Term Slug Field Description', 'custom-post-type-ui' ),
|
816 |
+
'helptext' => esc_attr__( 'Description for the Slug field on Edit Tags screen. ', 'custom-post-type-ui' ),
|
817 |
+
'data' => [
|
818 |
+
/* translators: Used for autofill */
|
819 |
+
'label' => sprintf( esc_attr__( 'The "slug" is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.', 'custom-post-type-ui' ), 'item' ),
|
820 |
+
'plurality' => 'singular',
|
821 |
+
],
|
822 |
+
]
|
823 |
+
);
|
824 |
+
|
825 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
826 |
+
[
|
827 |
+
'namearray' => 'cpt_tax_labels',
|
828 |
+
'name' => 'desc_field_description',
|
829 |
+
'textvalue' => isset( $current['labels']['desc_field_description'] ) ? esc_attr( $current['labels']['desc_field_description'] ) : null, // phpcs:ignore.
|
830 |
+
'aftertext' => esc_html__( '(e.g. "The description is not prominent by default; however, some themes may show it."', 'custom-post-type-ui' ),
|
831 |
+
'labeltext' => esc_html__( 'Term Description Field Description', 'custom-post-type-ui' ),
|
832 |
+
'helptext' => esc_attr__( 'Description for the Description field on Edit Tags screen.', 'custom-post-type-ui' ),
|
833 |
+
'data' => [
|
834 |
+
/* translators: Used for autofill */
|
835 |
+
'label' => sprintf( esc_attr__( 'The description is not prominent by default; however, some themes may show it.', 'custom-post-type-ui' ), 'item' ),
|
836 |
+
'plurality' => 'plural',
|
837 |
+
],
|
838 |
+
]
|
839 |
+
);
|
840 |
?>
|
841 |
</table>
|
842 |
</div>
|
874 |
];
|
875 |
$selected = isset( $current ) ? disp_boolean( $current['public'] ) : '';
|
876 |
$select['selected'] = ! empty( $selected ) ? $current['public'] : '';
|
877 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
878 |
+
[
|
879 |
+
'namearray' => 'cpt_custom_tax',
|
880 |
+
'name' => 'public',
|
881 |
+
'labeltext' => esc_html__( 'Public', 'custom-post-type-ui' ),
|
882 |
+
'aftertext' => esc_html__( '(default: true) Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users.', 'custom-post-type-ui' ),
|
883 |
+
'selections' => $select, // phpcs:ignore.
|
884 |
+
]
|
885 |
+
);
|
886 |
|
887 |
$select = [
|
888 |
'options' => [
|
899 |
];
|
900 |
$selected = isset( $current ) ? disp_boolean( $current['publicly_queryable'] ) : '';
|
901 |
$select['selected'] = ! empty( $selected ) ? $current['publicly_queryable'] : '';
|
902 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
903 |
+
[
|
904 |
+
'namearray' => 'cpt_custom_tax',
|
905 |
+
'name' => 'publicly_queryable',
|
906 |
+
'labeltext' => esc_html__( 'Public Queryable', 'custom-post-type-ui' ),
|
907 |
+
'aftertext' => esc_html__( '(default: value of "public" setting) Whether or not the taxonomy should be publicly queryable.', 'custom-post-type-ui' ),
|
908 |
+
'selections' => $select, // phpcs:ignore.
|
909 |
+
]
|
910 |
+
);
|
911 |
|
912 |
$select = [
|
913 |
'options' => [
|
924 |
];
|
925 |
$selected = isset( $current ) ? disp_boolean( $current['hierarchical'] ) : '';
|
926 |
$select['selected'] = ! empty( $selected ) ? $current['hierarchical'] : '';
|
927 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
928 |
+
[
|
929 |
+
'namearray' => 'cpt_custom_tax',
|
930 |
+
'name' => 'hierarchical',
|
931 |
+
'labeltext' => esc_html__( 'Hierarchical', 'custom-post-type-ui' ),
|
932 |
+
'aftertext' => esc_html__( '(default: false) Whether the taxonomy can have parent-child relationships. "True" gives checkboxes, "False" gives text input.', 'custom-post-type-ui' ),
|
933 |
+
'selections' => $select, // phpcs:ignore.
|
934 |
+
]
|
935 |
+
);
|
936 |
|
937 |
$select = [
|
938 |
'options' => [
|
949 |
];
|
950 |
$selected = isset( $current ) ? disp_boolean( $current['show_ui'] ) : '';
|
951 |
$select['selected'] = ! empty( $selected ) ? $current['show_ui'] : '';
|
952 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
953 |
+
[
|
954 |
+
'namearray' => 'cpt_custom_tax',
|
955 |
+
'name' => 'show_ui',
|
956 |
+
'labeltext' => esc_html__( 'Show UI', 'custom-post-type-ui' ),
|
957 |
+
'aftertext' => esc_html__( '(default: true) Whether to generate a default UI for managing this custom taxonomy.', 'custom-post-type-ui' ),
|
958 |
+
'selections' => $select, // phpcs:ignore.
|
959 |
+
]
|
960 |
+
);
|
961 |
|
962 |
$select = [
|
963 |
'options' => [
|
974 |
];
|
975 |
$selected = isset( $current ) ? disp_boolean( $current['show_in_menu'] ) : '';
|
976 |
$select['selected'] = ! empty( $selected ) ? $current['show_in_menu'] : '';
|
977 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
978 |
+
[
|
979 |
+
'namearray' => 'cpt_custom_tax',
|
980 |
+
'name' => 'show_in_menu',
|
981 |
+
'labeltext' => esc_html__( 'Show in menu', 'custom-post-type-ui' ),
|
982 |
+
'aftertext' => esc_html__( '(default: value of show_ui) Whether to show the taxonomy in the admin menu.', 'custom-post-type-ui' ),
|
983 |
+
'selections' => $select, // phpcs:ignore.
|
984 |
+
]
|
985 |
+
);
|
986 |
|
987 |
$select = [
|
988 |
'options' => [
|
999 |
];
|
1000 |
$selected = ( isset( $current ) && ! empty( $current['show_in_nav_menus'] ) ) ? disp_boolean( $current['show_in_nav_menus'] ) : '';
|
1001 |
$select['selected'] = ! empty( $selected ) ? $current['show_in_nav_menus'] : '';
|
1002 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1003 |
+
[
|
1004 |
+
'namearray' => 'cpt_custom_tax',
|
1005 |
+
'name' => 'show_in_nav_menus',
|
1006 |
+
'labeltext' => esc_html__( 'Show in nav menus', 'custom-post-type-ui' ),
|
1007 |
+
'aftertext' => esc_html__( '(default: value of public) Whether to make the taxonomy available for selection in navigation menus.', 'custom-post-type-ui' ),
|
1008 |
+
'selections' => $select, // phpcs:ignore.
|
1009 |
+
]
|
1010 |
+
);
|
1011 |
|
1012 |
$select = [
|
1013 |
'options' => [
|
1024 |
];
|
1025 |
$selected = isset( $current ) ? disp_boolean( $current['query_var'] ) : '';
|
1026 |
$select['selected'] = ! empty( $selected ) ? $current['query_var'] : '';
|
1027 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1028 |
+
[
|
1029 |
+
'namearray' => 'cpt_custom_tax',
|
1030 |
+
'name' => 'query_var',
|
1031 |
+
'labeltext' => esc_html__( 'Query Var', 'custom-post-type-ui' ),
|
1032 |
+
'aftertext' => esc_html__( '(default: true) Sets the query_var key for this taxonomy.', 'custom-post-type-ui' ),
|
1033 |
+
'selections' => $select, // phpcs:ignore.
|
1034 |
+
]
|
1035 |
+
);
|
1036 |
+
|
1037 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1038 |
+
[
|
1039 |
+
'namearray' => 'cpt_custom_tax',
|
1040 |
+
'name' => 'query_var_slug',
|
1041 |
+
'textvalue' => isset( $current['query_var_slug'] ) ? esc_attr( $current['query_var_slug'] ) : '', // phpcs:ignore.
|
1042 |
+
'aftertext' => esc_attr__( '(default: taxonomy slug). Query var needs to be true to use.', 'custom-post-type-ui' ),
|
1043 |
+
'labeltext' => esc_html__( 'Custom Query Var String', 'custom-post-type-ui' ),
|
1044 |
+
'helptext' => esc_html__( 'Sets a custom query_var slug for this taxonomy.', 'custom-post-type-ui' ),
|
1045 |
+
]
|
1046 |
+
);
|
1047 |
|
1048 |
$select = [
|
1049 |
'options' => [
|
1060 |
];
|
1061 |
$selected = isset( $current ) ? disp_boolean( $current['rewrite'] ) : '';
|
1062 |
$select['selected'] = ! empty( $selected ) ? $current['rewrite'] : '';
|
1063 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1064 |
+
[
|
1065 |
+
'namearray' => 'cpt_custom_tax',
|
1066 |
+
'name' => 'rewrite',
|
1067 |
+
'labeltext' => esc_html__( 'Rewrite', 'custom-post-type-ui' ),
|
1068 |
+
'aftertext' => esc_html__( '(default: true) Whether or not WordPress should use rewrites for this taxonomy.', 'custom-post-type-ui' ),
|
1069 |
+
'selections' => $select, // phpcs:ignore.
|
1070 |
+
]
|
1071 |
+
);
|
1072 |
+
|
1073 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1074 |
+
[
|
1075 |
+
'namearray' => 'cpt_custom_tax',
|
1076 |
+
'name' => 'rewrite_slug',
|
1077 |
+
'textvalue' => isset( $current['rewrite_slug'] ) ? esc_attr( $current['rewrite_slug'] ) : '', // phpcs:ignore.
|
1078 |
+
'aftertext' => esc_attr__( '(default: taxonomy name)', 'custom-post-type-ui' ),
|
1079 |
+
'labeltext' => esc_html__( 'Custom Rewrite Slug', 'custom-post-type-ui' ),
|
1080 |
+
'helptext' => esc_html__( 'Custom taxonomy rewrite slug.', 'custom-post-type-ui' ),
|
1081 |
+
]
|
1082 |
+
);
|
1083 |
|
1084 |
$select = [
|
1085 |
'options' => [
|
1096 |
];
|
1097 |
$selected = isset( $current ) ? disp_boolean( $current['rewrite_withfront'] ) : '';
|
1098 |
$select['selected'] = ! empty( $selected ) ? $current['rewrite_withfront'] : '';
|
1099 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1100 |
+
[
|
1101 |
+
'namearray' => 'cpt_custom_tax',
|
1102 |
+
'name' => 'rewrite_withfront',
|
1103 |
+
'labeltext' => esc_html__( 'Rewrite With Front', 'custom-post-type-ui' ),
|
1104 |
+
'aftertext' => esc_html__( '(default: true) Should the permastruct be prepended with the front base.', 'custom-post-type-ui' ),
|
1105 |
+
'selections' => $select, // phpcs:ignore.
|
1106 |
+
]
|
1107 |
+
);
|
1108 |
|
1109 |
$select = [
|
1110 |
'options' => [
|
1121 |
];
|
1122 |
$selected = isset( $current ) ? disp_boolean( $current['rewrite_hierarchical'] ) : '';
|
1123 |
$select['selected'] = ! empty( $selected ) ? $current['rewrite_hierarchical'] : '';
|
1124 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1125 |
+
[
|
1126 |
+
'namearray' => 'cpt_custom_tax',
|
1127 |
+
'name' => 'rewrite_hierarchical',
|
1128 |
+
'labeltext' => esc_html__( 'Rewrite Hierarchical', 'custom-post-type-ui' ),
|
1129 |
+
'aftertext' => esc_html__( '(default: false) Should the permastruct allow hierarchical urls.', 'custom-post-type-ui' ),
|
1130 |
+
'selections' => $select, // phpcs:ignore.
|
1131 |
+
]
|
1132 |
+
);
|
1133 |
|
1134 |
$select = [
|
1135 |
'options' => [
|
1146 |
];
|
1147 |
$selected = isset( $current ) ? disp_boolean( $current['show_admin_column'] ) : '';
|
1148 |
$select['selected'] = ! empty( $selected ) ? $current['show_admin_column'] : '';
|
1149 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1150 |
+
[
|
1151 |
+
'namearray' => 'cpt_custom_tax',
|
1152 |
+
'name' => 'show_admin_column',
|
1153 |
+
'labeltext' => esc_html__( 'Show Admin Column', 'custom-post-type-ui' ),
|
1154 |
+
'aftertext' => esc_html__( '(default: false) Whether to allow automatic creation of taxonomy columns on associated post-types.', 'custom-post-type-ui' ),
|
1155 |
+
'selections' => $select, // phpcs:ignore.
|
1156 |
+
]
|
1157 |
+
);
|
1158 |
|
1159 |
$select = [
|
1160 |
'options' => [
|
1161 |
[
|
1162 |
+
'attr' => '0',
|
1163 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
1164 |
],
|
1165 |
[
|
1166 |
'attr' => '1',
|
1171 |
];
|
1172 |
$selected = isset( $current ) ? disp_boolean( $current['show_in_rest'] ) : '';
|
1173 |
$select['selected'] = ! empty( $selected ) ? $current['show_in_rest'] : '';
|
1174 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1175 |
+
[
|
1176 |
+
'namearray' => 'cpt_custom_tax',
|
1177 |
+
'name' => 'show_in_rest',
|
1178 |
+
'labeltext' => esc_html__( 'Show in REST API', 'custom-post-type-ui' ),
|
1179 |
+
'aftertext' => esc_html__( '(Custom Post Type UI default: true) Whether to show this taxonomy data in the WP REST API.', 'custom-post-type-ui' ),
|
1180 |
+
'selections' => $select, // phpcs:ignore.
|
1181 |
+
]
|
1182 |
+
);
|
1183 |
+
|
1184 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1185 |
+
[
|
1186 |
+
'namearray' => 'cpt_custom_tax',
|
1187 |
+
'name' => 'rest_base',
|
1188 |
+
'labeltext' => esc_html__( 'REST API base slug', 'custom-post-type-ui' ),
|
1189 |
+
'helptext' => esc_attr__( 'Slug to use in REST API URLs.', 'custom-post-type-ui' ),
|
1190 |
+
'textvalue' => isset( $current['rest_base'] ) ? esc_attr( $current['rest_base'] ) : '', // phpcs:ignore.
|
1191 |
+
]
|
1192 |
+
);
|
1193 |
+
|
1194 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1195 |
+
[
|
1196 |
+
'namearray' => 'cpt_custom_tax',
|
1197 |
+
'name' => 'rest_controller_class',
|
1198 |
+
'labeltext' => esc_html__( 'REST API controller class', 'custom-post-type-ui' ),
|
1199 |
+
'aftertext' => esc_attr__( '(default: WP_REST_Terms_Controller) Custom controller to use instead of WP_REST_Terms_Controller.', 'custom-post-type-ui' ),
|
1200 |
+
'textvalue' => isset( $current['rest_controller_class'] ) ? esc_attr( $current['rest_controller_class'] ) : '', // phpcs:ignore.
|
1201 |
+
]
|
1202 |
+
);
|
1203 |
+
|
1204 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1205 |
+
[
|
1206 |
+
'namearray' => 'cpt_custom_tax',
|
1207 |
+
'name' => 'rest_namespace',
|
1208 |
+
'labeltext' => esc_html__( 'REST API namespace', 'custom-post-type-ui' ),
|
1209 |
+
'aftertext' => esc_attr__( '(default: wp/v2) To change the namespace URL of REST API route.', 'custom-post-type-ui' ),
|
1210 |
+
'textvalue' => isset( $current['rest_namespace'] ) ? esc_attr( $current['rest_namespace'] ) : '', // phpcs:ignore.
|
1211 |
+
]
|
1212 |
+
);
|
1213 |
|
1214 |
$select = [
|
1215 |
'options' => [
|
1226 |
];
|
1227 |
$selected = ( isset( $current ) && ! empty( $current['show_tagcloud'] ) ) ? disp_boolean( $current['show_tagcloud'] ) : '';
|
1228 |
$select['selected'] = ! empty( $selected ) ? $current['show_tagcloud'] : '';
|
1229 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1230 |
+
[
|
1231 |
+
'namearray' => 'cpt_custom_tax',
|
1232 |
+
'name' => 'show_tagcloud',
|
1233 |
+
'labeltext' => esc_html__( 'Show in tag cloud.', 'custom-post-type-ui' ),
|
1234 |
+
'aftertext' => esc_html__( '(default: inherited from "show_ui") Whether to list the taxonomy in the Tag Cloud Widget controls.', 'custom-post-type-ui' ),
|
1235 |
+
'selections' => $select, // phpcs:ignore.
|
1236 |
+
]
|
1237 |
+
);
|
1238 |
|
1239 |
$select = [
|
1240 |
'options' => [
|
1251 |
];
|
1252 |
$selected = ( isset( $current ) && ! empty( $current['show_in_quick_edit'] ) ) ? disp_boolean( $current['show_in_quick_edit'] ) : '';
|
1253 |
$select['selected'] = ! empty( $selected ) ? $current['show_in_quick_edit'] : '';
|
1254 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1255 |
+
[
|
1256 |
+
'namearray' => 'cpt_custom_tax',
|
1257 |
+
'name' => 'show_in_quick_edit',
|
1258 |
+
'labeltext' => esc_html__( 'Show in quick/bulk edit panel.', 'custom-post-type-ui' ),
|
1259 |
+
'aftertext' => esc_html__( '(default: false) Whether to show the taxonomy in the quick/bulk edit panel.', 'custom-post-type-ui' ),
|
1260 |
+
'selections' => $select, // phpcs:ignore.
|
1261 |
+
]
|
1262 |
+
);
|
1263 |
|
1264 |
$select = [
|
1265 |
'options' => [
|
1266 |
[
|
1267 |
+
'attr' => '0',
|
1268 |
+
'text' => esc_attr__( 'False', 'custom-post-type-ui' ),
|
1269 |
'default' => 'false',
|
1270 |
],
|
1271 |
[
|
1272 |
+
'attr' => '1',
|
1273 |
+
'text' => esc_attr__( 'True', 'custom-post-type-ui' ),
|
1274 |
],
|
1275 |
],
|
1276 |
];
|
1277 |
$selected = ( isset( $current ) && ! empty( $current['sort'] ) ) ? disp_boolean( $current['sort'] ) : '';
|
1278 |
$select['selected'] = ! empty( $selected ) ? $current['sort'] : '';
|
1279 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1280 |
+
[
|
1281 |
+
'namearray' => 'cpt_custom_tax',
|
1282 |
+
'name' => 'sort',
|
1283 |
+
'labeltext' => esc_html__( 'Sort', 'custom-post-type-ui' ),
|
1284 |
+
'aftertext' => esc_html__( 'Whether terms in this taxonomy should be sorted in the order they are provided to wp_set_object_terms()', 'custom-post-type-ui' ),
|
1285 |
+
'selections' => $select, // phpcs:ignore.
|
1286 |
+
]
|
1287 |
+
);
|
1288 |
+
|
1289 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1290 |
+
[
|
1291 |
+
'namearray' => 'cpt_custom_tax',
|
1292 |
+
'name' => 'meta_box_cb',
|
1293 |
+
'textvalue' => isset( $current['meta_box_cb'] ) ? esc_attr( $current['meta_box_cb'] ) : '', // phpcs:ignore.
|
1294 |
+
'labeltext' => esc_html__( 'Metabox callback', 'custom-post-type-ui' ),
|
1295 |
+
'helptext' => esc_html__( 'Sets a callback function name for the meta box display. Hierarchical default: post_categories_meta_box, non-hierarchical default: post_tags_meta_box. To remove the metabox completely, use "false".', 'custom-post-type-ui' ),
|
1296 |
+
]
|
1297 |
+
);
|
1298 |
+
|
1299 |
+
echo $ui->get_text_input( // phpcs:ignore.
|
1300 |
+
[
|
1301 |
+
'namearray' => 'cpt_custom_tax',
|
1302 |
+
'name' => 'default_term',
|
1303 |
+
'textvalue' => isset( $current['default_term'] ) ? esc_attr( $current['default_term'] ) : '', // phpcs:ignore.
|
1304 |
+
'labeltext' => esc_html__( 'Default Term', 'custom-post-type-ui' ),
|
1305 |
+
'helptext' => esc_html__( 'Set a default term for the taxonomy. Able to set a name, slug, and description. Only a name is required if setting a default, others are optional. Set values in the following order, separated by comma. Example: name, slug, description', 'custom-post-type-ui' ),
|
1306 |
+
]
|
1307 |
+
);
|
1308 |
?>
|
1309 |
</table>
|
1310 |
</div>
|
1325 |
<p class="submit">
|
1326 |
<?php
|
1327 |
wp_nonce_field( 'cptui_addedit_taxonomy_nonce_action', 'cptui_addedit_taxonomy_nonce_field' );
|
1328 |
+
if ( ! empty( $_GET ) && ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification
|
|
|
|
|
1329 |
/**
|
1330 |
* Filters the text value to use on the button when editing.
|
1331 |
*
|
1362 |
|
1363 |
<?php if ( ! empty( $current ) ) { ?>
|
1364 |
<input type="hidden" name="tax_original" id="tax_original" value="<?php echo esc_attr( $current['name'] ); ?>" />
|
1365 |
+
<?php
|
1366 |
}
|
1367 |
|
1368 |
// Used to check and see if we should prevent duplicate slugs.
|
1373 |
</div>
|
1374 |
</form>
|
1375 |
</div><!-- End .wrap -->
|
1376 |
+
<?php
|
1377 |
}
|
1378 |
|
1379 |
/**
|
1412 |
*/
|
1413 |
$select = apply_filters( 'cptui_taxonomies_dropdown_options', $select, $taxonomies );
|
1414 |
|
1415 |
+
echo $ui->get_select_input( // phpcs:ignore.
|
1416 |
+
[
|
1417 |
+
'namearray' => 'cptui_selected_taxonomy',
|
1418 |
+
'name' => 'taxonomy',
|
1419 |
+
'selections' => $select, // phpcs:ignore.
|
1420 |
+
'wrap' => false,
|
1421 |
+
]
|
1422 |
+
);
|
1423 |
}
|
1424 |
}
|
1425 |
|
1442 |
check_admin_referer( 'cptui_select_taxonomy_nonce_action', 'cptui_select_taxonomy_nonce_field' );
|
1443 |
}
|
1444 |
if ( isset( $_POST['cptui_selected_taxonomy']['taxonomy'] ) ) {
|
1445 |
+
$tax = sanitize_text_field( wp_unslash( $_POST['cptui_selected_taxonomy']['taxonomy'] ) );
|
1446 |
} elseif ( $taxonomy_deleted ) {
|
1447 |
$taxonomies = cptui_get_taxonomy_data();
|
1448 |
$tax = key( $taxonomies );
|
1449 |
} elseif ( isset( $_POST['cpt_custom_tax']['name'] ) ) {
|
1450 |
// Return the submitted value.
|
1451 |
if ( ! in_array( $_POST['cpt_custom_tax']['name'], cptui_reserved_taxonomies(), true ) ) {
|
1452 |
+
$tax = sanitize_text_field( wp_unslash( $_POST['cpt_custom_tax']['name'] ) );
|
1453 |
} else {
|
1454 |
// Return the original value since user tried to submit a reserved term.
|
1455 |
+
$tax = sanitize_text_field( wp_unslash( $_POST['tax_original'] ) ); // phpcs:ignore.
|
1456 |
}
|
1457 |
}
|
1458 |
} elseif ( ! empty( $_GET ) && isset( $_GET['cptui_taxonomy'] ) ) {
|
1459 |
+
$tax = sanitize_text_field( wp_unslash( $_GET['cptui_taxonomy'] ) );
|
1460 |
} else {
|
1461 |
$taxonomies = cptui_get_taxonomy_data();
|
1462 |
if ( ! empty( $taxonomies ) ) {
|
1522 |
* @param array $taxonomies Array of our updated taxonomies data.
|
1523 |
* @param array $data Array of submitted taxonomy to update.
|
1524 |
*/
|
1525 |
+
if ( false === ( $success = apply_filters( 'cptui_taxonomy_delete_tax', false, $taxonomies, $data ) ) ) { // phpcs:ignore.
|
1526 |
$success = update_option( 'cptui_taxonomies', $taxonomies );
|
1527 |
}
|
1528 |
}
|
1710 |
* @param array $taxonomies Array of our updated taxonomies data.
|
1711 |
* @param array $data Array of submitted taxonomy to update.
|
1712 |
*/
|
1713 |
+
if ( false === ( $success = apply_filters( 'cptui_taxonomy_update_save', false, $taxonomies, $data ) ) ) { // phpcs:ignore.
|
1714 |
$success = update_option( 'cptui_taxonomies', $taxonomies );
|
1715 |
}
|
1716 |
|
1885 |
|
1886 |
$query = "UPDATE `{$wpdb->term_taxonomy}` SET `taxonomy` = %s WHERE `taxonomy` = %s AND `term_id` IN ( {$term_ids} )";
|
1887 |
|
1888 |
+
$wpdb->query( // phpcs:ignore.
|
1889 |
+
$wpdb->prepare( $query, $new_slug, $original_slug ) // phpcs:ignore.
|
1890 |
);
|
1891 |
}
|
1892 |
cptui_delete_taxonomy( $original_slug );
|
1911 |
}
|
1912 |
|
1913 |
// Check if CPTUI has already registered this slug.
|
1914 |
+
if ( array_key_exists( strtolower( $taxonomy_slug ), $taxonomies ) ) { // phpcs:ignore.
|
1915 |
return true;
|
1916 |
}
|
1917 |
|
1918 |
// Check if we're registering a reserved post type slug.
|
1919 |
+
if ( in_array( $taxonomy_slug, cptui_reserved_taxonomies() ) ) { // phpcs:ignore.
|
1920 |
return true;
|
1921 |
}
|
1922 |
|
1923 |
// Check if other plugins have registered this same slug.
|
1924 |
+
$public = get_taxonomies(
|
1925 |
+
[
|
1926 |
+
'_builtin' => false,
|
1927 |
+
'public' => true,
|
1928 |
+
]
|
1929 |
+
);
|
1930 |
+
$private = get_taxonomies(
|
1931 |
+
[
|
1932 |
+
'_builtin' => false,
|
1933 |
+
'public' => false,
|
1934 |
+
]
|
1935 |
+
);
|
1936 |
+
|
1937 |
$registered_taxonomies = array_merge( $public, $private );
|
1938 |
+
if ( in_array( $taxonomy_slug, $registered_taxonomies, true ) ) {
|
1939 |
return true;
|
1940 |
}
|
1941 |
|
1973 |
check_admin_referer( 'cptui_addedit_taxonomy_nonce_action', 'cptui_addedit_taxonomy_nonce_field' );
|
1974 |
|
1975 |
$filtered_data = filter_input( INPUT_POST, 'cpt_custom_tax', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
1976 |
+
$result = cptui_delete_taxonomy( $filtered_data );
|
1977 |
add_filter( 'cptui_taxonomy_deleted', '__return_true' );
|
1978 |
}
|
1979 |
|
2037 |
*/
|
2038 |
function cptui_updated_taxonomy_slug_exists( $slug_exists, $taxonomy_slug = '', $taxonomies = [] ) {
|
2039 |
if (
|
2040 |
+
( ! empty( $_POST['cpt_tax_status'] ) && 'edit' === $_POST['cpt_tax_status'] ) && // phpcs:ignore WordPress.Security.NonceVerification
|
2041 |
+
! in_array( $taxonomy_slug, cptui_reserved_taxonomies(), true ) && // phpcs:ignore WordPress.Security.NonceVerification
|
2042 |
+
( ! empty( $_POST['tax_original'] ) && $taxonomy_slug === $_POST['tax_original'] ) // phpcs:ignore WordPress.Security.NonceVerification
|
2043 |
) {
|
2044 |
$slug_exists = false;
|
2045 |
}
|
2064 |
'cpt_tax_labels',
|
2065 |
'cpt_post_types',
|
2066 |
'update_taxonomy',
|
2067 |
+
] as $item
|
2068 |
) {
|
2069 |
$first_result = filter_input( INPUT_POST, $item, FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
2070 |
|
2077 |
[
|
2078 |
'tax_original',
|
2079 |
'cpt_tax_status',
|
2080 |
+
] as $item
|
2081 |
) {
|
2082 |
$second_result = filter_input( INPUT_POST, $item, FILTER_SANITIZE_STRING );
|
2083 |
if ( $second_result ) {
|
inc/tools-sections/tools-debug.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
wp_verify_nonce( 'cptui_debuginfo_nonce_field', 'cptui_debuginfo_nonce_action' );
|
24 |
+
|
25 |
+
$email_args = [];
|
26 |
+
$email_args['email'] = sanitize_text_field( $_POST['cptui_debug_info_email'] );
|
27 |
+
$debuginfo->send_email( $email_args );
|
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 |
+
}
|
inc/tools-sections/tools-get-code.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
}
|
inc/tools-sections/tools-post-types.php
ADDED
@@ -0,0 +1,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 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 |
+
}
|
inc/tools-sections/tools-taxonomies.php
ADDED
@@ -0,0 +1,188 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
}
|
40 |
+
echo trim( ob_get_clean() );
|
41 |
+
/**
|
42 |
+
* Create output for single taxonomy to be ready for copy/paste from Get Code.
|
43 |
+
*
|
44 |
+
* @param array $taxonomy Taxonomy data to output. Optional.
|
45 |
+
*
|
46 |
+
* @since 1.0.0
|
47 |
+
*/
|
48 |
+
function cptui_get_single_taxonomy_registery( $taxonomy = [] ) {
|
49 |
+
|
50 |
+
$post_types = "''";
|
51 |
+
if ( is_array( $taxonomy['object_types'] ) ) {
|
52 |
+
$post_types = '[ "' . implode( '", "', $taxonomy['object_types'] ) . '" ]';
|
53 |
+
}
|
54 |
+
|
55 |
+
if ( false !== get_disp_boolean( $taxonomy['rewrite'] ) ) {
|
56 |
+
$rewrite = disp_boolean( $taxonomy['rewrite'] );
|
57 |
+
|
58 |
+
$rewrite_slug = ' \'slug\' => \'' . $taxonomy['name'] . '\',';
|
59 |
+
if ( ! empty( $taxonomy['rewrite_slug'] ) ) {
|
60 |
+
$rewrite_slug = ' \'slug\' => \'' . $taxonomy['rewrite_slug'] . '\',';
|
61 |
+
}
|
62 |
+
|
63 |
+
$rewrite_withfront = '';
|
64 |
+
$withfront = disp_boolean( $taxonomy['rewrite_withfront'] );
|
65 |
+
if ( ! empty( $withfront ) ) {
|
66 |
+
$rewrite_withfront = ' \'with_front\' => ' . $withfront . ', ';
|
67 |
+
}
|
68 |
+
|
69 |
+
$hierarchical = ! empty( $taxonomy['rewrite_hierarchical'] ) ? disp_boolean( $taxonomy['rewrite_hierarchical'] ) : '';
|
70 |
+
$rewrite_hierarchcial = '';
|
71 |
+
if ( ! empty( $hierarchical ) ) {
|
72 |
+
$rewrite_hierarchcial = ' \'hierarchical\' => ' . $hierarchical . ', ';
|
73 |
+
}
|
74 |
+
|
75 |
+
if ( ! empty( $taxonomy['rewrite_slug'] ) || false !== disp_boolean( $taxonomy['rewrite_withfront'] ) ) {
|
76 |
+
$rewrite_start = '[';
|
77 |
+
$rewrite_end = ']';
|
78 |
+
|
79 |
+
$rewrite = $rewrite_start . $rewrite_slug . $rewrite_withfront . $rewrite_hierarchcial . $rewrite_end;
|
80 |
+
}
|
81 |
+
} else {
|
82 |
+
$rewrite = disp_boolean( $taxonomy['rewrite'] );
|
83 |
+
}
|
84 |
+
$public = isset( $taxonomy['public'] ) ? disp_boolean( $taxonomy['public'] ) : 'true';
|
85 |
+
$publicly_queryable = isset( $taxonomy['publicly_queryable'] ) ? disp_boolean( $taxonomy['publicly_queryable'] ) : disp_boolean( $taxonomy['public'] );
|
86 |
+
$show_in_quick_edit = isset( $taxonomy['show_in_quick_edit'] ) ? disp_boolean( $taxonomy['show_in_quick_edit'] ) : disp_boolean( $taxonomy['show_ui'] );
|
87 |
+
$show_tagcloud = isset( $taxonomy['show_tagcloud'] ) ? disp_boolean( $taxonomy['show_tagcloud'] ) : disp_boolean( $taxonomy['show_ui'] );
|
88 |
+
|
89 |
+
$show_in_menu = ( ! empty( $taxonomy['show_in_menu'] ) && false !== get_disp_boolean( $taxonomy['show_in_menu'] ) ) ? 'true' : 'false';
|
90 |
+
if ( empty( $taxonomy['show_in_menu'] ) ) {
|
91 |
+
$show_in_menu = disp_boolean( $taxonomy['show_ui'] );
|
92 |
+
}
|
93 |
+
|
94 |
+
$show_in_nav_menus = ( ! empty( $taxonomy['show_in_nav_menus'] ) && false !== get_disp_boolean( $taxonomy['show_in_nav_menus'] ) ) ? 'true' : 'false';
|
95 |
+
if ( empty( $taxonomy['show_in_nav_menus'] ) ) {
|
96 |
+
$show_in_nav_menus = $public;
|
97 |
+
}
|
98 |
+
|
99 |
+
$show_in_rest = ( ! empty( $taxonomy['show_in_rest'] ) && false !== get_disp_boolean( $taxonomy['show_in_rest'] ) ) ? 'true' : 'false';
|
100 |
+
$rest_base = ! empty( $taxonomy['rest_base'] ) ? $taxonomy['rest_base'] : $taxonomy['name'];
|
101 |
+
$rest_controller_class = ! empty( $taxonomy['rest_controller_class'] ) ? $taxonomy['rest_controller_class'] : 'WP_REST_Terms_Controller';
|
102 |
+
$rest_namespace = ! empty( $taxonomy['rest_namespace'] ) ? $taxonomy['rest_namespace'] : 'wp/v2';
|
103 |
+
|
104 |
+
if ( ! empty( $taxonomy['meta_box_cb'] ) ) {
|
105 |
+
$meta_box_cb = ( false !== get_disp_boolean( $taxonomy['meta_box_cb'] ) ) ? '"' . $taxonomy['meta_box_cb'] . '"' : 'false';
|
106 |
+
}
|
107 |
+
|
108 |
+
$default_term = '';
|
109 |
+
if ( ! empty( $taxonomy['default_term'] ) ) {
|
110 |
+
$term_parts = explode( ',', $taxonomy['default_term'] );
|
111 |
+
$default_term_start = '[';
|
112 |
+
$default_term_end = ']';
|
113 |
+
if ( ! empty( $term_parts[0] ) ) {
|
114 |
+
$default_term .= "'name' => '" . trim( $term_parts[0] ) . "'";
|
115 |
+
}
|
116 |
+
if ( ! empty( $term_parts[1] ) ) {
|
117 |
+
$default_term .= ", 'slug' => '" . trim( $term_parts[1] ) . "'";
|
118 |
+
}
|
119 |
+
if ( ! empty( $term_parts[2] ) ) {
|
120 |
+
$default_term .= ", 'description' => '" . trim( $term_parts[2] ) . "'";
|
121 |
+
}
|
122 |
+
|
123 |
+
$default_term = $default_term_start . $default_term . $default_term_end;
|
124 |
+
}
|
125 |
+
|
126 |
+
$my_theme = wp_get_theme();
|
127 |
+
$textdomain = $my_theme->get( 'TextDomain' );
|
128 |
+
if ( empty( $textdomain ) ) {
|
129 |
+
$textdomain = 'custom-post-type-ui';
|
130 |
+
}
|
131 |
+
?>
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Taxonomy: <?php echo esc_html( $taxonomy['label'] ); ?>.
|
135 |
+
*/
|
136 |
+
|
137 |
+
$labels = [
|
138 |
+
"name" => esc_html__( "<?php echo esc_html( $taxonomy['label'] ); ?>", "<?php echo esc_html( $textdomain ); ?>" ),
|
139 |
+
"singular_name" => esc_html__( "<?php echo esc_html( $taxonomy['singular_label'] ); ?>", "<?php echo esc_html( $textdomain ); ?>" ),
|
140 |
+
<?php
|
141 |
+
foreach ( $taxonomy['labels'] as $key => $label ) {
|
142 |
+
if ( ! empty( $label ) ) {
|
143 |
+
echo "\t\t" . '"' . esc_html( $key ) . '" => esc_html__( "' . esc_html( $label ) . '", "' . esc_html( $textdomain ) . '" ),' . "\n";
|
144 |
+
}
|
145 |
+
}
|
146 |
+
?>
|
147 |
+
];
|
148 |
+
|
149 |
+
<?php
|
150 |
+
$show_graphql = isset( $taxonomy['show_in_graphql'] ) ? (bool) $taxonomy['show_in_graphql'] : false;
|
151 |
+
?>
|
152 |
+
|
153 |
+
$args = [
|
154 |
+
"label" => esc_html__( "<?php echo $taxonomy['label']; ?>", "<?php echo $textdomain; ?>" ),
|
155 |
+
"labels" => $labels,
|
156 |
+
"public" => <?php echo $public; ?>,
|
157 |
+
"publicly_queryable" => <?php echo $publicly_queryable; ?>,
|
158 |
+
"hierarchical" => <?php echo $taxonomy['hierarchical']; ?>,
|
159 |
+
"show_ui" => <?php echo disp_boolean( $taxonomy['show_ui'] ); ?>,
|
160 |
+
"show_in_menu" => <?php echo $show_in_menu; ?>,
|
161 |
+
"show_in_nav_menus" => <?php echo $show_in_nav_menus; ?>,
|
162 |
+
"query_var" => <?php echo disp_boolean( $taxonomy['query_var'] ); ?>,
|
163 |
+
"rewrite" => <?php echo $rewrite; ?>,
|
164 |
+
"show_admin_column" => <?php echo $taxonomy['show_admin_column']; ?>,
|
165 |
+
"show_in_rest" => <?php echo $show_in_rest; ?>,
|
166 |
+
"show_tagcloud" => <?php echo $show_tagcloud; ?>,
|
167 |
+
"rest_base" => "<?php echo $rest_base; ?>",
|
168 |
+
"rest_controller_class" => "<?php echo $rest_controller_class; ?>",
|
169 |
+
"rest_namespace" => "<?php echo $rest_namespace; ?>",
|
170 |
+
"show_in_quick_edit" => <?php echo $show_in_quick_edit; ?>,
|
171 |
+
"sort" => <?php echo disp_boolean( $taxonomy['sort'] ); ?>,
|
172 |
+
<?php if ( $show_graphql ) : ?>
|
173 |
+
"show_in_graphql" => <?php echo disp_boolean( $taxonomy['show_in_graphql'] ); ?>,
|
174 |
+
"graphql_single_name" => "<?php echo esc_html( $taxonomy['graphql_single_name'] ); ?>",
|
175 |
+
"graphql_plural_name" => "<?php echo esc_html( $taxonomy['graphql_plural_name'] ); ?>",
|
176 |
+
<?php else: ?>
|
177 |
+
"show_in_graphql" => <?php echo disp_boolean( false ); ?>,
|
178 |
+
<?php endif; ?>
|
179 |
+
<?php if ( ! empty( $meta_box_cb ) ) { ?>
|
180 |
+
"meta_box_cb" => <?php echo $meta_box_cb; ?>,
|
181 |
+
<?php } ?>
|
182 |
+
<?php if ( ! empty( $default_term ) ) { ?>
|
183 |
+
"default_term" => <?php echo $default_term; ?>,
|
184 |
+
<?php } ?>
|
185 |
+
];
|
186 |
+
register_taxonomy( "<?php echo esc_html( $taxonomy['name'] ); ?>", <?php echo $post_types; ?>, $args );
|
187 |
+
<?php
|
188 |
+
}
|
inc/tools.php
CHANGED
@@ -129,12 +129,12 @@ add_filter( 'cptui_get_tabs', 'cptui_tools_tabs', 10, 2 );
|
|
129 |
function cptui_tools() {
|
130 |
|
131 |
$tab = 'post_types';
|
132 |
-
if ( ! empty( $_GET ) ) {
|
133 |
-
if ( ! empty( $_GET['action'] ) && 'taxonomies' === $_GET['action'] ) {
|
134 |
$tab = 'taxonomies';
|
135 |
-
} elseif ( ! empty( $_GET['action'] ) && 'get_code' === $_GET['action'] ) {
|
136 |
$tab = 'get_code';
|
137 |
-
} elseif ( ! empty( $_GET['action'] ) && 'debuginfo' === $_GET['action'] ) {
|
138 |
$tab = 'debuginfo';
|
139 |
}
|
140 |
}
|
@@ -187,439 +187,6 @@ function cptui_tools() {
|
|
187 |
echo '</div><!-- End .wrap -->';
|
188 |
}
|
189 |
|
190 |
-
/**
|
191 |
-
* Display our copy-able code for registered taxonomies.
|
192 |
-
*
|
193 |
-
* @since 1.0.0
|
194 |
-
* @since 1.2.0 Added $cptui_taxonomies parameter.
|
195 |
-
* @since 1.2.0 Added $single parameter.
|
196 |
-
*
|
197 |
-
* @param array $cptui_taxonomies Array of taxonomies to render. Optional.
|
198 |
-
* @param bool $single Whether or not we are rendering a single taxonomy. Optional. Default false.
|
199 |
-
*/
|
200 |
-
function cptui_get_taxonomy_code( $cptui_taxonomies = [], $single = false ) {
|
201 |
-
if ( ! empty( $cptui_taxonomies ) ) {
|
202 |
-
$callback = 'cptui_register_my_taxes';
|
203 |
-
if ( $single ) {
|
204 |
-
$key = key( $cptui_taxonomies );
|
205 |
-
$callback = 'cptui_register_my_taxes_' . str_replace( '-', '_', esc_html( $cptui_taxonomies[ $key ]['name'] ) );
|
206 |
-
}
|
207 |
-
?>
|
208 |
-
function <?php echo esc_html( $callback ); ?>() {
|
209 |
-
<?php
|
210 |
-
foreach ( $cptui_taxonomies as $tax ) {
|
211 |
-
echo cptui_get_single_taxonomy_registery( $tax );
|
212 |
-
} ?>
|
213 |
-
}
|
214 |
-
add_action( 'init', '<?php echo esc_html( $callback ); ?>' );
|
215 |
-
<?php
|
216 |
-
} else {
|
217 |
-
esc_html_e( 'No taxonomies to display at this time', 'custom-post-type-ui' );
|
218 |
-
}
|
219 |
-
}
|
220 |
-
|
221 |
-
/**
|
222 |
-
* Create output for single taxonomy to be ready for copy/paste from Get Code.
|
223 |
-
*
|
224 |
-
* @since 1.0.0
|
225 |
-
*
|
226 |
-
* @param array $taxonomy Taxonomy data to output. Optional.
|
227 |
-
*/
|
228 |
-
function cptui_get_single_taxonomy_registery( $taxonomy = [] ) {
|
229 |
-
|
230 |
-
$post_types = "''";
|
231 |
-
if ( is_array( $taxonomy['object_types'] ) ) {
|
232 |
-
$post_types = '[ "' . implode( '", "', $taxonomy['object_types'] ) . '" ]';
|
233 |
-
}
|
234 |
-
|
235 |
-
if ( false !== get_disp_boolean( $taxonomy['rewrite'] ) ) {
|
236 |
-
$rewrite = disp_boolean( $taxonomy['rewrite'] );
|
237 |
-
|
238 |
-
$rewrite_slug = ' \'slug\' => \'' . $taxonomy['name'] . '\',';
|
239 |
-
if ( ! empty( $taxonomy['rewrite_slug'] ) ) {
|
240 |
-
$rewrite_slug = ' \'slug\' => \'' . $taxonomy['rewrite_slug'] . '\',';
|
241 |
-
}
|
242 |
-
|
243 |
-
$rewrite_withfront = '';
|
244 |
-
$withfront = disp_boolean( $taxonomy['rewrite_withfront'] );
|
245 |
-
if ( ! empty( $withfront ) ) {
|
246 |
-
$rewrite_withfront = ' \'with_front\' => ' . $withfront . ', ';
|
247 |
-
}
|
248 |
-
|
249 |
-
$hierarchical = ! empty( $taxonomy['rewrite_hierarchical'] ) ? disp_boolean( $taxonomy['rewrite_hierarchical'] ) : '';
|
250 |
-
$rewrite_hierarchcial = '';
|
251 |
-
if ( ! empty( $hierarchical ) ) {
|
252 |
-
$rewrite_hierarchcial = ' \'hierarchical\' => ' . $hierarchical . ', ';
|
253 |
-
}
|
254 |
-
|
255 |
-
if ( ! empty( $taxonomy['rewrite_slug'] ) || false !== disp_boolean( $taxonomy['rewrite_withfront'] ) ) {
|
256 |
-
$rewrite_start = '[';
|
257 |
-
$rewrite_end = ']';
|
258 |
-
|
259 |
-
$rewrite = $rewrite_start . $rewrite_slug . $rewrite_withfront . $rewrite_hierarchcial . $rewrite_end;
|
260 |
-
}
|
261 |
-
} else {
|
262 |
-
$rewrite = disp_boolean( $taxonomy['rewrite'] );
|
263 |
-
}
|
264 |
-
$public = isset( $taxonomy['public'] ) ? disp_boolean( $taxonomy['public'] ) : 'true';
|
265 |
-
$publicly_queryable = isset( $taxonomy['publicly_queryable'] ) ? disp_boolean( $taxonomy['publicly_queryable'] ) : disp_boolean( $taxonomy['public'] );
|
266 |
-
$show_in_quick_edit = isset( $taxonomy['show_in_quick_edit'] ) ? disp_boolean( $taxonomy['show_in_quick_edit'] ) : disp_boolean( $taxonomy['show_ui'] );
|
267 |
-
$show_tagcloud = isset( $taxonomy['show_tagcloud'] ) ? disp_boolean( $taxonomy['show_tagcloud'] ) : disp_boolean( $taxonomy['show_ui'] );
|
268 |
-
|
269 |
-
$show_in_menu = ( ! empty( $taxonomy['show_in_menu'] ) && false !== get_disp_boolean( $taxonomy['show_in_menu'] ) ) ? 'true' : 'false';
|
270 |
-
if ( empty( $taxonomy['show_in_menu'] ) ) {
|
271 |
-
$show_in_menu = disp_boolean( $taxonomy['show_ui'] );
|
272 |
-
}
|
273 |
-
|
274 |
-
$show_in_nav_menus = ( ! empty( $taxonomy['show_in_nav_menus'] ) && false !== get_disp_boolean( $taxonomy['show_in_nav_menus'] ) ) ? 'true' : 'false';
|
275 |
-
if ( empty( $taxonomy['show_in_nav_menus'] ) ) {
|
276 |
-
$show_in_nav_menus = $public;
|
277 |
-
}
|
278 |
-
|
279 |
-
$show_in_rest = ( ! empty( $taxonomy['show_in_rest'] ) && false !== get_disp_boolean( $taxonomy['show_in_rest'] ) ) ? 'true' : 'false';
|
280 |
-
$rest_base = ! empty( $taxonomy['rest_base'] ) ? $taxonomy['rest_base'] : $taxonomy['name'];
|
281 |
-
$rest_controller_class = ! empty( $taxonomy['rest_controller_class'] ) ? $taxonomy['rest_controller_class'] : 'WP_REST_Terms_Controller';
|
282 |
-
$rest_namespace = ! empty( $taxonomy['rest_namespace'] ) ? $taxonomy['rest_namespace'] : 'wp/v2';
|
283 |
-
|
284 |
-
if ( ! empty( $taxonomy['meta_box_cb'] ) ) {
|
285 |
-
$meta_box_cb = ( false !== get_disp_boolean( $taxonomy['meta_box_cb'] ) ) ? '"' . $taxonomy['meta_box_cb'] . '"' : 'false';
|
286 |
-
}
|
287 |
-
|
288 |
-
$default_term = '';
|
289 |
-
if ( ! empty( $taxonomy['default_term'] ) ) {
|
290 |
-
$term_parts = explode( ',', $taxonomy['default_term'] );
|
291 |
-
$default_term_start = '[';
|
292 |
-
$default_term_end = ']';
|
293 |
-
if ( ! empty( $term_parts[0] ) ) {
|
294 |
-
$default_term .= "'name' => '" . trim( $term_parts[0] ) . "'";
|
295 |
-
}
|
296 |
-
if ( ! empty( $term_parts[1] ) ) {
|
297 |
-
$default_term .= ", 'slug' => '" . trim( $term_parts[1] ) . "'";
|
298 |
-
}
|
299 |
-
if ( ! empty( $term_parts[2] ) ) {
|
300 |
-
$default_term .= ", 'description' => '" . trim( $term_parts[2] ) . "'";
|
301 |
-
}
|
302 |
-
|
303 |
-
$default_term = $default_term_start . $default_term . $default_term_end;
|
304 |
-
}
|
305 |
-
|
306 |
-
$my_theme = wp_get_theme();
|
307 |
-
$textdomain = $my_theme->get( 'TextDomain' );
|
308 |
-
if ( empty( $textdomain ) ) {
|
309 |
-
$textdomain = 'custom-post-type-ui';
|
310 |
-
}
|
311 |
-
?>
|
312 |
-
|
313 |
-
/**
|
314 |
-
* Taxonomy: <?php echo esc_html( $taxonomy['label'] ); ?>.
|
315 |
-
*/
|
316 |
-
|
317 |
-
$labels = [
|
318 |
-
"name" => __( "<?php echo esc_html( $taxonomy['label'] ); ?>", "<?php echo esc_html( $textdomain ); ?>" ),
|
319 |
-
"singular_name" => __( "<?php echo esc_html( $taxonomy['singular_label'] ); ?>", "<?php echo esc_html( $textdomain ); ?>" ),
|
320 |
-
<?php
|
321 |
-
foreach ( $taxonomy['labels'] as $key => $label ) {
|
322 |
-
if ( ! empty( $label ) ) {
|
323 |
-
echo "\t\t" . '"' . esc_html( $key ) . '" => __( "' . esc_html( $label ) . '", "' . esc_html( $textdomain ) . '" ),' . "\n";
|
324 |
-
}
|
325 |
-
}
|
326 |
-
?>
|
327 |
-
];
|
328 |
-
|
329 |
-
<?php
|
330 |
-
$show_graphql = isset( $taxonomy['show_in_graphql'] ) ? (bool) $taxonomy['show_in_graphql'] : false;
|
331 |
-
?>
|
332 |
-
|
333 |
-
$args = [
|
334 |
-
"label" => __( "<?php echo $taxonomy['label']; ?>", "<?php echo $textdomain; ?>" ),
|
335 |
-
"labels" => $labels,
|
336 |
-
"public" => <?php echo $public; ?>,
|
337 |
-
"publicly_queryable" => <?php echo $publicly_queryable; ?>,
|
338 |
-
"hierarchical" => <?php echo $taxonomy['hierarchical']; ?>,
|
339 |
-
"show_ui" => <?php echo disp_boolean( $taxonomy['show_ui'] ); ?>,
|
340 |
-
"show_in_menu" => <?php echo $show_in_menu; ?>,
|
341 |
-
"show_in_nav_menus" => <?php echo $show_in_nav_menus; ?>,
|
342 |
-
"query_var" => <?php echo disp_boolean( $taxonomy['query_var'] );?>,
|
343 |
-
"rewrite" => <?php echo $rewrite; ?>,
|
344 |
-
"show_admin_column" => <?php echo $taxonomy['show_admin_column']; ?>,
|
345 |
-
"show_in_rest" => <?php echo $show_in_rest; ?>,
|
346 |
-
"show_tagcloud" => <?php echo $show_tagcloud; ?>,
|
347 |
-
"rest_base" => "<?php echo $rest_base; ?>",
|
348 |
-
"rest_controller_class" => "<?php echo $rest_controller_class; ?>",
|
349 |
-
"rest_namespace" => "<?php echo $rest_namespace; ?>",
|
350 |
-
"show_in_quick_edit" => <?php echo $show_in_quick_edit; ?>,
|
351 |
-
"sort" => <?php echo disp_boolean( $taxonomy['sort'] ); ?>,
|
352 |
-
<?php if ( $show_graphql ) : ?>
|
353 |
-
"show_in_graphql" => <?php echo disp_boolean( $taxonomy['show_in_graphql'] ); ?>,
|
354 |
-
"graphql_single_name" => "<?php echo esc_html( $taxonomy['graphql_single_name'] ); ?>",
|
355 |
-
"graphql_plural_name" => "<?php echo esc_html( $taxonomy['graphql_plural_name'] ); ?>",
|
356 |
-
<?php else: ?>
|
357 |
-
"show_in_graphql" => <?php echo disp_boolean( false ); ?>,
|
358 |
-
<?php endif; ?>
|
359 |
-
<?php if ( ! empty( $meta_box_cb ) ) { ?>
|
360 |
-
"meta_box_cb" => <?php echo $meta_box_cb; ?>,
|
361 |
-
<?php } ?>
|
362 |
-
<?php if ( ! empty( $default_term ) ) { ?>
|
363 |
-
"default_term" => <?php echo $default_term; ?>,
|
364 |
-
<?php } ?>
|
365 |
-
];
|
366 |
-
register_taxonomy( "<?php echo esc_html( $taxonomy['name'] ); ?>", <?php echo $post_types; ?>, $args );
|
367 |
-
<?php
|
368 |
-
}
|
369 |
-
|
370 |
-
/**
|
371 |
-
* Display our copy-able code for registered post types.
|
372 |
-
*
|
373 |
-
* @since 1.0.0
|
374 |
-
* @since 1.2.0 Added $cptui_post_types parameter.
|
375 |
-
* @since 1.2.0 Added $single parameter.
|
376 |
-
*
|
377 |
-
* @param array $cptui_post_types Array of post types to render. Optional.
|
378 |
-
* @param bool $single Whether or not we are rendering a single post type. Optional. Default false.
|
379 |
-
*/
|
380 |
-
function cptui_get_post_type_code( $cptui_post_types = [], $single = false ) {
|
381 |
-
// Whitespace very much matters here, thus why it's all flush against the left side.
|
382 |
-
if ( ! empty( $cptui_post_types ) ) {
|
383 |
-
$callback = 'cptui_register_my_cpts';
|
384 |
-
if ( $single ) {
|
385 |
-
$key = key( $cptui_post_types );
|
386 |
-
$callback = 'cptui_register_my_cpts_' . str_replace( '-', '_', esc_html( $cptui_post_types[ $key ]['name'] ) );
|
387 |
-
}
|
388 |
-
?>
|
389 |
-
|
390 |
-
function <?php echo esc_html( $callback ); ?>() {
|
391 |
-
<?php
|
392 |
-
// Space before this line reflects in textarea.
|
393 |
-
foreach ( $cptui_post_types as $type ) {
|
394 |
-
echo cptui_get_single_post_type_registery( $type );
|
395 |
-
}
|
396 |
-
?>
|
397 |
-
}
|
398 |
-
|
399 |
-
add_action( 'init', '<?php echo esc_html( $callback ); ?>' );
|
400 |
-
<?php
|
401 |
-
} else {
|
402 |
-
esc_html_e( 'No post types to display at this time', 'custom-post-type-ui' );
|
403 |
-
}
|
404 |
-
}
|
405 |
-
|
406 |
-
/**
|
407 |
-
* Create output for single post type to be ready for copy/paste from Get Code.
|
408 |
-
*
|
409 |
-
* @since 1.0.0
|
410 |
-
*
|
411 |
-
* @param array $post_type Post type data to output. Optional.
|
412 |
-
*/
|
413 |
-
function cptui_get_single_post_type_registery( $post_type = [] ) {
|
414 |
-
|
415 |
-
/* This filter is documented in custom-post-type-ui/custom-post-type-ui.php */
|
416 |
-
$post_type['map_meta_cap'] = apply_filters( 'cptui_map_meta_cap', 'true', $post_type['name'], $post_type );
|
417 |
-
|
418 |
-
/* This filter is documented in custom-post-type-ui/custom-post-type-ui.php */
|
419 |
-
$user_supports_params = apply_filters( 'cptui_user_supports_params', [], $post_type['name'], $post_type );
|
420 |
-
if ( is_array( $user_supports_params ) ) {
|
421 |
-
$post_type['supports'] = array_merge( $post_type['supports'], $user_supports_params );
|
422 |
-
}
|
423 |
-
|
424 |
-
$yarpp = false; // Prevent notices.
|
425 |
-
if ( ! empty( $post_type['custom_supports'] ) ) {
|
426 |
-
$custom = explode( ',', $post_type['custom_supports'] );
|
427 |
-
foreach ( $custom as $part ) {
|
428 |
-
// We'll handle YARPP separately.
|
429 |
-
if ( in_array( $part, [ 'YARPP', 'yarpp' ], true ) ) {
|
430 |
-
$yarpp = true;
|
431 |
-
continue;
|
432 |
-
}
|
433 |
-
$post_type['supports'][] = $part;
|
434 |
-
}
|
435 |
-
}
|
436 |
-
|
437 |
-
|
438 |
-
$show_graphql = isset( $post_type['show_in_graphql'] ) ? (bool) $post_type['show_in_graphql'] : false;
|
439 |
-
|
440 |
-
$rewrite_withfront = '';
|
441 |
-
$rewrite = get_disp_boolean( $post_type['rewrite'] );
|
442 |
-
if ( false !== $rewrite ) {
|
443 |
-
$rewrite = disp_boolean( $post_type['rewrite'] );
|
444 |
-
|
445 |
-
$rewrite_slug = ' "slug" => "' . $post_type['name'] . '",';
|
446 |
-
if ( ! empty( $post_type['rewrite_slug'] ) ) {
|
447 |
-
$rewrite_slug = ' "slug" => "' . $post_type['rewrite_slug'] . '",';
|
448 |
-
}
|
449 |
-
|
450 |
-
$withfront = disp_boolean( $post_type['rewrite_withfront'] );
|
451 |
-
if ( ! empty( $withfront ) ) {
|
452 |
-
$rewrite_withfront = ' "with_front" => ' . $withfront . ' ';
|
453 |
-
}
|
454 |
-
|
455 |
-
if ( ! empty( $post_type['rewrite_slug'] ) || ! empty( $post_type['rewrite_withfront'] ) ) {
|
456 |
-
$rewrite_start = '[';
|
457 |
-
$rewrite_end = ']';
|
458 |
-
|
459 |
-
$rewrite = $rewrite_start . $rewrite_slug . $rewrite_withfront . $rewrite_end;
|
460 |
-
}
|
461 |
-
} else {
|
462 |
-
$rewrite = disp_boolean( $post_type['rewrite'] );
|
463 |
-
}
|
464 |
-
$has_archive = get_disp_boolean( $post_type['has_archive'] );
|
465 |
-
if ( false !== $has_archive ) {
|
466 |
-
$has_archive = disp_boolean( $post_type['has_archive'] );
|
467 |
-
if ( ! empty( $post_type['has_archive_string'] ) ) {
|
468 |
-
$has_archive = '"' . $post_type['has_archive_string'] . '"';
|
469 |
-
}
|
470 |
-
} else {
|
471 |
-
$has_archive = disp_boolean( $post_type['has_archive'] );
|
472 |
-
}
|
473 |
-
|
474 |
-
$supports = '';
|
475 |
-
// Do a little bit of php work to get these into strings.
|
476 |
-
if ( ! empty( $post_type['supports'] ) && is_array( $post_type['supports'] ) ) {
|
477 |
-
$supports = '[ "' . implode( '", "', $post_type['supports'] ) . '" ]';
|
478 |
-
}
|
479 |
-
|
480 |
-
if ( in_array( 'none', $post_type['supports'], true ) ) {
|
481 |
-
$supports = 'false';
|
482 |
-
}
|
483 |
-
|
484 |
-
$taxonomies = '';
|
485 |
-
if ( ! empty( $post_type['taxonomies'] ) && is_array( $post_type['taxonomies'] ) ) {
|
486 |
-
$taxonomies = '[ "' . implode( '", "', $post_type['taxonomies'] ) . '" ]';
|
487 |
-
}
|
488 |
-
|
489 |
-
if ( in_array( $post_type['query_var'], [ 'true', 'false', '0', '1' ], true ) ) {
|
490 |
-
$post_type['query_var'] = disp_boolean( $post_type['query_var'] );
|
491 |
-
}
|
492 |
-
if ( ! empty( $post_type['query_var_slug'] ) ) {
|
493 |
-
$post_type['query_var'] = '"' . $post_type['query_var_slug'] . '"';
|
494 |
-
}
|
495 |
-
|
496 |
-
if ( empty( $post_type['show_in_rest'] ) ) {
|
497 |
-
$post_type['show_in_rest'] = 'false';
|
498 |
-
}
|
499 |
-
$rest_controller_class = ! empty( $post_type['rest_controller_class'] ) ? $post_type['rest_controller_class'] : 'WP_REST_Posts_Controller';
|
500 |
-
$rest_namespace = ! empty( $post_type['rest_namespace'] ) ? $post_type['rest_namespace'] : 'wp/v2';
|
501 |
-
|
502 |
-
$show_in_menu = get_disp_boolean( $post_type['show_in_menu'] );
|
503 |
-
if ( false !== $show_in_menu ) {
|
504 |
-
$show_in_menu = disp_boolean( $post_type['show_in_menu'] );
|
505 |
-
if ( ! empty( $post_type['show_in_menu_string'] ) ) {
|
506 |
-
$show_in_menu = '"' . $post_type['show_in_menu_string'] . '"';
|
507 |
-
}
|
508 |
-
} else {
|
509 |
-
$show_in_menu = disp_boolean( $post_type['show_in_menu'] );
|
510 |
-
}
|
511 |
-
|
512 |
-
$delete_with_user = 'false';
|
513 |
-
if ( isset( $post_type['delete_with_user'] ) ) {
|
514 |
-
$delete_with_user = disp_boolean( $post_type['delete_with_user'] );
|
515 |
-
}
|
516 |
-
|
517 |
-
$can_export = 'true';
|
518 |
-
if ( isset( $post_type['can_export'] ) ) {
|
519 |
-
$can_export = disp_boolean( $post_type['can_export'] );
|
520 |
-
}
|
521 |
-
|
522 |
-
$public = isset( $post_type['public'] ) ? disp_boolean( $post_type['public'] ) : 'true';
|
523 |
-
$show_in_nav_menus = ( ! empty( $post_type['show_in_nav_menus'] ) && false !== get_disp_boolean( $post_type['show_in_nav_menus'] ) ) ? 'true' : 'false';
|
524 |
-
if ( empty( $post_type['show_in_nav_menus'] ) ) {
|
525 |
-
$show_in_nav_menus = $public;
|
526 |
-
}
|
527 |
-
|
528 |
-
$capability_type = '"post"';
|
529 |
-
if ( ! empty( $post_type['capability_type'] ) ) {
|
530 |
-
$capability_type = '"' . $post_type['capability_type'] . '"';
|
531 |
-
if ( false !== strpos( $post_type['capability_type'], ',' ) ) {
|
532 |
-
$caps = array_map( 'trim', explode( ',', $post_type['capability_type'] ) );
|
533 |
-
if ( count( $caps ) > 2 ) {
|
534 |
-
$caps = array_slice( $caps, 0, 2 );
|
535 |
-
}
|
536 |
-
$capability_type = '[ "' . $caps[0] . '", "' . $caps[1] . '" ]';
|
537 |
-
}
|
538 |
-
}
|
539 |
-
|
540 |
-
$post_type['description'] = addslashes( $post_type['description'] );
|
541 |
-
|
542 |
-
$my_theme = wp_get_theme();
|
543 |
-
$textdomain = $my_theme->get( 'TextDomain' );
|
544 |
-
if ( empty( $textdomain ) ) {
|
545 |
-
$textdomain = 'custom-post-type-ui';
|
546 |
-
}
|
547 |
-
?>
|
548 |
-
|
549 |
-
/**
|
550 |
-
* Post Type: <?php echo $post_type['label']; ?>.
|
551 |
-
*/
|
552 |
-
|
553 |
-
$labels = [
|
554 |
-
"name" => __( "<?php echo $post_type['label']; ?>", "<?php echo $textdomain; ?>" ),
|
555 |
-
"singular_name" => __( "<?php echo $post_type['singular_label']; ?>", "<?php echo $textdomain; ?>" ),
|
556 |
-
<?php
|
557 |
-
foreach ( $post_type['labels'] as $key => $label ) {
|
558 |
-
if ( ! empty( $label ) ) {
|
559 |
-
if ( 'parent' === $key && ! array_key_exists( 'parent_item_colon', $post_type['labels'] ) ) {
|
560 |
-
// Fix for incorrect label key. See #439.
|
561 |
-
echo "\t\t" . '"' . 'parent_item_colon' . '" => __( "' . $label . '", "' . $textdomain . '" ),' . "\n";
|
562 |
-
} else {
|
563 |
-
echo "\t\t" . '"' . $key . '" => __( "' . $label . '", "' . $textdomain . '" ),' . "\n";
|
564 |
-
}
|
565 |
-
}
|
566 |
-
}
|
567 |
-
?>
|
568 |
-
];
|
569 |
-
|
570 |
-
$args = [
|
571 |
-
"label" => __( "<?php echo $post_type['label']; ?>", "<?php echo $textdomain; ?>" ),
|
572 |
-
"labels" => $labels,
|
573 |
-
"description" => "<?php echo $post_type['description']; ?>",
|
574 |
-
"public" => <?php echo disp_boolean( $post_type['public'] ); ?>,
|
575 |
-
"publicly_queryable" => <?php echo disp_boolean( $post_type['publicly_queryable'] ); ?>,
|
576 |
-
"show_ui" => <?php echo disp_boolean( $post_type['show_ui'] ); ?>,
|
577 |
-
"show_in_rest" => <?php echo disp_boolean( $post_type['show_in_rest'] ); ?>,
|
578 |
-
"rest_base" => "<?php echo $post_type['rest_base']; ?>",
|
579 |
-
"rest_controller_class" => "<?php echo $rest_controller_class; ?>",
|
580 |
-
"rest_namespace" => "<?php echo $rest_namespace; ?>",
|
581 |
-
"has_archive" => <?php echo $has_archive; ?>,
|
582 |
-
"show_in_menu" => <?php echo $show_in_menu; ?>,
|
583 |
-
"show_in_nav_menus" => <?php echo $show_in_nav_menus; ?>,
|
584 |
-
"delete_with_user" => <?php echo $delete_with_user; ?>,
|
585 |
-
"exclude_from_search" => <?php echo disp_boolean( $post_type['exclude_from_search'] ); ?>,
|
586 |
-
"capability_type" => <?php echo $capability_type; ?>,
|
587 |
-
"map_meta_cap" => <?php echo disp_boolean( $post_type['map_meta_cap'] ); ?>,
|
588 |
-
"hierarchical" => <?php echo disp_boolean( $post_type['hierarchical'] ); ?>,
|
589 |
-
"can_export" => <?php echo $can_export; ?>,
|
590 |
-
"rewrite" => <?php echo $rewrite; ?>,
|
591 |
-
"query_var" => <?php echo $post_type['query_var']; ?>,
|
592 |
-
<?php if ( ! empty( $post_type['menu_position'] ) ) { ?>
|
593 |
-
"menu_position" => <?php echo $post_type['menu_position']; ?>,
|
594 |
-
<?php } ?>
|
595 |
-
<?php if ( ! empty( $post_type['menu_icon'] ) ) { ?>
|
596 |
-
"menu_icon" => "<?php echo $post_type['menu_icon']; ?>",
|
597 |
-
<?php } ?>
|
598 |
-
<?php if ( ! empty( $post_type['register_meta_box_cb'] ) ) { ?>
|
599 |
-
"register_meta_box_cb" => "<?php echo $post_type['register_meta_box_cb']; ?>",
|
600 |
-
<?php } ?>
|
601 |
-
<?php if ( ! empty( $supports ) ) { ?>
|
602 |
-
"supports" => <?php echo $supports; ?>,
|
603 |
-
<?php } ?>
|
604 |
-
<?php if ( ! empty( $taxonomies ) ) { ?>
|
605 |
-
"taxonomies" => <?php echo $taxonomies; ?>,
|
606 |
-
<?php } ?>
|
607 |
-
<?php if ( true === $yarpp ) { ?>
|
608 |
-
"yarpp_support" => <?php echo disp_boolean( $yarpp ); ?>,
|
609 |
-
<?php } ?>
|
610 |
-
<?php if ( $show_graphql ) : ?>
|
611 |
-
"show_in_graphql" => <?php echo disp_boolean( $post_type['show_in_graphql'] ); ?>,
|
612 |
-
"graphql_single_name" => "<?php echo esc_html( $post_type['graphql_single_name'] ); ?>",
|
613 |
-
"graphql_plural_name" => "<?php echo esc_html( $post_type['graphql_plural_name'] ); ?>",
|
614 |
-
<?php else: ?>
|
615 |
-
"show_in_graphql" => <?php echo disp_boolean( false ); ?>,
|
616 |
-
<?php endif; ?>
|
617 |
-
];
|
618 |
-
|
619 |
-
register_post_type( "<?php echo esc_html( $post_type['name'] ); ?>", $args );
|
620 |
-
<?php
|
621 |
-
}
|
622 |
-
|
623 |
/**
|
624 |
* Import the posted JSON data from a separate export.
|
625 |
*
|
@@ -663,7 +230,7 @@ function cptui_import_types_taxes_settings( $postdata = [] ) {
|
|
663 |
*
|
664 |
* @param bool $value Default to no data.
|
665 |
*/
|
666 |
-
$third_party_taxonomy_data
|
667 |
|
668 |
if ( false !== $third_party_post_type_data ) {
|
669 |
$postdata['cptui_post_import'] = $third_party_post_type_data;
|
@@ -691,7 +258,7 @@ function cptui_import_types_taxes_settings( $postdata = [] ) {
|
|
691 |
* @param bool $value Whether or not someone else deleted successfully. Default false.
|
692 |
* @param array $postdata Post type data.
|
693 |
*/
|
694 |
-
if ( false === ( $success = apply_filters( 'cptui_post_type_import_delete_save', false, $postdata ) ) ) {
|
695 |
$success = delete_option( 'cptui_post_types' );
|
696 |
}
|
697 |
}
|
@@ -699,7 +266,7 @@ function cptui_import_types_taxes_settings( $postdata = [] ) {
|
|
699 |
if ( $settings ) {
|
700 |
if ( false !== cptui_get_post_type_data() ) {
|
701 |
/** This filter is documented in /inc/import-export.php */
|
702 |
-
if ( false === ( $success = apply_filters( 'cptui_post_type_import_delete_save', false, $postdata ) ) ) {
|
703 |
delete_option( 'cptui_post_types' );
|
704 |
}
|
705 |
}
|
@@ -712,7 +279,7 @@ function cptui_import_types_taxes_settings( $postdata = [] ) {
|
|
712 |
* @param bool $value Whether or not someone else updated successfully. Default false.
|
713 |
* @param array $postdata Post type data.
|
714 |
*/
|
715 |
-
if ( false === ( $success = apply_filters( 'cptui_post_type_import_update_save', false, $postdata ) ) ) {
|
716 |
$success = update_option( 'cptui_post_types', $settings );
|
717 |
}
|
718 |
}
|
@@ -740,7 +307,7 @@ function cptui_import_types_taxes_settings( $postdata = [] ) {
|
|
740 |
* @param bool $value Whether or not someone else deleted successfully. Default false.
|
741 |
* @param array $postdata Taxonomy data
|
742 |
*/
|
743 |
-
if ( false === ( $success = apply_filters( 'cptui_taxonomy_import_delete_save', false, $postdata ) ) ) {
|
744 |
$success = delete_option( 'cptui_taxonomies' );
|
745 |
}
|
746 |
}
|
@@ -748,7 +315,7 @@ function cptui_import_types_taxes_settings( $postdata = [] ) {
|
|
748 |
if ( $settings ) {
|
749 |
if ( false !== cptui_get_taxonomy_data() ) {
|
750 |
/** This filter is documented in /inc/import-export.php */
|
751 |
-
if ( false === ( $success = apply_filters( 'cptui_taxonomy_import_delete_save', false, $postdata ) ) ) {
|
752 |
delete_option( 'cptui_taxonomies' );
|
753 |
}
|
754 |
}
|
@@ -760,7 +327,7 @@ function cptui_import_types_taxes_settings( $postdata = [] ) {
|
|
760 |
* @param bool $value Whether or not someone else updated successfully. Default false.
|
761 |
* @param array $postdata Taxonomy data.
|
762 |
*/
|
763 |
-
if ( false === ( $success = apply_filters( 'cptui_taxonomy_import_update_save', false, $postdata ) ) ) {
|
764 |
$success = update_option( 'cptui_taxonomies', $settings );
|
765 |
}
|
766 |
}
|
@@ -782,206 +349,109 @@ function cptui_import_types_taxes_settings( $postdata = [] ) {
|
|
782 |
* @internal
|
783 |
*/
|
784 |
function cptui_render_posttypes_taxonomies_section() {
|
785 |
-
?>
|
786 |
|
787 |
<p><?php esc_html_e( 'If you are wanting to migrate registered post types or taxonomies from this site to another, that will also use Custom Post Type UI, use the import and export functionality. If you are moving away from Custom Post Type UI, use the information in the "Get Code" tab.', 'custom-post-type-ui' ); ?></p>
|
788 |
|
789 |
-
<p>
|
790 |
-
<?php
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
?>
|
797 |
-
</p>
|
798 |
-
<table class="form-table cptui-table">
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
<
|
835 |
-
</p>
|
836 |
-
</td>
|
837 |
-
</tr>
|
838 |
-
<?php } elseif ( ! empty( $_GET ) && 'taxonomies' === $_GET['action'] ) { ?>
|
839 |
-
<tr>
|
840 |
-
<td class="outer">
|
841 |
-
<h2><label for="cptui_tax_import"><?php esc_html_e( 'Import Taxonomies', 'custom-post-type-ui' ); ?></label></h2>
|
842 |
-
|
843 |
-
<form method="post">
|
844 |
-
<textarea class="cptui_tax_import" placeholder="<?php esc_attr_e( 'Paste content here.', 'custom-post-type-ui' ); ?>" id="cptui_tax_import" name="cptui_tax_import"></textarea>
|
845 |
-
|
846 |
-
<p class="wp-ui-highlight">
|
847 |
-
<strong><?php esc_html_e( 'Note:', 'custom-post-type-ui' ); ?></strong> <?php esc_html_e( 'Importing will overwrite previous registered settings.', 'custom-post-type-ui' ); ?>
|
848 |
-
</p>
|
849 |
|
850 |
<p>
|
851 |
-
<strong><?php esc_html_e( '
|
852 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
853 |
|
854 |
<p>
|
855 |
-
<
|
856 |
</p>
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
<h2><label for="cptui_tax_export"><?php esc_html_e( 'Export Taxonomies settings', 'custom-post-type-ui' ); ?></label></h2>
|
862 |
-
<?php
|
863 |
-
$cptui_taxonomies = cptui_get_taxonomy_data();
|
864 |
-
if ( ! empty( $cptui_taxonomies ) ) {
|
865 |
-
$content = esc_html( json_encode( $cptui_taxonomies ) );
|
866 |
-
} else {
|
867 |
-
$content = esc_html__( 'No taxonomies registered yet.', 'custom-post-type-ui' );
|
868 |
-
}
|
869 |
-
?>
|
870 |
-
<textarea title="<?php esc_attr_e( 'To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'custom-post-type-ui' ); ?>" onclick="this.focus();this.select()" onfocus="this.focus();this.select();" readonly="readonly" aria-readonly="true" class="cptui_tax_import" id="cptui_tax_export" name="cptui_tax_export"><?php echo $content; //WPCS: XSS ok, sanitization ok.?></textarea>
|
871 |
-
|
872 |
-
<p>
|
873 |
-
<strong><?php esc_html_e( 'Use the content above to import current taxonomies into a different WordPress site. You can also use this to simply back up your taxonomy settings.', 'custom-post-type-ui' ); ?></strong>
|
874 |
-
</p>
|
875 |
-
</td>
|
876 |
-
</tr>
|
877 |
-
<?php } ?>
|
878 |
-
</table>
|
879 |
-
<?php
|
880 |
-
}
|
881 |
-
|
882 |
-
/**
|
883 |
-
* Content for the Get Code tab.
|
884 |
-
*
|
885 |
-
* @since 1.2.0
|
886 |
-
*
|
887 |
-
* @internal
|
888 |
-
*/
|
889 |
-
function cptui_render_getcode_section() {
|
890 |
-
?>
|
891 |
-
<h1><?php esc_html_e( 'Get Post Type and Taxonomy Code', 'custom-post-type-ui' ); ?></h1>
|
892 |
-
|
893 |
-
<h2><?php esc_html_e( 'All Custom Post Type UI Post Types', 'custom-post-type-ui' ); ?></h2>
|
894 |
-
|
895 |
-
<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>
|
896 |
-
|
897 |
-
<?php $cptui_post_types = cptui_get_post_type_data(); ?>
|
898 |
-
<p><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></p>
|
899 |
-
<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>
|
900 |
-
|
901 |
-
<?php
|
902 |
-
if ( ! empty( $cptui_post_types ) ) {
|
903 |
-
foreach ( $cptui_post_types as $post_type ) {
|
904 |
-
?>
|
905 |
-
<h2 id="<?php echo esc_attr( $post_type['name'] ); ?>">
|
906 |
-
<?php
|
907 |
-
$type = ! empty( $post_type['label'] ) ? esc_html( $post_type['label'] ) : esc_html( $post_type['name'] );
|
908 |
-
printf( esc_html__( '%s Post Type', 'custom-post-type-ui' ), esc_html( $type ) ); ?></h2>
|
909 |
-
<p><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></p>
|
910 |
-
<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>
|
911 |
-
<?php
|
912 |
-
}
|
913 |
-
}
|
914 |
-
?>
|
915 |
-
|
916 |
-
<h2><?php esc_html_e( 'All Custom Post Type UI Taxonomies', 'custom-post-type-ui' ); ?></h2>
|
917 |
-
|
918 |
-
<?php $cptui_taxonomies = cptui_get_taxonomy_data(); ?>
|
919 |
-
<p><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></p>
|
920 |
-
<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>
|
921 |
-
|
922 |
-
<?php
|
923 |
-
if ( ! empty( $cptui_taxonomies ) ) {
|
924 |
-
foreach ( $cptui_taxonomies as $taxonomy ) {
|
925 |
-
?>
|
926 |
-
<h2 id="<?php echo esc_attr( $taxonomy['name'] ); ?>">
|
927 |
-
<?php
|
928 |
-
$tax = ! empty( $taxonomy['label'] ) ? esc_html( $taxonomy['label'] ) : esc_html( $taxonomy['name'] );
|
929 |
-
printf( esc_html__( '%s Taxonomy', 'custom-post-type-ui' ), esc_html( $tax ) );
|
930 |
-
?>
|
931 |
-
</h2>
|
932 |
-
<p><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></p>
|
933 |
-
<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>
|
934 |
-
<?php
|
935 |
-
}
|
936 |
-
}
|
937 |
-
?>
|
938 |
<?php
|
939 |
}
|
940 |
|
941 |
-
/**
|
942 |
-
* Content for the Debug Info tab.
|
943 |
-
*
|
944 |
-
* @since 1.2.0
|
945 |
-
*
|
946 |
-
* @internal
|
947 |
-
*/
|
948 |
-
function cptui_render_debuginfo_section() {
|
949 |
-
|
950 |
-
$debuginfo = new CPTUI_Debug_Info();
|
951 |
-
|
952 |
-
echo '<form id="cptui_debug_info" method="post">';
|
953 |
-
$debuginfo->tab_site_info();
|
954 |
-
|
955 |
-
wp_nonce_field( 'cptui_debuginfo_nonce_action', 'cptui_debuginfo_nonce_field' );
|
956 |
-
|
957 |
-
if ( ! empty( $_POST ) && isset( $_POST['cptui_debug_info_email'] ) && isset( $_POST['cptui_debuginfo_nonce_field'] ) ) {
|
958 |
-
wp_verify_nonce( 'cptui_debuginfo_nonce_field', 'cptui_debuginfo_nonce_action' );
|
959 |
-
|
960 |
-
$email_args = [];
|
961 |
-
$email_args['email'] = sanitize_text_field( $_POST['cptui_debug_info_email'] );
|
962 |
-
$debuginfo->send_email( $email_args );
|
963 |
-
}
|
964 |
-
|
965 |
-
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>';
|
966 |
-
|
967 |
-
/**
|
968 |
-
* Filters the text value to use on the button when sending debug information.
|
969 |
-
*
|
970 |
-
* @since 1.2.0
|
971 |
-
*
|
972 |
-
* @param string $value Text to use for the button.
|
973 |
-
*/
|
974 |
-
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>';
|
975 |
-
echo '</form>';
|
976 |
-
|
977 |
-
/**
|
978 |
-
* Fires after the display of the site information.
|
979 |
-
*
|
980 |
-
* @since 1.3.0
|
981 |
-
*/
|
982 |
-
do_action( 'cptui_after_site_info' );
|
983 |
-
}
|
984 |
-
|
985 |
/**
|
986 |
* Renders various tab sections for the Tools page, based on current tab.
|
987 |
*
|
@@ -1012,30 +482,30 @@ add_action( 'cptui_tools_sections', 'cptui_render_tools' );
|
|
1012 |
* @since 1.5.0
|
1013 |
*/
|
1014 |
function cptui_do_import_types_taxes() {
|
1015 |
-
|
1016 |
-
if ( ! empty( $_POST ) &&
|
1017 |
-
|
1018 |
-
|
1019 |
) {
|
1020 |
$data = [];
|
1021 |
$decoded_post_data = null;
|
1022 |
$decoded_tax_data = null;
|
1023 |
-
if ( ! empty( $_POST['cptui_post_import'] ) ) {
|
1024 |
-
$decoded_post_data = json_decode( stripslashes_deep( trim( $_POST['cptui_post_import'] ) ), true );
|
1025 |
}
|
1026 |
|
1027 |
-
if ( ! empty( $_POST['cptui_tax_import'] ) ) {
|
1028 |
-
$decoded_tax_data = json_decode( stripslashes_deep( trim( $_POST['cptui_tax_import'] ) ), true );
|
1029 |
}
|
1030 |
|
1031 |
if (
|
1032 |
empty( $decoded_post_data ) &&
|
1033 |
empty( $decoded_tax_data ) &&
|
1034 |
(
|
1035 |
-
! empty( $_POST['cptui_post_import'] ) && '{""}' !== stripslashes_deep( trim( $_POST['cptui_post_import'] ) )
|
1036 |
) &&
|
1037 |
(
|
1038 |
-
! empty( $_POST['cptui_tax_import'] ) && '{""}' !== stripslashes_deep( trim( $_POST['cptui_tax_import'] ) )
|
1039 |
)
|
1040 |
) {
|
1041 |
return;
|
@@ -1046,10 +516,10 @@ function cptui_do_import_types_taxes() {
|
|
1046 |
if ( null !== $decoded_tax_data ) {
|
1047 |
$data['cptui_tax_import'] = $decoded_tax_data;
|
1048 |
}
|
1049 |
-
if ( ! empty( $_POST['cptui_post_import'] ) && '{""}' === stripslashes_deep( trim( $_POST['cptui_post_import'] ) ) ) {
|
1050 |
$data['delete'] = 'type_true';
|
1051 |
}
|
1052 |
-
if ( ! empty( $_POST['cptui_tax_import'] ) && '{""}' === stripslashes_deep( trim( $_POST['cptui_tax_import'] ) ) ) {
|
1053 |
$data['delete'] = 'tax_true';
|
1054 |
}
|
1055 |
$success = cptui_import_types_taxes_settings( $data );
|
129 |
function cptui_tools() {
|
130 |
|
131 |
$tab = 'post_types';
|
132 |
+
if ( ! empty( $_GET ) ) { // phpcs:ignore WordPress.Security.NonceVerification
|
133 |
+
if ( ! empty( $_GET['action'] ) && 'taxonomies' === $_GET['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification
|
134 |
$tab = 'taxonomies';
|
135 |
+
} elseif ( ! empty( $_GET['action'] ) && 'get_code' === $_GET['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification
|
136 |
$tab = 'get_code';
|
137 |
+
} elseif ( ! empty( $_GET['action'] ) && 'debuginfo' === $_GET['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification
|
138 |
$tab = 'debuginfo';
|
139 |
}
|
140 |
}
|
187 |
echo '</div><!-- End .wrap -->';
|
188 |
}
|
189 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
/**
|
191 |
* Import the posted JSON data from a separate export.
|
192 |
*
|
230 |
*
|
231 |
* @param bool $value Default to no data.
|
232 |
*/
|
233 |
+
$third_party_taxonomy_data = apply_filters( 'cptui_third_party_taxonomy_import', false );
|
234 |
|
235 |
if ( false !== $third_party_post_type_data ) {
|
236 |
$postdata['cptui_post_import'] = $third_party_post_type_data;
|
258 |
* @param bool $value Whether or not someone else deleted successfully. Default false.
|
259 |
* @param array $postdata Post type data.
|
260 |
*/
|
261 |
+
if ( false === ( $success = apply_filters( 'cptui_post_type_import_delete_save', false, $postdata ) ) ) { // phpcs:ignore.
|
262 |
$success = delete_option( 'cptui_post_types' );
|
263 |
}
|
264 |
}
|
266 |
if ( $settings ) {
|
267 |
if ( false !== cptui_get_post_type_data() ) {
|
268 |
/** This filter is documented in /inc/import-export.php */
|
269 |
+
if ( false === ( $success = apply_filters( 'cptui_post_type_import_delete_save', false, $postdata ) ) ) { // phpcs:ignore.
|
270 |
delete_option( 'cptui_post_types' );
|
271 |
}
|
272 |
}
|
279 |
* @param bool $value Whether or not someone else updated successfully. Default false.
|
280 |
* @param array $postdata Post type data.
|
281 |
*/
|
282 |
+
if ( false === ( $success = apply_filters( 'cptui_post_type_import_update_save', false, $postdata ) ) ) { // phpcs:ignore.
|
283 |
$success = update_option( 'cptui_post_types', $settings );
|
284 |
}
|
285 |
}
|
307 |
* @param bool $value Whether or not someone else deleted successfully. Default false.
|
308 |
* @param array $postdata Taxonomy data
|
309 |
*/
|
310 |
+
if ( false === ( $success = apply_filters( 'cptui_taxonomy_import_delete_save', false, $postdata ) ) ) { // phpcs:ignore.
|
311 |
$success = delete_option( 'cptui_taxonomies' );
|
312 |
}
|
313 |
}
|
315 |
if ( $settings ) {
|
316 |
if ( false !== cptui_get_taxonomy_data() ) {
|
317 |
/** This filter is documented in /inc/import-export.php */
|
318 |
+
if ( false === ( $success = apply_filters( 'cptui_taxonomy_import_delete_save', false, $postdata ) ) ) { // phpcs:ignore.
|
319 |
delete_option( 'cptui_taxonomies' );
|
320 |
}
|
321 |
}
|
327 |
* @param bool $value Whether or not someone else updated successfully. Default false.
|
328 |
* @param array $postdata Taxonomy data.
|
329 |
*/
|
330 |
+
if ( false === ( $success = apply_filters( 'cptui_taxonomy_import_update_save', false, $postdata ) ) ) { // phpcs:ignore.
|
331 |
$success = update_option( 'cptui_taxonomies', $settings );
|
332 |
}
|
333 |
}
|
349 |
* @internal
|
350 |
*/
|
351 |
function cptui_render_posttypes_taxonomies_section() {
|
352 |
+
?>
|
353 |
|
354 |
<p><?php esc_html_e( 'If you are wanting to migrate registered post types or taxonomies from this site to another, that will also use Custom Post Type UI, use the import and export functionality. If you are moving away from Custom Post Type UI, use the information in the "Get Code" tab.', 'custom-post-type-ui' ); ?></p>
|
355 |
|
356 |
+
<p>
|
357 |
+
<?php
|
358 |
+
printf(
|
359 |
+
'<strong>%s</strong>: %s',
|
360 |
+
esc_html__( 'NOTE', 'custom-post-type-ui' ),
|
361 |
+
esc_html__( 'This will not export the associated posts or taxonomy terms, just the settings.', 'custom-post-type-ui' )
|
362 |
+
);
|
363 |
+
?>
|
364 |
+
</p>
|
365 |
+
<table class="form-table cptui-table">
|
366 |
+
<?php if ( ! empty( $_GET ) && empty( $_GET['action'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification ?>
|
367 |
+
<tr>
|
368 |
+
<td class="outer">
|
369 |
+
<h2><label for="cptui_post_import"><?php esc_html_e( 'Import Post Types', 'custom-post-type-ui' ); ?></label></h2>
|
370 |
+
|
371 |
+
<form method="post">
|
372 |
+
<textarea class="cptui_post_import" placeholder="<?php esc_attr_e( 'Paste content here.', 'custom-post-type-ui' ); ?>" id="cptui_post_import" name="cptui_post_import"></textarea>
|
373 |
+
|
374 |
+
<p class="wp-ui-highlight">
|
375 |
+
<strong><?php esc_html_e( 'Note:', 'custom-post-type-ui' ); ?></strong> <?php esc_html_e( 'Importing will overwrite previous registered settings.', 'custom-post-type-ui' ); ?>
|
376 |
+
</p>
|
377 |
+
|
378 |
+
<p>
|
379 |
+
<strong><?php esc_html_e( 'To import post types from a different WordPress site, paste the exported content from that site and click the "Import" button.', 'custom-post-type-ui' ); ?></strong>
|
380 |
+
</p>
|
381 |
+
|
382 |
+
<p>
|
383 |
+
<input class="button button-primary" type="submit" value="<?php esc_attr_e( 'Import', 'custom-post-type-ui' ); ?>" />
|
384 |
+
</p>
|
385 |
+
<?php wp_nonce_field( 'cptui_typetaximport_nonce_action', 'cptui_typetaximport_nonce_field' ); ?>
|
386 |
+
</form>
|
387 |
+
</td>
|
388 |
+
<td class="outer">
|
389 |
+
<h2><label for="cptui_post_export"><?php esc_html_e( 'Export Post Types settings', 'custom-post-type-ui' ); ?></label></h2>
|
390 |
+
<?php
|
391 |
+
$cptui_post_types = cptui_get_post_type_data();
|
392 |
+
if ( ! empty( $cptui_post_types ) ) {
|
393 |
+
foreach ( $cptui_post_types as $type => $values ) {
|
394 |
+
$cptui_post_types[ $type ]['description'] = wp_slash( html_entity_decode( $values['description'] ) );
|
395 |
+
}
|
396 |
+
$content = wp_json_encode( $cptui_post_types );
|
397 |
+
} else {
|
398 |
+
$content = esc_html__( 'No post types registered yet.', 'custom-post-type-ui' );
|
399 |
+
}
|
400 |
+
?>
|
401 |
+
<textarea title="<?php esc_attr_e( 'To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'custom-post-type-ui' ); ?>" onclick="this.focus();this.select();" onfocus="this.focus();this.select();" readonly="readonly" aria-readonly="true" class="cptui_post_import" id="cptui_post_export" name="cptui_post_export"><?php echo $content; // phpcs:ignore. ?></textarea>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
402 |
|
403 |
<p>
|
404 |
+
<strong><?php esc_html_e( 'Use the content above to import current post types into a different WordPress site. You can also use this to simply back up your post type settings.', 'custom-post-type-ui' ); ?></strong>
|
405 |
</p>
|
406 |
+
</td>
|
407 |
+
</tr>
|
408 |
+
<?php } elseif ( ! empty( $_GET ) && 'taxonomies' === $_GET['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification ?>
|
409 |
+
<tr>
|
410 |
+
<td class="outer">
|
411 |
+
<h2><label for="cptui_tax_import"><?php esc_html_e( 'Import Taxonomies', 'custom-post-type-ui' ); ?></label></h2>
|
412 |
+
|
413 |
+
<form method="post">
|
414 |
+
<textarea class="cptui_tax_import" placeholder="<?php esc_attr_e( 'Paste content here.', 'custom-post-type-ui' ); ?>" id="cptui_tax_import" name="cptui_tax_import"></textarea>
|
415 |
+
|
416 |
+
<p class="wp-ui-highlight">
|
417 |
+
<strong><?php esc_html_e( 'Note:', 'custom-post-type-ui' ); ?></strong> <?php esc_html_e( 'Importing will overwrite previous registered settings.', 'custom-post-type-ui' ); ?>
|
418 |
+
</p>
|
419 |
+
|
420 |
+
<p>
|
421 |
+
<strong><?php esc_html_e( 'To import taxonomies from a different WordPress site, paste the exported content from that site and click the "Import" button.', 'custom-post-type-ui' ); ?></strong>
|
422 |
+
</p>
|
423 |
+
|
424 |
+
<p>
|
425 |
+
<input class="button button-primary" type="submit" value="<?php esc_attr_e( 'Import', 'custom-post-type-ui' ); ?>" />
|
426 |
+
</p>
|
427 |
+
<?php wp_nonce_field( 'cptui_typetaximport_nonce_action', 'cptui_typetaximport_nonce_field' ); ?>
|
428 |
+
</form>
|
429 |
+
</td>
|
430 |
+
<td class="outer">
|
431 |
+
<h2><label for="cptui_tax_export"><?php esc_html_e( 'Export Taxonomies settings', 'custom-post-type-ui' ); ?></label></h2>
|
432 |
+
<?php
|
433 |
+
$cptui_taxonomies = cptui_get_taxonomy_data();
|
434 |
+
if ( ! empty( $cptui_taxonomies ) ) {
|
435 |
+
foreach ( $cptui_taxonomies as $tax => $values ) {
|
436 |
+
$cptui_taxonomies[ $tax ]['description'] = wp_slash( html_entity_decode( $values['description'] ) );
|
437 |
+
}
|
438 |
+
$content = wp_json_encode( $cptui_taxonomies );
|
439 |
+
} else {
|
440 |
+
$content = esc_html__( 'No taxonomies registered yet.', 'custom-post-type-ui' );
|
441 |
+
}
|
442 |
+
?>
|
443 |
+
<textarea title="<?php esc_attr_e( 'To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'custom-post-type-ui' ); ?>" onclick="this.focus();this.select()" onfocus="this.focus();this.select();" readonly="readonly" aria-readonly="true" class="cptui_tax_import" id="cptui_tax_export" name="cptui_tax_export"><?php echo $content; // phpcs:ignore WordPress.Security.EscapeOutput ?></textarea>
|
444 |
|
445 |
<p>
|
446 |
+
<strong><?php esc_html_e( 'Use the content above to import current taxonomies into a different WordPress site. You can also use this to simply back up your taxonomy settings.', 'custom-post-type-ui' ); ?></strong>
|
447 |
</p>
|
448 |
+
</td>
|
449 |
+
</tr>
|
450 |
+
<?php } ?>
|
451 |
+
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
452 |
<?php
|
453 |
}
|
454 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
455 |
/**
|
456 |
* Renders various tab sections for the Tools page, based on current tab.
|
457 |
*
|
482 |
* @since 1.5.0
|
483 |
*/
|
484 |
function cptui_do_import_types_taxes() {
|
485 |
+
// phpcs:ignore.
|
486 |
+
if ( ! empty( $_POST ) && // phpcs:ignore WordPress.Security.NonceVerification
|
487 |
+
( ! empty( $_POST['cptui_post_import'] ) && isset( $_POST['cptui_post_import'] ) ) || // phpcs:ignore WordPress.Security.NonceVerification
|
488 |
+
( ! empty( $_POST['cptui_tax_import'] ) && isset( $_POST['cptui_tax_import'] ) ) // phpcs:ignore WordPress.Security.NonceVerification
|
489 |
) {
|
490 |
$data = [];
|
491 |
$decoded_post_data = null;
|
492 |
$decoded_tax_data = null;
|
493 |
+
if ( ! empty( $_POST['cptui_post_import'] ) ) { // phpcs:ignore.
|
494 |
+
$decoded_post_data = json_decode( stripslashes_deep( trim( $_POST['cptui_post_import'] ) ), true ); // phpcs:ignore.
|
495 |
}
|
496 |
|
497 |
+
if ( ! empty( $_POST['cptui_tax_import'] ) ) { // phpcs:ignore.
|
498 |
+
$decoded_tax_data = json_decode( stripslashes_deep( trim( $_POST['cptui_tax_import'] ) ), true ); // phpcs:ignore.
|
499 |
}
|
500 |
|
501 |
if (
|
502 |
empty( $decoded_post_data ) &&
|
503 |
empty( $decoded_tax_data ) &&
|
504 |
(
|
505 |
+
! empty( $_POST['cptui_post_import'] ) && '{""}' !== stripslashes_deep( trim( $_POST['cptui_post_import'] ) ) // phpcs:ignore.
|
506 |
) &&
|
507 |
(
|
508 |
+
! empty( $_POST['cptui_tax_import'] ) && '{""}' !== stripslashes_deep( trim( $_POST['cptui_tax_import'] ) ) // phpcs:ignore.
|
509 |
)
|
510 |
) {
|
511 |
return;
|
516 |
if ( null !== $decoded_tax_data ) {
|
517 |
$data['cptui_tax_import'] = $decoded_tax_data;
|
518 |
}
|
519 |
+
if ( ! empty( $_POST['cptui_post_import'] ) && '{""}' === stripslashes_deep( trim( $_POST['cptui_post_import'] ) ) ) { // phpcs:ignore.
|
520 |
$data['delete'] = 'type_true';
|
521 |
}
|
522 |
+
if ( ! empty( $_POST['cptui_tax_import'] ) && '{""}' === stripslashes_deep( trim( $_POST['cptui_tax_import'] ) ) ) { // phpcs:ignore.
|
523 |
$data['delete'] = 'tax_true';
|
524 |
}
|
525 |
$success = cptui_import_types_taxes_settings( $data );
|
inc/utility.php
CHANGED
@@ -34,10 +34,13 @@ function cptui_edit_plugin_list_links( $links ) {
|
|
34 |
}
|
35 |
|
36 |
// Add our custom links to the returned array value.
|
37 |
-
return array_merge(
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
41 |
}
|
42 |
add_filter( 'plugin_action_links_' . plugin_basename( dirname( __DIR__ ) ) . '/custom-post-type-ui.php', 'cptui_edit_plugin_list_links' );
|
43 |
|
@@ -105,29 +108,34 @@ function cptui_footer( $original = '' ) {
|
|
105 |
}
|
106 |
|
107 |
return sprintf(
|
108 |
-
|
109 |
-
|
|
|
110 |
CPTUI_VERSION,
|
111 |
'<a href="https://webdevstudios.com" target="_blank" rel="noopener">WebDevStudios</a>'
|
112 |
) . ' - ' .
|
113 |
sprintf(
|
|
|
114 |
'<a href="http://wordpress.org/support/plugin/custom-post-type-ui" target="_blank" rel="noopener">%s</a>',
|
115 |
-
|
116 |
) . ' - ' .
|
117 |
sprintf(
|
|
|
118 |
'<a href="https://wordpress.org/plugins/custom-post-type-ui/reviews/" target="_blank" rel="noopener">%s</a>',
|
119 |
sprintf(
|
120 |
// translators: Placeholder will hold `<abbr>` tag for CPTUI.
|
121 |
-
|
122 |
sprintf(
|
|
|
123 |
'<abbr title="%s">%s</abbr>',
|
124 |
esc_attr__( 'Custom Post Type UI', 'custom-post-type-ui' ),
|
125 |
'CPTUI'
|
126 |
)
|
127 |
)
|
128 |
) . ' - ' .
|
129 |
-
|
130 |
sprintf(
|
|
|
131 |
' %s',
|
132 |
'<a href="https://twitter.com/webdevstudios" target="_blank" rel="noopener">WebDevStudios</a>'
|
133 |
);
|
@@ -153,7 +161,8 @@ function cptui_flush_rewrite_rules() {
|
|
153 |
* post types or taxonomies are created, updated, deleted, or imported. Any other time and this condition
|
154 |
* should not be met.
|
155 |
*/
|
156 |
-
|
|
|
157 |
flush_rewrite_rules( false );
|
158 |
// So we only run this once.
|
159 |
delete_transient( 'cptui_flush_rewrite_rules' );
|
@@ -170,8 +179,8 @@ add_action( 'admin_init', 'cptui_flush_rewrite_rules' );
|
|
170 |
*/
|
171 |
function cptui_get_current_action() {
|
172 |
$current_action = '';
|
173 |
-
if ( ! empty( $_GET ) && isset( $_GET['action'] ) ) {
|
174 |
-
$current_action .= esc_textarea( $_GET['action'] );
|
175 |
}
|
176 |
|
177 |
return $current_action;
|
@@ -346,7 +355,7 @@ function cptui_products_sidebar() {
|
|
346 |
printf(
|
347 |
'<p><a href="%s">%s</a></p>',
|
348 |
esc_url( $ad['url'] ),
|
349 |
-
$the_ad
|
350 |
);
|
351 |
}
|
352 |
printf(
|
@@ -371,36 +380,49 @@ function cptui_newsletter_form() {
|
|
371 |
?>
|
372 |
|
373 |
<div class="email-octopus-form-wrapper">
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
</div>
|
402 |
|
403 |
-
<?php
|
404 |
}
|
405 |
|
406 |
/**
|
@@ -431,9 +453,9 @@ function enqueue_email_octopus_assets() {
|
|
431 |
return;
|
432 |
}
|
433 |
|
434 |
-
wp_enqueue_style( 'cptui-emailoctopus', 'https://emailoctopus.com/bundles/emailoctopuslist/css/formEmbed.css' );
|
435 |
|
436 |
-
wp_enqueue_script( 'cptui-emailoctopus-js', 'https://emailoctopus.com/bundles/emailoctopuslist/js/1.4/formEmbed.js', [ 'jquery' ], '', true );
|
437 |
|
438 |
}
|
439 |
add_action( 'admin_enqueue_scripts', 'enqueue_email_octopus_assets' );
|
@@ -570,14 +592,14 @@ function cptui_admin_notices_helper( $message = '', $success = true ) {
|
|
570 |
* @return string
|
571 |
*/
|
572 |
function cptui_get_object_from_post_global() {
|
573 |
-
if ( isset( $_POST['cpt_custom_post_type']['name'] ) ) {
|
574 |
$type_item = filter_input( INPUT_POST, 'cpt_custom_post_type', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
575 |
if ( $type_item ) {
|
576 |
return sanitize_text_field( $type_item['name'] );
|
577 |
}
|
578 |
}
|
579 |
|
580 |
-
if ( isset( $_POST['cpt_custom_tax']['name'] ) ) {
|
581 |
$tax_item = filter_input( INPUT_POST, 'cpt_custom_tax', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
582 |
if ( $tax_item ) {
|
583 |
return sanitize_text_field( $tax_item['name'] );
|
@@ -593,8 +615,9 @@ function cptui_get_object_from_post_global() {
|
|
593 |
* @since 1.4.0
|
594 |
*/
|
595 |
function cptui_add_success_admin_notice() {
|
596 |
-
echo cptui_admin_notices_helper(
|
597 |
sprintf(
|
|
|
598 |
esc_html__( '%s has been successfully added', 'custom-post-type-ui' ),
|
599 |
cptui_get_object_from_post_global()
|
600 |
)
|
@@ -607,8 +630,9 @@ function cptui_add_success_admin_notice() {
|
|
607 |
* @since 1.4.0
|
608 |
*/
|
609 |
function cptui_add_fail_admin_notice() {
|
610 |
-
echo cptui_admin_notices_helper(
|
611 |
sprintf(
|
|
|
612 |
esc_html__( '%s has failed to be added', 'custom-post-type-ui' ),
|
613 |
cptui_get_object_from_post_global()
|
614 |
),
|
@@ -622,8 +646,9 @@ function cptui_add_fail_admin_notice() {
|
|
622 |
* @since 1.4.0
|
623 |
*/
|
624 |
function cptui_update_success_admin_notice() {
|
625 |
-
echo cptui_admin_notices_helper(
|
626 |
sprintf(
|
|
|
627 |
esc_html__( '%s has been successfully updated', 'custom-post-type-ui' ),
|
628 |
cptui_get_object_from_post_global()
|
629 |
)
|
@@ -636,8 +661,9 @@ function cptui_update_success_admin_notice() {
|
|
636 |
* @since 1.4.0
|
637 |
*/
|
638 |
function cptui_update_fail_admin_notice() {
|
639 |
-
echo cptui_admin_notices_helper(
|
640 |
sprintf(
|
|
|
641 |
esc_html__( '%s has failed to be updated', 'custom-post-type-ui' ),
|
642 |
cptui_get_object_from_post_global()
|
643 |
),
|
@@ -651,8 +677,9 @@ function cptui_update_fail_admin_notice() {
|
|
651 |
* @since 1.4.0
|
652 |
*/
|
653 |
function cptui_delete_success_admin_notice() {
|
654 |
-
echo cptui_admin_notices_helper(
|
655 |
sprintf(
|
|
|
656 |
esc_html__( '%s has been successfully deleted', 'custom-post-type-ui' ),
|
657 |
cptui_get_object_from_post_global()
|
658 |
)
|
@@ -665,8 +692,9 @@ function cptui_delete_success_admin_notice() {
|
|
665 |
* @since 1.4.0
|
666 |
*/
|
667 |
function cptui_delete_fail_admin_notice() {
|
668 |
-
echo cptui_admin_notices_helper(
|
669 |
sprintf(
|
|
|
670 |
esc_html__( '%s has failed to be deleted', 'custom-post-type-ui' ),
|
671 |
cptui_get_object_from_post_global()
|
672 |
),
|
@@ -680,7 +708,7 @@ function cptui_delete_fail_admin_notice() {
|
|
680 |
* @since 1.5.0
|
681 |
*/
|
682 |
function cptui_import_success_admin_notice() {
|
683 |
-
echo cptui_admin_notices_helper(
|
684 |
esc_html__( 'Successfully imported data.', 'custom-post-type-ui' )
|
685 |
);
|
686 |
}
|
@@ -691,14 +719,19 @@ function cptui_import_success_admin_notice() {
|
|
691 |
* @since 1.5.0
|
692 |
*/
|
693 |
function cptui_import_fail_admin_notice() {
|
694 |
-
echo cptui_admin_notices_helper(
|
695 |
esc_html__( 'Invalid data provided', 'custom-post-type-ui' ),
|
696 |
false
|
697 |
);
|
698 |
}
|
699 |
|
|
|
|
|
|
|
|
|
|
|
700 |
function cptui_nonce_fail_admin_notice() {
|
701 |
-
echo cptui_admin_notices_helper(
|
702 |
esc_html__( 'Nonce failed verification', 'custom-post-type-ui' ),
|
703 |
false
|
704 |
);
|
@@ -713,6 +746,7 @@ function cptui_nonce_fail_admin_notice() {
|
|
713 |
*/
|
714 |
function cptui_slug_matches_post_type() {
|
715 |
return sprintf(
|
|
|
716 |
esc_html__( 'Please choose a different post type name. %s is already registered.', 'custom-post-type-ui' ),
|
717 |
cptui_get_object_from_post_global()
|
718 |
);
|
@@ -727,6 +761,7 @@ function cptui_slug_matches_post_type() {
|
|
727 |
*/
|
728 |
function cptui_slug_matches_taxonomy() {
|
729 |
return sprintf(
|
|
|
730 |
esc_html__( 'Please choose a different taxonomy name. %s is already registered.', 'custom-post-type-ui' ),
|
731 |
cptui_get_object_from_post_global()
|
732 |
);
|
@@ -751,12 +786,13 @@ function cptui_empty_cpt_on_taxonomy() {
|
|
751 |
* @return string
|
752 |
*/
|
753 |
function cptui_slug_matches_page() {
|
754 |
-
$slug
|
755 |
$matched_slug = get_page_by_path(
|
756 |
cptui_get_object_from_post_global()
|
757 |
);
|
758 |
if ( $matched_slug instanceof WP_Post ) {
|
759 |
$slug = sprintf(
|
|
|
760 |
'<a href="%s">%s</a>',
|
761 |
get_edit_post_link( $matched_slug->ID ),
|
762 |
cptui_get_object_from_post_global()
|
@@ -764,6 +800,7 @@ function cptui_slug_matches_page() {
|
|
764 |
}
|
765 |
|
766 |
return sprintf(
|
|
|
767 |
esc_html__( 'Please choose a different post type name. %s matches an existing page slug, which can cause conflicts.', 'custom-post-type-ui' ),
|
768 |
$slug
|
769 |
);
|
@@ -789,7 +826,7 @@ function cptui_slug_has_quotes() {
|
|
789 |
* @since 1.4.0
|
790 |
*/
|
791 |
function cptui_error_admin_notice() {
|
792 |
-
echo cptui_admin_notices_helper(
|
793 |
apply_filters( 'cptui_custom_error_message', '' ),
|
794 |
false
|
795 |
);
|
@@ -959,7 +996,7 @@ add_action( 'cptui_post_register_post_types', 'cptui_published_post_format_fix'
|
|
959 |
* @return string
|
960 |
*/
|
961 |
function cptui_get_add_new_link( $content_type = '' ) {
|
962 |
-
if ( ! in_array( $content_type, [ 'post_types', 'taxonomies' ] ) ) {
|
963 |
return cptui_admin_url( 'admin.php?page=cptui_manage_post_types' );
|
964 |
}
|
965 |
|
34 |
}
|
35 |
|
36 |
// Add our custom links to the returned array value.
|
37 |
+
return array_merge(
|
38 |
+
array(
|
39 |
+
'<a href="' . admin_url( 'admin.php?page=cptui_main_menu' ) . '">' . esc_html__( 'About', 'custom-post-type-ui' ) . '</a>',
|
40 |
+
'<a href="' . admin_url( 'admin.php?page=cptui_support' ) . '">' . esc_html__( 'Help', 'custom-post-type-ui' ) . '</a>',
|
41 |
+
),
|
42 |
+
$links
|
43 |
+
);
|
44 |
}
|
45 |
add_filter( 'plugin_action_links_' . plugin_basename( dirname( __DIR__ ) ) . '/custom-post-type-ui.php', 'cptui_edit_plugin_list_links' );
|
46 |
|
108 |
}
|
109 |
|
110 |
return sprintf(
|
111 |
+
// translators: Placeholder will hold the name of the plugin, version of the plugin and a link to WebdevStudios.
|
112 |
+
esc_attr__( '%1$s version %2$s by %3$s', 'custom-post-type-ui' ),
|
113 |
+
esc_attr__( 'Custom Post Type UI', 'custom-post-type-ui' ),
|
114 |
CPTUI_VERSION,
|
115 |
'<a href="https://webdevstudios.com" target="_blank" rel="noopener">WebDevStudios</a>'
|
116 |
) . ' - ' .
|
117 |
sprintf(
|
118 |
+
// translators: Placeholders are just for HTML markup that doesn't need translated.
|
119 |
'<a href="http://wordpress.org/support/plugin/custom-post-type-ui" target="_blank" rel="noopener">%s</a>',
|
120 |
+
esc_attr__( 'Support forums', 'custom-post-type-ui' )
|
121 |
) . ' - ' .
|
122 |
sprintf(
|
123 |
+
// translators: Placeholders are just for HTML markup that doesn't need translated.
|
124 |
'<a href="https://wordpress.org/plugins/custom-post-type-ui/reviews/" target="_blank" rel="noopener">%s</a>',
|
125 |
sprintf(
|
126 |
// translators: Placeholder will hold `<abbr>` tag for CPTUI.
|
127 |
+
esc_attr__( 'Review %s', 'custom-post-type-ui' ),
|
128 |
sprintf(
|
129 |
+
// translators: Placeholders are just for HTML markup that doesn't need translated.
|
130 |
'<abbr title="%s">%s</abbr>',
|
131 |
esc_attr__( 'Custom Post Type UI', 'custom-post-type-ui' ),
|
132 |
'CPTUI'
|
133 |
)
|
134 |
)
|
135 |
) . ' - ' .
|
136 |
+
esc_attr__( 'Follow on Twitter:', 'custom-post-type-ui' ) .
|
137 |
sprintf(
|
138 |
+
// translators: Placeholders are just for HTML markup that doesn't need translated.
|
139 |
' %s',
|
140 |
'<a href="https://twitter.com/webdevstudios" target="_blank" rel="noopener">WebDevStudios</a>'
|
141 |
);
|
161 |
* post types or taxonomies are created, updated, deleted, or imported. Any other time and this condition
|
162 |
* should not be met.
|
163 |
*/
|
164 |
+
$flush_it = get_transient( 'cptui_flush_rewrite_rules' );
|
165 |
+
if ( 'true' === $flush_it ) {
|
166 |
flush_rewrite_rules( false );
|
167 |
// So we only run this once.
|
168 |
delete_transient( 'cptui_flush_rewrite_rules' );
|
179 |
*/
|
180 |
function cptui_get_current_action() {
|
181 |
$current_action = '';
|
182 |
+
if ( ! empty( $_GET ) && isset( $_GET['action'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
|
183 |
+
$current_action .= esc_textarea( wp_unslash( $_GET['action'] ) ); // phpcs:ignore
|
184 |
}
|
185 |
|
186 |
return $current_action;
|
355 |
printf(
|
356 |
'<p><a href="%s">%s</a></p>',
|
357 |
esc_url( $ad['url'] ),
|
358 |
+
$the_ad // phpcs:ignore WordPress.Security.EscapeOutput
|
359 |
);
|
360 |
}
|
361 |
printf(
|
380 |
?>
|
381 |
|
382 |
<div class="email-octopus-form-wrapper">
|
383 |
+
<?php
|
384 |
+
echo sprintf(
|
385 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
386 |
+
'<p><strong>%s</strong></p>',
|
387 |
+
esc_html__( 'Get email updates from pluginize.com about Custom Post Type UI', 'custom-post-type-ui' )
|
388 |
+
);
|
389 |
+
?>
|
390 |
+
<p class="email-octopus-success-message"></p>
|
391 |
+
<p class="email-octopus-error-message"></p>
|
392 |
+
|
393 |
+
<form method="post" action="https://emailoctopus.com/lists/2039e001-4775-11ea-be00-06b4694bee2a/members/embedded/1.3/add" class="email-octopus-form" data-sitekey="6LdYsmsUAAAAAPXVTt-ovRsPIJ_IVhvYBBhGvRV6">
|
394 |
+
<div class="email-octopus-form-row">
|
395 |
+
|
396 |
+
<?php
|
397 |
+
echo sprintf(
|
398 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
399 |
+
'<label for="field_0">%s</label>',
|
400 |
+
esc_html__( 'Email address', 'custom-post-type-ui' )
|
401 |
+
);
|
402 |
+
?>
|
403 |
+
<input id="field_0" name="field_0" type="email" placeholder="email@domain.com" style="max-width:100%;">
|
404 |
+
</div>
|
405 |
+
|
406 |
+
<div class="email-octopus-form-row-hp" aria-hidden="true">
|
407 |
+
<!-- Do not remove this field, otherwise you risk bot sign-ups -->
|
408 |
+
<input type="text" name="hp2039e001-4775-11ea-be00-06b4694bee2a" tabindex="-1" autocomplete="nope">
|
409 |
+
</div>
|
410 |
+
|
411 |
+
<div class="email-octopus-form-row-subscribe">
|
412 |
+
<input type="hidden" name="successRedirectUrl" value="">
|
413 |
+
<?php
|
414 |
+
echo sprintf(
|
415 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
416 |
+
'<button type="submit" class="button button-secondary">%s</button>',
|
417 |
+
esc_html__( 'Subscribe', 'custom-post-type-ui' )
|
418 |
+
);
|
419 |
+
?>
|
420 |
+
|
421 |
+
</div>
|
422 |
+
</form>
|
423 |
</div>
|
424 |
|
425 |
+
<?php
|
426 |
}
|
427 |
|
428 |
/**
|
453 |
return;
|
454 |
}
|
455 |
|
456 |
+
wp_enqueue_style( 'cptui-emailoctopus', 'https://emailoctopus.com/bundles/emailoctopuslist/css/formEmbed.css' ); // phpcs:ignore
|
457 |
|
458 |
+
wp_enqueue_script( 'cptui-emailoctopus-js', 'https://emailoctopus.com/bundles/emailoctopuslist/js/1.4/formEmbed.js', [ 'jquery' ], '', true ); // phpcs:ignore
|
459 |
|
460 |
}
|
461 |
add_action( 'admin_enqueue_scripts', 'enqueue_email_octopus_assets' );
|
592 |
* @return string
|
593 |
*/
|
594 |
function cptui_get_object_from_post_global() {
|
595 |
+
if ( isset( $_POST['cpt_custom_post_type']['name'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
|
596 |
$type_item = filter_input( INPUT_POST, 'cpt_custom_post_type', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
597 |
if ( $type_item ) {
|
598 |
return sanitize_text_field( $type_item['name'] );
|
599 |
}
|
600 |
}
|
601 |
|
602 |
+
if ( isset( $_POST['cpt_custom_tax']['name'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
|
603 |
$tax_item = filter_input( INPUT_POST, 'cpt_custom_tax', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
604 |
if ( $tax_item ) {
|
605 |
return sanitize_text_field( $tax_item['name'] );
|
615 |
* @since 1.4.0
|
616 |
*/
|
617 |
function cptui_add_success_admin_notice() {
|
618 |
+
echo cptui_admin_notices_helper( // phpcs:ignore WordPress.Security.EscapeOutput
|
619 |
sprintf(
|
620 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
621 |
esc_html__( '%s has been successfully added', 'custom-post-type-ui' ),
|
622 |
cptui_get_object_from_post_global()
|
623 |
)
|
630 |
* @since 1.4.0
|
631 |
*/
|
632 |
function cptui_add_fail_admin_notice() {
|
633 |
+
echo cptui_admin_notices_helper( // phpcs:ignore WordPress.Security.EscapeOutput
|
634 |
sprintf(
|
635 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
636 |
esc_html__( '%s has failed to be added', 'custom-post-type-ui' ),
|
637 |
cptui_get_object_from_post_global()
|
638 |
),
|
646 |
* @since 1.4.0
|
647 |
*/
|
648 |
function cptui_update_success_admin_notice() {
|
649 |
+
echo cptui_admin_notices_helper( // phpcs:ignore WordPress.Security.EscapeOutput
|
650 |
sprintf(
|
651 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
652 |
esc_html__( '%s has been successfully updated', 'custom-post-type-ui' ),
|
653 |
cptui_get_object_from_post_global()
|
654 |
)
|
661 |
* @since 1.4.0
|
662 |
*/
|
663 |
function cptui_update_fail_admin_notice() {
|
664 |
+
echo cptui_admin_notices_helper( // phpcs:ignore WordPress.Security.EscapeOutput
|
665 |
sprintf(
|
666 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
667 |
esc_html__( '%s has failed to be updated', 'custom-post-type-ui' ),
|
668 |
cptui_get_object_from_post_global()
|
669 |
),
|
677 |
* @since 1.4.0
|
678 |
*/
|
679 |
function cptui_delete_success_admin_notice() {
|
680 |
+
echo cptui_admin_notices_helper( // phpcs:ignore WordPress.Security.EscapeOutput
|
681 |
sprintf(
|
682 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
683 |
esc_html__( '%s has been successfully deleted', 'custom-post-type-ui' ),
|
684 |
cptui_get_object_from_post_global()
|
685 |
)
|
692 |
* @since 1.4.0
|
693 |
*/
|
694 |
function cptui_delete_fail_admin_notice() {
|
695 |
+
echo cptui_admin_notices_helper( // phpcs:ignore WordPress.Security.EscapeOutput
|
696 |
sprintf(
|
697 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
698 |
esc_html__( '%s has failed to be deleted', 'custom-post-type-ui' ),
|
699 |
cptui_get_object_from_post_global()
|
700 |
),
|
708 |
* @since 1.5.0
|
709 |
*/
|
710 |
function cptui_import_success_admin_notice() {
|
711 |
+
echo cptui_admin_notices_helper( // phpcs:ignore WordPress.Security.EscapeOutput
|
712 |
esc_html__( 'Successfully imported data.', 'custom-post-type-ui' )
|
713 |
);
|
714 |
}
|
719 |
* @since 1.5.0
|
720 |
*/
|
721 |
function cptui_import_fail_admin_notice() {
|
722 |
+
echo cptui_admin_notices_helper( // phpcs:ignore WordPress.Security.EscapeOutput
|
723 |
esc_html__( 'Invalid data provided', 'custom-post-type-ui' ),
|
724 |
false
|
725 |
);
|
726 |
}
|
727 |
|
728 |
+
/**
|
729 |
+
* Failure to verify nonce, callback
|
730 |
+
*
|
731 |
+
* @since 1.7.4
|
732 |
+
*/
|
733 |
function cptui_nonce_fail_admin_notice() {
|
734 |
+
echo cptui_admin_notices_helper( // phpcs:ignore WordPress.Security.EscapeOutput
|
735 |
esc_html__( 'Nonce failed verification', 'custom-post-type-ui' ),
|
736 |
false
|
737 |
);
|
746 |
*/
|
747 |
function cptui_slug_matches_post_type() {
|
748 |
return sprintf(
|
749 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
750 |
esc_html__( 'Please choose a different post type name. %s is already registered.', 'custom-post-type-ui' ),
|
751 |
cptui_get_object_from_post_global()
|
752 |
);
|
761 |
*/
|
762 |
function cptui_slug_matches_taxonomy() {
|
763 |
return sprintf(
|
764 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
765 |
esc_html__( 'Please choose a different taxonomy name. %s is already registered.', 'custom-post-type-ui' ),
|
766 |
cptui_get_object_from_post_global()
|
767 |
);
|
786 |
* @return string
|
787 |
*/
|
788 |
function cptui_slug_matches_page() {
|
789 |
+
$slug = cptui_get_object_from_post_global();
|
790 |
$matched_slug = get_page_by_path(
|
791 |
cptui_get_object_from_post_global()
|
792 |
);
|
793 |
if ( $matched_slug instanceof WP_Post ) {
|
794 |
$slug = sprintf(
|
795 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
796 |
'<a href="%s">%s</a>',
|
797 |
get_edit_post_link( $matched_slug->ID ),
|
798 |
cptui_get_object_from_post_global()
|
800 |
}
|
801 |
|
802 |
return sprintf(
|
803 |
+
/* translators: Placeholders are just for HTML markup that doesn't need translated */
|
804 |
esc_html__( 'Please choose a different post type name. %s matches an existing page slug, which can cause conflicts.', 'custom-post-type-ui' ),
|
805 |
$slug
|
806 |
);
|
826 |
* @since 1.4.0
|
827 |
*/
|
828 |
function cptui_error_admin_notice() {
|
829 |
+
echo cptui_admin_notices_helper( // phpcs:ignore WordPress.Security.EscapeOutput
|
830 |
apply_filters( 'cptui_custom_error_message', '' ),
|
831 |
false
|
832 |
);
|
996 |
* @return string
|
997 |
*/
|
998 |
function cptui_get_add_new_link( $content_type = '' ) {
|
999 |
+
if ( ! in_array( $content_type, [ 'post_types', 'taxonomies' ], true ) ) {
|
1000 |
return cptui_admin_url( 'admin.php?page=cptui_manage_post_types' );
|
1001 |
}
|
1002 |
|
inc/wp-cli.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* Custom Post Type UI WP-CLI.
|
5 |
*
|
@@ -69,7 +68,13 @@ class CPTUI_Import_JSON extends WP_CLI_Command {
|
|
69 |
if ( false === $result || 'import_fail' === $result ) {
|
70 |
WP_CLI::error( sprintf( __( 'An error on import occurred', 'custom-post-type-ui' ) ) );
|
71 |
} else {
|
72 |
-
WP_CLI::success(
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
}
|
75 |
|
@@ -106,7 +111,7 @@ class CPTUI_Import_JSON extends WP_CLI_Command {
|
|
106 |
$content = cptui_get_taxonomy_data();
|
107 |
}
|
108 |
|
109 |
-
$content =
|
110 |
$result = file_put_contents( $this->assoc_args['dest-path'], $content );
|
111 |
|
112 |
if ( false === $result ) {
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Custom Post Type UI WP-CLI.
|
4 |
*
|
68 |
if ( false === $result || 'import_fail' === $result ) {
|
69 |
WP_CLI::error( sprintf( __( '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 |
+
__( 'Imported %s successfully', 'custom-post-type-ui' ),
|
75 |
+
$this->type
|
76 |
+
)
|
77 |
+
);
|
78 |
}
|
79 |
}
|
80 |
|
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 ) {
|
js/cptui.js
DELETED
@@ -1,291 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Add collapseable boxes to our editor screens.
|
3 |
-
*/
|
4 |
-
postboxes.add_postbox_toggles(pagenow);
|
5 |
-
|
6 |
-
/**
|
7 |
-
* The rest of our customizations.
|
8 |
-
*/
|
9 |
-
(function($) {
|
10 |
-
|
11 |
-
$('#cptui_select_post_type_submit').hide();
|
12 |
-
$('#cptui_select_taxonomy_submit').hide();
|
13 |
-
|
14 |
-
if ('edit' === getParameterByName('action')) {
|
15 |
-
// Store our original slug on page load for edit checking.
|
16 |
-
var original_slug = $('#name').val();
|
17 |
-
}
|
18 |
-
|
19 |
-
// Automatically toggle the "page attributes" checkbox if
|
20 |
-
// setting a hierarchical post type.
|
21 |
-
$('#hierarchical').on('change', function() {
|
22 |
-
var hierarchical = $(this).val();
|
23 |
-
if ('1' === hierarchical) {
|
24 |
-
$('#page-attributes').prop('checked', true);
|
25 |
-
} else {
|
26 |
-
$('#page-attributes').prop('checked', false);
|
27 |
-
}
|
28 |
-
});
|
29 |
-
|
30 |
-
// Switch to newly selected post type or taxonomy automatically.
|
31 |
-
$('#post_type').on('change',function(){
|
32 |
-
$('#cptui_select_post_type').submit();
|
33 |
-
});
|
34 |
-
|
35 |
-
$('#taxonomy').on('change',function(){
|
36 |
-
$( '#cptui_select_taxonomy' ).submit();
|
37 |
-
});
|
38 |
-
|
39 |
-
// Confirm our deletions
|
40 |
-
$('.cptui-delete-top, .cptui-delete-bottom').on('click',function(e) {
|
41 |
-
e.preventDefault();
|
42 |
-
var msg = '';
|
43 |
-
if (typeof cptui_type_data !== 'undefined') {
|
44 |
-
msg = cptui_type_data.confirm;
|
45 |
-
} else if (typeof cptui_tax_data !== 'undefined') {
|
46 |
-
msg = cptui_tax_data.confirm;
|
47 |
-
}
|
48 |
-
var submit_delete_warning = $('<div class="cptui-submit-delete-dialog">' + msg + '</div>').appendTo('#poststuff').dialog({
|
49 |
-
'dialogClass' : 'wp-dialog',
|
50 |
-
'modal' : true,
|
51 |
-
'autoOpen' : true,
|
52 |
-
'buttons' : {
|
53 |
-
"OK": function() {
|
54 |
-
var form = $(e.target).closest('form');
|
55 |
-
$(e.target).off('click').click();
|
56 |
-
},
|
57 |
-
"Cancel": function() {
|
58 |
-
$(this).dialog('close');
|
59 |
-
}
|
60 |
-
}
|
61 |
-
});
|
62 |
-
});
|
63 |
-
|
64 |
-
// Toggles help/support accordions.
|
65 |
-
$('#support .question').each(function() {
|
66 |
-
var tis = $(this), state = false, answer = tis.next('div').slideUp();
|
67 |
-
tis.on('click keydown',function(e) {
|
68 |
-
// Helps with accessibility and keyboard navigation.
|
69 |
-
if(e.type==='keydown' && e.keyCode!==32 && e.keyCode!==13) {
|
70 |
-
return;
|
71 |
-
}
|
72 |
-
e.preventDefault();
|
73 |
-
state = !state;
|
74 |
-
answer.slideToggle(state);
|
75 |
-
tis.toggleClass('active',state);
|
76 |
-
tis.attr('aria-expanded', state.toString() );
|
77 |
-
tis.focus();
|
78 |
-
});
|
79 |
-
});
|
80 |
-
|
81 |
-
// Switch spaces for underscores on our slug fields.
|
82 |
-
$('#name').on('keyup',function(e){
|
83 |
-
var value, original_value;
|
84 |
-
value = original_value = $(this).val();
|
85 |
-
if ( e.keyCode !== 9 && e.keyCode !== 37 && e.keyCode !== 38 && e.keyCode !== 39 && e.keyCode !== 40 ) {
|
86 |
-
value = value.replace(/ /g, "_");
|
87 |
-
value = value.toLowerCase();
|
88 |
-
value = replaceDiacritics(value);
|
89 |
-
value = transliterate(value);
|
90 |
-
value = replaceSpecialCharacters(value);
|
91 |
-
if ( value !== original_value ) {
|
92 |
-
$(this).prop('value', value);
|
93 |
-
}
|
94 |
-
}
|
95 |
-
|
96 |
-
//Displays a message if slug changes.
|
97 |
-
if(typeof original_slug !== 'undefined') {
|
98 |
-
var $slugchanged = $('#slugchanged');
|
99 |
-
if(value != original_slug) {
|
100 |
-
$slugchanged.removeClass('hidemessage');
|
101 |
-
} else {
|
102 |
-
$slugchanged.addClass('hidemessage');
|
103 |
-
}
|
104 |
-
}
|
105 |
-
|
106 |
-
var $slugexists = $('#slugexists');
|
107 |
-
if ( typeof cptui_type_data != 'undefined' ) {
|
108 |
-
if (cptui_type_data.existing_post_types.hasOwnProperty(value) && value !== original_slug) {
|
109 |
-
$slugexists.removeClass('hidemessage');
|
110 |
-
} else {
|
111 |
-
$slugexists.addClass('hidemessage');
|
112 |
-
}
|
113 |
-
}
|
114 |
-
if ( typeof cptui_tax_data != 'undefined' ) {
|
115 |
-
if (cptui_tax_data.existing_taxonomies.hasOwnProperty(value) && value !== original_slug) {
|
116 |
-
$slugexists.removeClass('hidemessage');
|
117 |
-
} else {
|
118 |
-
$slugexists.addClass('hidemessage');
|
119 |
-
}
|
120 |
-
}
|
121 |
-
});
|
122 |
-
|
123 |
-
// Replace diacritic characters with latin characters.
|
124 |
-
function replaceDiacritics(s) {
|
125 |
-
var diacritics = [
|
126 |
-
/[\300-\306]/g, /[\340-\346]/g, // A, a
|
127 |
-
/[\310-\313]/g, /[\350-\353]/g, // E, e
|
128 |
-
/[\314-\317]/g, /[\354-\357]/g, // I, i
|
129 |
-
/[\322-\330]/g, /[\362-\370]/g, // O, o
|
130 |
-
/[\331-\334]/g, /[\371-\374]/g, // U, u
|
131 |
-
/[\321]/g, /[\361]/g, // N, n
|
132 |
-
/[\307]/g, /[\347]/g // C, c
|
133 |
-
];
|
134 |
-
|
135 |
-
var chars = ['A', 'a', 'E', 'e', 'I', 'i', 'O', 'o', 'U', 'u', 'N', 'n', 'C', 'c'];
|
136 |
-
|
137 |
-
for (var i = 0; i < diacritics.length; i++) {
|
138 |
-
s = s.replace(diacritics[i], chars[i]);
|
139 |
-
}
|
140 |
-
|
141 |
-
return s;
|
142 |
-
}
|
143 |
-
|
144 |
-
function replaceSpecialCharacters(s) {
|
145 |
-
if ( 'cpt-ui_page_cptui_manage_post_types' === window.pagenow ) {
|
146 |
-
s = s.replace(/[^a-z0-9\s-]/gi, '_');
|
147 |
-
} else {
|
148 |
-
s = s.replace(/[^a-z0-9\s]/gi, '_');
|
149 |
-
}
|
150 |
-
|
151 |
-
return s;
|
152 |
-
}
|
153 |
-
|
154 |
-
function composePreviewContent(value) {
|
155 |
-
|
156 |
-
var re = /(http|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/;
|
157 |
-
var is_url = re.test(value);
|
158 |
-
|
159 |
-
if (!value) {
|
160 |
-
return '';
|
161 |
-
} else if (0 === value.indexOf('dashicons-')) {
|
162 |
-
return $('<div class="dashicons-before"><br></div>').addClass(htmlEncode(value));
|
163 |
-
} else if ( is_url ) {
|
164 |
-
var imgsrc = encodeURI(value);
|
165 |
-
var theimg = document.createElement('IMG');
|
166 |
-
theimg.src = imgsrc;
|
167 |
-
return theimg;
|
168 |
-
}
|
169 |
-
}
|
170 |
-
|
171 |
-
function htmlEncode(str) {
|
172 |
-
return String(str).replace(/[^-\w. ]/gi, function (c) {
|
173 |
-
return '&#' + c.charCodeAt(0) + ';';
|
174 |
-
});
|
175 |
-
}
|
176 |
-
|
177 |
-
var cyrillic = {
|
178 |
-
"Ё": "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"
|
179 |
-
};
|
180 |
-
|
181 |
-
function transliterate(word) {
|
182 |
-
return word.split('').map(function (char) {
|
183 |
-
return cyrillic[char] || char;
|
184 |
-
}).join("");
|
185 |
-
}
|
186 |
-
|
187 |
-
if ( undefined != wp.media ) {
|
188 |
-
var _custom_media = true,
|
189 |
-
_orig_send_attachment = wp.media.editor.send.attachment;
|
190 |
-
}
|
191 |
-
|
192 |
-
function getParameterByName(name, url) {
|
193 |
-
if (!url) url = window.location.href;
|
194 |
-
name = name.replace(/[\[\]]/g, "\\$&");
|
195 |
-
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
|
196 |
-
results = regex.exec(url);
|
197 |
-
if (!results) return null;
|
198 |
-
if (!results[2]) return '';
|
199 |
-
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
200 |
-
}
|
201 |
-
|
202 |
-
$('#cptui_choose_icon').on('click',function(e){
|
203 |
-
e.preventDefault();
|
204 |
-
|
205 |
-
var button = $(this);
|
206 |
-
var id = jQuery('#menu_icon').attr('id');
|
207 |
-
_custom_media = true;
|
208 |
-
wp.media.editor.send.attachment = function (props, attachment) {
|
209 |
-
if (_custom_media) {
|
210 |
-
$("#" + id).val(attachment.url).change();
|
211 |
-
} else {
|
212 |
-
return _orig_send_attachment.apply(this, [props, attachment]);
|
213 |
-
}
|
214 |
-
};
|
215 |
-
|
216 |
-
wp.media.editor.open(button);
|
217 |
-
return false;
|
218 |
-
});
|
219 |
-
|
220 |
-
$('#menu_icon').on('change', function () {
|
221 |
-
var value = $(this).val();
|
222 |
-
value = value.trim();
|
223 |
-
$('#menu_icon_preview').html(composePreviewContent(value));
|
224 |
-
});
|
225 |
-
|
226 |
-
$('.cptui-help').on('click',function(e){
|
227 |
-
e.preventDefault();
|
228 |
-
});
|
229 |
-
|
230 |
-
$('.cptui-taxonomy-submit').on('click',function(e){
|
231 |
-
if ( $('.cptui-table :checkbox:checked').length == 0 ) {
|
232 |
-
e.preventDefault();
|
233 |
-
var no_associated_type_warning = $('<div class="cptui-taxonomy-empty-types-dialog">' + cptui_tax_data.no_associated_type + '</div>').appendTo('#poststuff').dialog({
|
234 |
-
'dialogClass' : 'wp-dialog',
|
235 |
-
'modal' : true,
|
236 |
-
'autoOpen' : true,
|
237 |
-
'buttons' : {
|
238 |
-
"OK": function() {
|
239 |
-
$(this).dialog('close');
|
240 |
-
}
|
241 |
-
}
|
242 |
-
});
|
243 |
-
}
|
244 |
-
});
|
245 |
-
|
246 |
-
$('#auto-populate').on( 'click tap', function(e){
|
247 |
-
e.preventDefault();
|
248 |
-
|
249 |
-
var slug = $('#name').val();
|
250 |
-
var plural = $('#label').val();
|
251 |
-
var singular = $('#singular_label').val();
|
252 |
-
var fields = $('.cptui-labels input[type="text"]');
|
253 |
-
|
254 |
-
if ( '' === slug ) {
|
255 |
-
return;
|
256 |
-
}
|
257 |
-
if ( '' === plural ) {
|
258 |
-
plural = slug;
|
259 |
-
}
|
260 |
-
if ( '' === singular ) {
|
261 |
-
singular = slug;
|
262 |
-
}
|
263 |
-
|
264 |
-
$(fields).each( function( i, el ) {
|
265 |
-
var newval = $( el ).data( 'label' );
|
266 |
-
var plurality = $( el ).data( 'plurality' );
|
267 |
-
if ( 'undefined' !== newval ) {
|
268 |
-
// "slug" is our placeholder from the labels.
|
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 |
-
|
281 |
-
$('#auto-clear').on( 'click tap', function(e) {
|
282 |
-
e.preventDefault();
|
283 |
-
|
284 |
-
var fields = $('.cptui-labels input[type="text"]');
|
285 |
-
|
286 |
-
$(fields).each( function( i, el ) {
|
287 |
-
$(el).val('');
|
288 |
-
});
|
289 |
-
});
|
290 |
-
|
291 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/cptui.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
postboxes.add_postbox_toggles(pagenow),function($){if($("#cptui_select_post_type_submit").hide(),$("#cptui_select_taxonomy_submit").hide(),"edit"===function(name,url){url=url||window.location.href;name=name.replace(/[\[\]]/g,"\\$&");var results=new RegExp("[?&]"+name+"(=([^&#]*)|&|#|$)").exec(url);return results?results[2]?decodeURIComponent(results[2].replace(/\+/g," ")):"":null}("action"))var original_slug=$("#name").val();function composePreviewContent(value){var is_url=/(http|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/.test(value);if(!value)return"";if(0===value.indexOf("dashicons-"))return $('<div class="dashicons-before"><br></div>').addClass(function(str){return String(str).replace(/[^-\w. ]/gi,function(c){return"&#"+c.charCodeAt(0)+";"})}(value));if(is_url){var imgsrc=encodeURI(value),theimg=document.createElement("IMG");return theimg.src=imgsrc,theimg}}$("#hierarchical").on("change",function(){"1"===$(this).val()?$("#page-attributes").prop("checked",!0):$("#page-attributes").prop("checked",!1)}),$("#post_type").on("change",function(){$("#cptui_select_post_type").submit()}),$("#taxonomy").on("change",function(){$("#cptui_select_taxonomy").submit()}),$(".cptui-delete-top, .cptui-delete-bottom").on("click",function(e){e.preventDefault();var msg="";"undefined"!=typeof cptui_type_data?msg=cptui_type_data.confirm:"undefined"!=typeof cptui_tax_data&&(msg=cptui_tax_data.confirm);$('<div class="cptui-submit-delete-dialog">'+msg+"</div>").appendTo("#poststuff").dialog({dialogClass:"wp-dialog",modal:!0,autoOpen:!0,buttons:{OK:function(){$(e.target).closest("form");$(e.target).off("click").click()},Cancel:function(){$(this).dialog("close")}}})}),$("#support .question").each(function(){var tis=$(this),state=!1,answer=tis.next("div").slideUp();tis.on("click keydown",function(e){"keydown"===e.type&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),state=!state,answer.slideToggle(state),tis.toggleClass("active",state),tis.attr("aria-expanded",state.toString()),tis.focus())})}),$("#name").on("keyup",function(e){var value,original_value;if(value=original_value=$(this).val(),9!==e.keyCode&&37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&40!==e.keyCode&&(value=function(s){s="cpt-ui_page_cptui_manage_post_types"===window.pagenow?s.replace(/[^a-z0-9\s-]/gi,"_"):s.replace(/[^a-z0-9\s]/gi,"_");return s}(value=function(word){return word.split("").map(function(char){return cyrillic[char]||char}).join("")}(value=function(s){for(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],chars=["A","a","E","e","I","i","O","o","U","u","N","n","C","c"],i=0;i<diacritics.length;i++)s=s.replace(diacritics[i],chars[i]);return s}(value=(value=value.replace(/ /g,"_")).toLowerCase()))))!==original_value&&$(this).prop("value",value),void 0!==original_slug){var $slugchanged=$("#slugchanged");value!=original_slug?$slugchanged.removeClass("hidemessage"):$slugchanged.addClass("hidemessage")}var $slugexists=$("#slugexists");"undefined"!=typeof cptui_type_data&&(cptui_type_data.existing_post_types.hasOwnProperty(value)&&value!==original_slug?$slugexists.removeClass("hidemessage"):$slugexists.addClass("hidemessage")),"undefined"!=typeof cptui_tax_data&&(cptui_tax_data.existing_taxonomies.hasOwnProperty(value)&&value!==original_slug?$slugexists.removeClass("hidemessage"):$slugexists.addClass("hidemessage"))});var cyrillic={"Ё":"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"};if(null!=wp.media)var _custom_media=!0,_orig_send_attachment=wp.media.editor.send.attachment;$("#cptui_choose_icon").on("click",function(e){e.preventDefault();var button=$(this),id=jQuery("#menu_icon").attr("id");return _custom_media=!0,wp.media.editor.send.attachment=function(props,attachment){if(!_custom_media)return _orig_send_attachment.apply(this,[props,attachment]);$("#"+id).val(attachment.url).change()},wp.media.editor.open(button),!1}),$("#menu_icon").on("change",function(){var value=$(this).val();value=value.trim(),$("#menu_icon_preview").html(composePreviewContent(value))}),$(".cptui-help").on("click",function(e){e.preventDefault()}),$(".cptui-taxonomy-submit").on("click",function(e){if(0==$(".cptui-table :checkbox:checked").length){e.preventDefault();$('<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(){$(this).dialog("close")}}})}}),$("#auto-populate").on("click tap",function(e){e.preventDefault();var slug=$("#name").val(),plural=$("#label").val(),singular=$("#singular_label").val(),fields=$('.cptui-labels input[type="text"]');""!==slug&&(""===plural&&(plural=slug),""===singular&&(singular=slug),$(fields).each(function(i,el){var newval=$(el).data("label"),plurality=$(el).data("plurality");"undefined"!==newval&&(newval="plural"===plurality?newval.replace(/item/gi,plural):newval.replace(/item/gi,singular),""===$(el).val()&&$(el).val(newval))}))}),$("#auto-clear").on("click tap",function(e){e.preventDefault();var fields=$('.cptui-labels input[type="text"]');$(fields).each(function(i,el){$(el).val("")})})}(jQuery);
|
|
js/dashicons-picker.js
DELETED
@@ -1,419 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Dashicons Picker
|
3 |
-
*
|
4 |
-
* Based on: https://github.com/bradvin/dashicons-picker/
|
5 |
-
*/
|
6 |
-
|
7 |
-
( function ( $ ) {
|
8 |
-
'use strict';
|
9 |
-
/**
|
10 |
-
*
|
11 |
-
* @returns {void}
|
12 |
-
*/
|
13 |
-
$.fn.dashiconsPicker = function () {
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Dashicons, in CSS order
|
17 |
-
*
|
18 |
-
* @type Array
|
19 |
-
*/
|
20 |
-
var icons = [
|
21 |
-
'menu',
|
22 |
-
'admin-site',
|
23 |
-
'dashboard',
|
24 |
-
'admin-media',
|
25 |
-
'admin-page',
|
26 |
-
'admin-comments',
|
27 |
-
'admin-appearance',
|
28 |
-
'admin-plugins',
|
29 |
-
'admin-users',
|
30 |
-
'admin-tools',
|
31 |
-
'admin-settings',
|
32 |
-
'admin-network',
|
33 |
-
'admin-generic',
|
34 |
-
'admin-home',
|
35 |
-
'admin-collapse',
|
36 |
-
'filter',
|
37 |
-
'admin-customizer',
|
38 |
-
'admin-multisite',
|
39 |
-
'admin-links',
|
40 |
-
'format-links',
|
41 |
-
'admin-post',
|
42 |
-
'format-standard',
|
43 |
-
'format-image',
|
44 |
-
'format-gallery',
|
45 |
-
'format-audio',
|
46 |
-
'format-video',
|
47 |
-
'format-chat',
|
48 |
-
'format-status',
|
49 |
-
'format-aside',
|
50 |
-
'format-quote',
|
51 |
-
'welcome-write-blog',
|
52 |
-
'welcome-edit-page',
|
53 |
-
'welcome-add-page',
|
54 |
-
'welcome-view-site',
|
55 |
-
'welcome-widgets-menus',
|
56 |
-
'welcome-comments',
|
57 |
-
'welcome-learn-more',
|
58 |
-
'image-crop',
|
59 |
-
'image-rotate',
|
60 |
-
'image-rotate-left',
|
61 |
-
'image-rotate-right',
|
62 |
-
'image-flip-vertical',
|
63 |
-
'image-flip-horizontal',
|
64 |
-
'image-filter',
|
65 |
-
'undo',
|
66 |
-
'redo',
|
67 |
-
'editor-bold',
|
68 |
-
'editor-italic',
|
69 |
-
'editor-ul',
|
70 |
-
'editor-ol',
|
71 |
-
'editor-quote',
|
72 |
-
'editor-alignleft',
|
73 |
-
'editor-aligncenter',
|
74 |
-
'editor-alignright',
|
75 |
-
'editor-insertmore',
|
76 |
-
'editor-spellcheck',
|
77 |
-
'editor-distractionfree',
|
78 |
-
'editor-expand',
|
79 |
-
'editor-contract',
|
80 |
-
'editor-kitchensink',
|
81 |
-
'editor-underline',
|
82 |
-
'editor-justify',
|
83 |
-
'editor-textcolor',
|
84 |
-
'editor-paste-word',
|
85 |
-
'editor-paste-text',
|
86 |
-
'editor-removeformatting',
|
87 |
-
'editor-video',
|
88 |
-
'editor-customchar',
|
89 |
-
'editor-outdent',
|
90 |
-
'editor-indent',
|
91 |
-
'editor-help',
|
92 |
-
'editor-strikethrough',
|
93 |
-
'editor-unlink',
|
94 |
-
'editor-rtl',
|
95 |
-
'editor-break',
|
96 |
-
'editor-code',
|
97 |
-
'editor-paragraph',
|
98 |
-
'editor-table',
|
99 |
-
'align-left',
|
100 |
-
'align-right',
|
101 |
-
'align-center',
|
102 |
-
'align-none',
|
103 |
-
'lock',
|
104 |
-
'unlock',
|
105 |
-
'calendar',
|
106 |
-
'calendar-alt',
|
107 |
-
'visibility',
|
108 |
-
'hidden',
|
109 |
-
'post-status',
|
110 |
-
'edit',
|
111 |
-
'post-trash',
|
112 |
-
'trash',
|
113 |
-
'sticky',
|
114 |
-
'external',
|
115 |
-
'arrow-up',
|
116 |
-
'arrow-down',
|
117 |
-
'arrow-left',
|
118 |
-
'arrow-right',
|
119 |
-
'arrow-up-alt',
|
120 |
-
'arrow-down-alt',
|
121 |
-
'arrow-left-alt',
|
122 |
-
'arrow-right-alt',
|
123 |
-
'arrow-up-alt2',
|
124 |
-
'arrow-down-alt2',
|
125 |
-
'arrow-left-alt2',
|
126 |
-
'arrow-right-alt2',
|
127 |
-
'leftright',
|
128 |
-
'sort',
|
129 |
-
'randomize',
|
130 |
-
'list-view',
|
131 |
-
'excerpt-view',
|
132 |
-
'grid-view',
|
133 |
-
'hammer',
|
134 |
-
'art',
|
135 |
-
'migrate',
|
136 |
-
'performance',
|
137 |
-
'universal-access',
|
138 |
-
'universal-access-alt',
|
139 |
-
'tickets',
|
140 |
-
'nametag',
|
141 |
-
'clipboard',
|
142 |
-
'heart',
|
143 |
-
'megaphone',
|
144 |
-
'schedule',
|
145 |
-
'wordpress',
|
146 |
-
'wordpress-alt',
|
147 |
-
'pressthis',
|
148 |
-
'update',
|
149 |
-
'screenoptions',
|
150 |
-
'cart',
|
151 |
-
'feedback',
|
152 |
-
'cloud',
|
153 |
-
'translation',
|
154 |
-
'tag',
|
155 |
-
'category',
|
156 |
-
'archive',
|
157 |
-
'tagcloud',
|
158 |
-
'text',
|
159 |
-
'media-archive',
|
160 |
-
'media-audio',
|
161 |
-
'media-code',
|
162 |
-
'media-default',
|
163 |
-
'media-document',
|
164 |
-
'media-interactive',
|
165 |
-
'media-spreadsheet',
|
166 |
-
'media-text',
|
167 |
-
'media-video',
|
168 |
-
'playlist-audio',
|
169 |
-
'playlist-video',
|
170 |
-
'controls-play',
|
171 |
-
'controls-pause',
|
172 |
-
'controls-forward',
|
173 |
-
'controls-skipforward',
|
174 |
-
'controls-back',
|
175 |
-
'controls-skipback',
|
176 |
-
'controls-repeat',
|
177 |
-
'controls-volumeon',
|
178 |
-
'controls-volumeoff',
|
179 |
-
'yes',
|
180 |
-
'no',
|
181 |
-
'no-alt',
|
182 |
-
'plus',
|
183 |
-
'plus-alt',
|
184 |
-
'plus-alt2',
|
185 |
-
'minus',
|
186 |
-
'dismiss',
|
187 |
-
'marker',
|
188 |
-
'star-filled',
|
189 |
-
'star-half',
|
190 |
-
'star-empty',
|
191 |
-
'flag',
|
192 |
-
'info',
|
193 |
-
'warning',
|
194 |
-
'share',
|
195 |
-
'share1',
|
196 |
-
'share-alt',
|
197 |
-
'share-alt2',
|
198 |
-
'twitter',
|
199 |
-
'rss',
|
200 |
-
'email',
|
201 |
-
'email-alt',
|
202 |
-
'facebook',
|
203 |
-
'facebook-alt',
|
204 |
-
'networking',
|
205 |
-
'googleplus',
|
206 |
-
'location',
|
207 |
-
'location-alt',
|
208 |
-
'camera',
|
209 |
-
'images-alt',
|
210 |
-
'images-alt2',
|
211 |
-
'video-alt',
|
212 |
-
'video-alt2',
|
213 |
-
'video-alt3',
|
214 |
-
'vault',
|
215 |
-
'shield',
|
216 |
-
'shield-alt',
|
217 |
-
'sos',
|
218 |
-
'search',
|
219 |
-
'slides',
|
220 |
-
'analytics',
|
221 |
-
'chart-pie',
|
222 |
-
'chart-bar',
|
223 |
-
'chart-line',
|
224 |
-
'chart-area',
|
225 |
-
'groups',
|
226 |
-
'businessman',
|
227 |
-
'id',
|
228 |
-
'id-alt',
|
229 |
-
'products',
|
230 |
-
'awards',
|
231 |
-
'forms',
|
232 |
-
'testimonial',
|
233 |
-
'portfolio',
|
234 |
-
'book',
|
235 |
-
'book-alt',
|
236 |
-
'download',
|
237 |
-
'upload',
|
238 |
-
'backup',
|
239 |
-
'clock',
|
240 |
-
'lightbulb',
|
241 |
-
'microphone',
|
242 |
-
'desktop',
|
243 |
-
'tablet',
|
244 |
-
'smartphone',
|
245 |
-
'phone',
|
246 |
-
'smiley',
|
247 |
-
'index-card',
|
248 |
-
'carrot',
|
249 |
-
'building',
|
250 |
-
'store',
|
251 |
-
'album',
|
252 |
-
'palmtree',
|
253 |
-
'tickets-alt',
|
254 |
-
'money',
|
255 |
-
'thumbs-up',
|
256 |
-
'thumbs-down',
|
257 |
-
'layout',
|
258 |
-
'align-pull-left',
|
259 |
-
'align-pull-right',
|
260 |
-
'block-default',
|
261 |
-
'cloud-saved',
|
262 |
-
'cloud-upload',
|
263 |
-
'columns',
|
264 |
-
'cover-image',
|
265 |
-
'embed-audio',
|
266 |
-
'embed-generic',
|
267 |
-
'embed-photo',
|
268 |
-
'embed-post',
|
269 |
-
'embed-video',
|
270 |
-
'exit',
|
271 |
-
'html',
|
272 |
-
'info-outline',
|
273 |
-
'insert-after',
|
274 |
-
'insert-before',
|
275 |
-
'insert',
|
276 |
-
'remove',
|
277 |
-
'shortcode',
|
278 |
-
'table-col-after',
|
279 |
-
'table-col-before',
|
280 |
-
'table-col-delete',
|
281 |
-
'table-row-after',
|
282 |
-
'table-row-before',
|
283 |
-
'table-row-delete',
|
284 |
-
'saved',
|
285 |
-
'amazon',
|
286 |
-
'google',
|
287 |
-
'linkedin',
|
288 |
-
'pinterest',
|
289 |
-
'podio',
|
290 |
-
'reddit',
|
291 |
-
'spotify',
|
292 |
-
'twitch',
|
293 |
-
'whatsapp',
|
294 |
-
'xing',
|
295 |
-
'youtube',
|
296 |
-
'database-add',
|
297 |
-
'database-export',
|
298 |
-
'database-import',
|
299 |
-
'database-remove',
|
300 |
-
'database-view',
|
301 |
-
'database',
|
302 |
-
'bell',
|
303 |
-
'airplane',
|
304 |
-
'car',
|
305 |
-
'calculator',
|
306 |
-
'ames',
|
307 |
-
'printer',
|
308 |
-
'beer',
|
309 |
-
'coffee',
|
310 |
-
'drumstick',
|
311 |
-
'food',
|
312 |
-
'bank',
|
313 |
-
'hourglass',
|
314 |
-
'money-alt',
|
315 |
-
'open-folder',
|
316 |
-
'pdf',
|
317 |
-
'pets',
|
318 |
-
'privacy',
|
319 |
-
'superhero',
|
320 |
-
'superhero-alt',
|
321 |
-
'edit-page',
|
322 |
-
'fullscreen-alt',
|
323 |
-
'fullscreen-exit-alt'
|
324 |
-
];
|
325 |
-
|
326 |
-
return this.each( function () {
|
327 |
-
|
328 |
-
var button = $( this ),
|
329 |
-
offsetTop,
|
330 |
-
offsetLeft;
|
331 |
-
|
332 |
-
button.on( 'click.dashiconsPicker', function ( e ) {
|
333 |
-
offsetTop = $( e.currentTarget ).offset().top;
|
334 |
-
offsetLeft = $( e.currentTarget ).offset().left;
|
335 |
-
createPopup( button );
|
336 |
-
} );
|
337 |
-
|
338 |
-
function createPopup( button ) {
|
339 |
-
|
340 |
-
var target = $( '#menu_icon' ),
|
341 |
-
preview = $( button.data( 'preview' ) ),
|
342 |
-
popup = $( '<div class="dashicon-picker-container">' +
|
343 |
-
'<div class="dashicon-picker-control"></div>' +
|
344 |
-
'<ul class="dashicon-picker-list"></ul>' +
|
345 |
-
'</div>' ).css( {
|
346 |
-
'top': offsetTop,
|
347 |
-
'left': offsetLeft
|
348 |
-
} ),
|
349 |
-
list = popup.find( '.dashicon-picker-list' );
|
350 |
-
|
351 |
-
for ( var i in icons ) {
|
352 |
-
if ( icons.hasOwnProperty(i) ) {
|
353 |
-
list.append('<li data-icon="' + icons[i] + '"><a href="#" title="' + icons[i] + '"><span class="dashicons dashicons-' + icons[i] + '"></span></a></li>');
|
354 |
-
}
|
355 |
-
}
|
356 |
-
|
357 |
-
$( 'a', list ).on( 'click', function ( e ) {
|
358 |
-
e.preventDefault();
|
359 |
-
var title = $( this ).attr( 'title' );
|
360 |
-
target.val( 'dashicons-' + title ).change();
|
361 |
-
preview
|
362 |
-
.prop('class', 'dashicons')
|
363 |
-
.addClass( 'dashicons-' + title );
|
364 |
-
removePopup();
|
365 |
-
} );
|
366 |
-
|
367 |
-
var control = popup.find( '.dashicon-picker-control' );
|
368 |
-
|
369 |
-
control.html( '<a data-direction="back" href="#">' +
|
370 |
-
'<span class="dashicons dashicons-arrow-left-alt2"></span></a>' +
|
371 |
-
'<input type="text" class="" placeholder="Search" />' +
|
372 |
-
'<a data-direction="forward" href="#"><span class="dashicons dashicons-arrow-right-alt2"></span></a>'
|
373 |
-
);
|
374 |
-
|
375 |
-
$( 'a', control ).on( 'click', function ( e ) {
|
376 |
-
e.preventDefault();
|
377 |
-
if ( $( this ).data( 'direction' ) === 'back' ) {
|
378 |
-
$( 'li:gt(' + ( icons.length - 26 ) + ')', list ).prependTo( list );
|
379 |
-
} else {
|
380 |
-
$( 'li:lt(25)', list ).appendTo( list );
|
381 |
-
}
|
382 |
-
} );
|
383 |
-
|
384 |
-
popup.appendTo( 'body' ).show();
|
385 |
-
|
386 |
-
$( 'input', control ).on( 'keyup', function ( e ) {
|
387 |
-
var search = $( this ).val();
|
388 |
-
if ( search === '' ) {
|
389 |
-
$( 'li:lt(25)', list ).show();
|
390 |
-
} else {
|
391 |
-
$( 'li', list ).each( function () {
|
392 |
-
if ( $( this ).data( 'icon' ).toLowerCase().indexOf( search.toLowerCase() ) !== -1 ) {
|
393 |
-
$( this ).show();
|
394 |
-
} else {
|
395 |
-
$( this ).hide();
|
396 |
-
}
|
397 |
-
} );
|
398 |
-
}
|
399 |
-
} );
|
400 |
-
|
401 |
-
$( document ).on( 'mouseup.dashicons-picker', function ( e ) {
|
402 |
-
if ( ! popup.is( e.target ) && popup.has( e.target ).length === 0 ) {
|
403 |
-
removePopup();
|
404 |
-
}
|
405 |
-
} );
|
406 |
-
}
|
407 |
-
|
408 |
-
function removePopup() {
|
409 |
-
$( '.dashicon-picker-container' ).remove();
|
410 |
-
$( document ).off( '.dashicons-picker' );
|
411 |
-
}
|
412 |
-
} );
|
413 |
-
};
|
414 |
-
|
415 |
-
$( function () {
|
416 |
-
$( '.dashicons-picker' ).dashiconsPicker();
|
417 |
-
} );
|
418 |
-
|
419 |
-
}( jQuery ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/dashicons-picker.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
!function($){"use strict";$.fn.dashiconsPicker=function(){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"];return this.each(function(){var offsetTop,offsetLeft,button=$(this);function removePopup(){$(".dashicon-picker-container").remove(),$(document).off(".dashicons-picker")}button.on("click.dashiconsPicker",function(e){offsetTop=$(e.currentTarget).offset().top,offsetLeft=$(e.currentTarget).offset().left,function(button){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({top:offsetTop,left:offsetLeft}),list=popup.find(".dashicon-picker-list");for(var i in icons)icons.hasOwnProperty(i)&&list.append('<li data-icon="'+icons[i]+'"><a href="#" title="'+icons[i]+'"><span class="dashicons dashicons-'+icons[i]+'"></span></a></li>');$("a",list).on("click",function(e){e.preventDefault();var title=$(this).attr("title");target.val("dashicons-"+title).change(),preview.prop("class","dashicons").addClass("dashicons-"+title),removePopup()});var control=popup.find(".dashicon-picker-control");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>'),$("a",control).on("click",function(e){e.preventDefault(),"back"===$(this).data("direction")?$("li:gt("+(icons.length-26)+")",list).prependTo(list):$("li:lt(25)",list).appendTo(list)}),popup.appendTo("body").show(),$("input",control).on("keyup",function(e){var search=$(this).val();""===search?$("li:lt(25)",list).show():$("li",list).each(function(){-1!==$(this).data("icon").toLowerCase().indexOf(search.toLowerCase())?$(this).show():$(this).hide()})}),$(document).on("mouseup.dashicons-picker",function(e){popup.is(e.target)||0!==popup.has(e.target).length||removePopup()})}(button)})})},$(function(){$(".dashicons-picker").dashiconsPicker()})}(jQuery);
|
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: webdevstudios, pluginize, tw2113, vegasgeek, modemlooper, williams
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3084056
|
4 |
Tags: custom post types, CPT, CMS, post, types, post type, taxonomy, tax, custom, content types, post types
|
5 |
Requires at least: 5.9
|
6 |
-
Tested up to: 6.0
|
7 |
-
Stable tag: 1.
|
8 |
License: GPL-2.0+
|
9 |
Requires PHP: 5.6
|
10 |
|
@@ -36,6 +36,14 @@ Custom Post Type UI development is managed on GitHub, with official releases pub
|
|
36 |
|
37 |
== Changelog ==
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
= 1.12.1 - 2022-05-16 =
|
40 |
* Fixed: JSON decoding issues around WP-CLI import.
|
41 |
|
@@ -65,22 +73,16 @@ Custom Post Type UI development is managed on GitHub, with official releases pub
|
|
65 |
* Updated: Reserved post type slugs from recent WordPress releases.
|
66 |
* Fixed: PHP warnings around foreach loops in cptui_published_post_format_fix()
|
67 |
|
68 |
-
= 1.10.2 - 2022-01-28 =
|
69 |
-
* Updated: Confirmed compatibility with WordPress 5.9
|
70 |
-
|
71 |
-
= 1.10.1 - 2021-12-07 =
|
72 |
-
* Added: Filter to our PHP Global sanitization function for Extended usage.
|
73 |
-
|
74 |
-
= 1.10.0 - 2021-10-04 =
|
75 |
-
* Added: Dashicon picker with popup. - Props arshidkv12
|
76 |
-
* Added: Tag Cloud widget support for custom taxonomies.
|
77 |
-
* Added: Filters that allow developers to override the data fetched from our options, if they choose to.
|
78 |
-
* Added: Ability to clear all filled in label values.
|
79 |
-
* Fixed: Hardened up various parts of our code to ensure security.
|
80 |
-
* Fixed: Incorrectly referenced variable from post types instead of taxonomies, for the rest_controller_class property.
|
81 |
-
|
82 |
== Upgrade Notice ==
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
= 1.12.1 - 2022-05-16 =
|
85 |
* Fixed: JSON decoding issues around WP-CLI import.
|
86 |
|
@@ -110,20 +112,6 @@ Custom Post Type UI development is managed on GitHub, with official releases pub
|
|
110 |
* Updated: Reserved post type slugs from recent WordPress releases.
|
111 |
* Fixed: PHP warnings around foreach loops in cptui_published_post_format_fix()
|
112 |
|
113 |
-
= 1.10.2 - 2022-01-28 =
|
114 |
-
* Updated: Confirmed compatibility with WordPress 5.9
|
115 |
-
|
116 |
-
= 1.10.1 - 2021-12-07 =
|
117 |
-
* Added: Filter to our PHP Global sanitization function for Extended usage.
|
118 |
-
|
119 |
-
= 1.10.0 - 2021-10-04 =
|
120 |
-
* Added: Dashicon picker with popup. - Props arshidkv12
|
121 |
-
* Added: Tag Cloud widget support for custom taxonomies.
|
122 |
-
* Added: Filters that allow developers to override the data fetched from our options, if they choose to.
|
123 |
-
* Added: Ability to clear all filled in label values.
|
124 |
-
* Fixed: Hardened up various parts of our code to ensure security.
|
125 |
-
* Fixed: Incorrectly referenced variable from post types instead of taxonomies, for the rest_controller_class property.
|
126 |
-
|
127 |
== Installation ==
|
128 |
|
129 |
= Admin Installer via search =
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3084056
|
4 |
Tags: custom post types, CPT, CMS, post, types, post type, taxonomy, tax, custom, content types, post types
|
5 |
Requires at least: 5.9
|
6 |
+
Tested up to: 6.0.2
|
7 |
+
Stable tag: 1.13.0
|
8 |
License: GPL-2.0+
|
9 |
Requires PHP: 5.6
|
10 |
|
36 |
|
37 |
== Changelog ==
|
38 |
|
39 |
+
= 1.13.0 - 2022-09-07 =
|
40 |
+
* Added: Notes regarding featured image and post format support also needing `add_theme_support` to work.
|
41 |
+
* Fixed: Issues around double quotes and JSON export with the post type description field
|
42 |
+
* Fixed: Issues around HTML markup being removed from post type description field stemming from 1.10.x release
|
43 |
+
* Fixed: Pluralization issue with our UI for some field labels
|
44 |
+
* Updated: Code separation and quality cleanup.
|
45 |
+
* Updated: Plugin branding.
|
46 |
+
|
47 |
= 1.12.1 - 2022-05-16 =
|
48 |
* Fixed: JSON decoding issues around WP-CLI import.
|
49 |
|
73 |
* Updated: Reserved post type slugs from recent WordPress releases.
|
74 |
* Fixed: PHP warnings around foreach loops in cptui_published_post_format_fix()
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
== Upgrade Notice ==
|
77 |
|
78 |
+
= 1.13.0 - 2022-09-07 =
|
79 |
+
* Added: Notes regarding featured image and post format support also needing `add_theme_support` to work.
|
80 |
+
* Fixed: Issues around double quotes and JSON export with the post type description field
|
81 |
+
* Fixed: Issues around HTML markup being removed from post type description field stemming from 1.10.x release
|
82 |
+
* Fixed: Pluralization issue with our UI for some field labels
|
83 |
+
* Updated: Code separation and quality cleanup.
|
84 |
+
* Updated: Plugin branding.
|
85 |
+
|
86 |
= 1.12.1 - 2022-05-16 =
|
87 |
* Fixed: JSON decoding issues around WP-CLI import.
|
88 |
|
112 |
* Updated: Reserved post type slugs from recent WordPress releases.
|
113 |
* Fixed: PHP warnings around foreach loops in cptui_published_post_format_fix()
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
== Installation ==
|
116 |
|
117 |
= Admin Installer via search =
|