1930795f by Jeremy Groot

CPT UI

1 parent 7e7ce19d
Showing 32 changed files with 2048 additions and 0 deletions
postboxes.add_postbox_toggles(pagenow);
(function($) {
$("#cptui_select_post_type_submit").hide();
$("#cptui_select_taxonomy_submit").hide();
if ("edit" === getParameterByName("action")) {
var original_slug = $("#name").val();
}
$("#hierarchical").on("change", function() {
var hierarchical = $(this).val();
if ("1" === hierarchical) {
$("#page-attributes").prop("checked", true);
} else {
$("#page-attributes").prop("checked", false);
}
});
$("#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 = "";
if (typeof cptui_type_data !== "undefined") {
msg = cptui_type_data.confirm;
} else if (typeof cptui_tax_data !== "undefined") {
msg = cptui_tax_data.confirm;
}
var submit_delete_warning = $('<div class="cptui-submit-delete-dialog">' + msg + "</div>").appendTo("#poststuff").dialog({
dialogClass: "wp-dialog",
modal: true,
autoOpen: true,
buttons: {
OK: function() {
var form = $(e.target).closest("form");
$(e.target).off("click").click();
},
Cancel: function() {
$(this).dialog("close");
}
}
});
});
$("#support .question").each(function() {
var tis = $(this), state = false, answer = tis.next("div").slideUp();
tis.on("click keydown", function(e) {
if (e.type === "keydown" && e.keyCode !== 32 && e.keyCode !== 13) {
return;
}
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;
value = original_value = $(this).val();
if (e.keyCode !== 9 && e.keyCode !== 37 && e.keyCode !== 38 && e.keyCode !== 39 && e.keyCode !== 40) {
value = value.replace(/ /g, "_");
value = value.toLowerCase();
value = replaceDiacritics(value);
value = transliterate(value);
value = replaceSpecialCharacters(value);
if (value !== original_value) {
$(this).prop("value", value);
}
}
if (typeof original_slug !== "undefined") {
var $slugchanged = $("#slugchanged");
if (value != original_slug) {
$slugchanged.removeClass("hidemessage");
} else {
$slugchanged.addClass("hidemessage");
}
}
var $slugexists = $("#slugexists");
if (typeof cptui_type_data != "undefined") {
if (cptui_type_data.existing_post_types.hasOwnProperty(value) && value !== original_slug) {
$slugexists.removeClass("hidemessage");
} else {
$slugexists.addClass("hidemessage");
}
}
if (typeof cptui_tax_data != "undefined") {
if (cptui_tax_data.existing_taxonomies.hasOwnProperty(value) && value !== original_slug) {
$slugexists.removeClass("hidemessage");
} else {
$slugexists.addClass("hidemessage");
}
}
});
function replaceDiacritics(s) {
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 ];
var chars = [ "A", "a", "E", "e", "I", "i", "O", "o", "U", "u", "N", "n", "C", "c" ];
for (var i = 0; i < diacritics.length; i++) {
s = s.replace(diacritics[i], chars[i]);
}
return s;
}
function replaceSpecialCharacters(s) {
s = s.replace(/[^a-z0-9\s-]/gi, "_");
return s;
}
function composePreviewContent(value) {
var re = /(http|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/;
var is_url = re.test(value);
if (!value) {
return "";
} else if (0 === value.indexOf("dashicons-")) {
return $('<div class="dashicons-before"><br></div>').addClass(htmlEncode(value));
} else if (is_url) {
var imgsrc = encodeURI(value);
var theimg = document.createElement("IMG");
theimg.src = imgsrc;
return theimg;
}
}
function htmlEncode(str) {
return String(str).replace(/[^-\w. ]/gi, function(c) {
return "&#" + c.charCodeAt(0) + ";";
});
}
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"
};
function transliterate(word) {
return word.split("").map(function(char) {
return cyrillic[char] || char;
}).join("");
}
if (undefined != wp.media) {
var _custom_media = true, _orig_send_attachment = wp.media.editor.send.attachment;
}
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url);
if (!results) return null;
if (!results[2]) return "";
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
$("#cptui_choose_icon").on("click", function(e) {
e.preventDefault();
var button = $(this);
var id = jQuery("#menu_icon").attr("id");
_custom_media = true;
wp.media.editor.send.attachment = function(props, attachment) {
if (_custom_media) {
$("#" + id).val(attachment.url).change();
} else {
return _orig_send_attachment.apply(this, [ props, attachment ]);
}
};
wp.media.editor.open(button);
return false;
});
$("#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 ($(".cptui-table :checkbox:checked").length == 0) {
e.preventDefault();
var no_associated_type_warning = $('<div class="cptui-taxonomy-empty-types-dialog">' + cptui_tax_data.no_associated_type + "</div>").appendTo("#poststuff").dialog({
dialogClass: "wp-dialog",
modal: true,
autoOpen: true,
buttons: {
OK: function() {
$(this).dialog("close");
}
}
});
}
});
$("#auto-populate").on("click tap", function(e) {
e.preventDefault();
var slug = $("#name").val();
var plural = $("#label").val();
var singular = $("#singular_label").val();
var fields = $('.cptui-labels input[type="text"]');
if ("" === slug) {
return;
}
if ("" === plural) {
plural = slug;
}
if ("" === singular) {
singular = slug;
}
$(fields).each(function(i, el) {
var newval = $(el).data("label");
var plurality = $(el).data("plurality");
if ("undefined" !== newval) {
if ("plural" === plurality) {
newval = newval.replace(/item/gi, plural);
} else {
newval = newval.replace(/item/gi, singular);
}
if ($(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);
\ No newline at end of file
postboxes.add_postbox_toggles(pagenow),function(c){var i;function t(e){var t=/(http|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/.test(e);return e?0===e.indexOf("dashicons-")?c('<div class="dashicons-before"><br></div>').addClass(String(e).replace(/[^-\w. ]/gi,function(e){return"&#"+e.charCodeAt(0)+";"})):t?(t=encodeURI(e),(e=document.createElement("IMG")).src=t,e):void 0:""}c("#cptui_select_post_type_submit").hide(),c("#cptui_select_taxonomy_submit").hide(),"edit"===function(e,t){t=t||window.location.href;e=e.replace(/[\[\]]/g,"\\$&");e=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return e?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null}("action")&&(i=c("#name").val()),c("#hierarchical").on("change",function(){"1"===c(this).val()?c("#page-attributes").prop("checked",!0):c("#page-attributes").prop("checked",!1)}),c("#post_type").on("change",function(){c("#cptui_select_post_type").submit()}),c("#taxonomy").on("change",function(){c("#cptui_select_taxonomy").submit()}),c(".cptui-delete-top, .cptui-delete-bottom").on("click",function(e){e.preventDefault();var t="";"undefined"!=typeof cptui_type_data?t=cptui_type_data.confirm:"undefined"!=typeof cptui_tax_data&&(t=cptui_tax_data.confirm),c('<div class="cptui-submit-delete-dialog">'+t+"</div>").appendTo("#poststuff").dialog({dialogClass:"wp-dialog",modal:!0,autoOpen:!0,buttons:{OK:function(){c(e.target).closest("form");c(e.target).off("click").click()},Cancel:function(){c(this).dialog("close")}}})}),c("#support .question").each(function(){var t=c(this),a=!1,i=t.next("div").slideUp();t.on("click keydown",function(e){"keydown"===e.type&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),a=!a,i.slideToggle(a),t.toggleClass("active",a),t.attr("aria-expanded",a.toString()),t.focus())})}),c("#name").on("keyup",function(e){var t=a=c(this).val(),a=(9!==e.keyCode&&37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&40!==e.keyCode&&(t=(t=function(e){for(var t=[/[\300-\306]/g,/[\340-\346]/g,/[\310-\313]/g,/[\350-\353]/g,/[\314-\317]/g,/[\354-\357]/g,/[\322-\330]/g,/[\362-\370]/g,/[\331-\334]/g,/[\371-\374]/g,/[\321]/g,/[\361]/g,/[\307]/g,/[\347]/g],a=["A","a","E","e","I","i","O","o","U","u","N","n","C","c"],i=0;i<t.length;i++)e=e.replace(t[i],a[i]);return e}(t=(t=t.replace(/ /g,"_")).toLowerCase())).split("").map(function(e){return s[e]||e}).join(""),(t=t.replace(/[^a-z0-9\s-]/gi,"_"))!==a&&c(this).prop("value",t)),void 0!==i&&(e=c("#slugchanged"),t!=i?e.removeClass("hidemessage"):e.addClass("hidemessage")),c("#slugexists"));"undefined"!=typeof cptui_type_data&&(cptui_type_data.existing_post_types.hasOwnProperty(t)&&t!==i?a.removeClass("hidemessage"):a.addClass("hidemessage")),"undefined"!=typeof cptui_tax_data&&(cptui_tax_data.existing_taxonomies.hasOwnProperty(t)&&t!==i?a.removeClass("hidemessage"):a.addClass("hidemessage"))});var n,o,s={"Ё":"YO","Й":"I","Ц":"TS","У":"U","К":"K","Е":"E","Н":"N","Г":"G","Ш":"SH","Щ":"SCH","З":"Z","Х":"H","Ъ":"'","ё":"yo","й":"i","ц":"ts","у":"u","к":"k","е":"e","н":"n","г":"g","ш":"sh","щ":"sch","з":"z","х":"h","ъ":"'","Ф":"F","Ы":"I","В":"V","А":"a","П":"P","Р":"R","О":"O","Л":"L","Д":"D","Ж":"ZH","Э":"E","ф":"f","ы":"i","в":"v","а":"a","п":"p","р":"r","о":"o","л":"l","д":"d","ж":"zh","э":"e","Я":"Ya","Ч":"CH","С":"S","М":"M","И":"I","Т":"T","Ь":"'","Б":"B","Ю":"YU","я":"ya","ч":"ch","с":"s","м":"m","и":"i","т":"t","ь":"'","б":"b","ю":"yu"};null!=wp.media&&(n=!0,o=wp.media.editor.send.attachment),c("#cptui_choose_icon").on("click",function(e){e.preventDefault();var e=c(this),a=jQuery("#menu_icon").attr("id");return n=!0,wp.media.editor.send.attachment=function(e,t){if(!n)return o.apply(this,[e,t]);c("#"+a).val(t.url).change()},wp.media.editor.open(e),!1}),c("#menu_icon").on("change",function(){var e=(e=c(this).val()).trim();c("#menu_icon_preview").html(t(e))}),c(".cptui-help").on("click",function(e){e.preventDefault()}),c(".cptui-taxonomy-submit").on("click",function(e){0==c(".cptui-table :checkbox:checked").length&&(e.preventDefault(),c('<div class="cptui-taxonomy-empty-types-dialog">'+cptui_tax_data.no_associated_type+"</div>").appendTo("#poststuff").dialog({dialogClass:"wp-dialog",modal:!0,autoOpen:!0,buttons:{OK:function(){c(this).dialog("close")}}}))}),c("#auto-populate").on("click tap",function(e){e.preventDefault();var e=c("#name").val(),n=c("#label").val(),o=c("#singular_label").val(),t=c('.cptui-labels input[type="text"]');""!==e&&(""===n&&(n=e),""===o&&(o=e),c(t).each(function(e,t){var a=c(t).data("label"),i=c(t).data("plurality");"undefined"!==a&&(a="plural"===i?a.replace(/item/gi,n):a.replace(/item/gi,o),""===c(t).val()&&c(t).val(a))}))}),c("#auto-clear").on("click tap",function(e){e.preventDefault();e=c('.cptui-labels input[type="text"]');c(e).each(function(e,t){c(t).val("")})})}(jQuery);
\ No newline at end of file
{"version":3,"sources":["src/js/cptui-scripts.js"],"names":["postboxes","add_postbox_toggles","pagenow","$","original_slug","composePreviewContent","value","is_url","test","indexOf","addClass","String","replace","c","charCodeAt","imgsrc","encodeURI","theimg","document","createElement","src","hide","name","url","window","location","href","results","RegExp","exec","decodeURIComponent","getParameterByName","val","on","this","prop","submit","e","preventDefault","msg","cptui_type_data","confirm","cptui_tax_data","appendTo","dialog","dialogClass","modal","autoOpen","buttons","OK","target","closest","off","click","Cancel","each","tis","state","answer","next","slideUp","type","keyCode","slideToggle","toggleClass","attr","toString","focus","original_value","$slugexists","s","diacritics","chars","i","length","replaceDiacritics","toLowerCase","split","map","char","cyrillic","join","$slugchanged","removeClass","existing_post_types","hasOwnProperty","existing_taxonomies","_custom_media","_orig_send_attachment","Ё","Й","Ц","У","К","Е","Н","Г","Ш","Щ","З","Х","Ъ","ё","й","ц","у","к","е","н","г","ш","щ","з","х","ъ","Ф","Ы","В","А","П","Р","О","Л","Д","Ж","Э","ф","ы","в","а","п","р","о","л","д","ж","э","Я","Ч","С","М","И","Т","Ь","Б","Ю","я","ч","с","м","и","т","ь","б","ю","undefined","wp","media","editor","send","attachment","button","id","jQuery","props","apply","change","open","trim","html","no_associated_type","slug","plural","singular","fields","el","newval","data","plurality"],"mappings":"AAGAA,UAAUC,oBAAoBC,SAK9B,SAAUC,GAKT,IAEKC,EAqIL,SAASC,EAAsBC,GAE9B,IACIC,EADK,4EACOC,KAAKF,GAErB,OAAKA,EAEM,IAAMA,EAAMG,QAAQ,cACvBN,EAAE,4CAA4CO,SAU/CC,OAVmEL,GAUvDM,QAAQ,aAAc,SAAUC,GAClD,MAAO,KAAOA,EAAEC,WAAW,GAAK,OAVrBP,GACPQ,EAASC,UAAUV,IACnBW,EAASC,SAASC,cAAc,QAC7BC,IAAML,EACNE,QAJD,EAHC,GAhJ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3K,EAAE,oCAEfA,EAAE2K,GAAQvH,KAAM,SAAUkB,EAAGsG,GAC5B5K,EAAE4K,GAAI/I,IAAI,QAjRb,CAqRGmI"}
\ No newline at end of file
.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%; } }
/*# sourceMappingURL=cptui-styles.css.map */
\ No newline at end of file
{
"version": 3,
"file": "cptui-styles.css",
"sources": [
"../src/scss/cptui-styles.scss"
],
"names": [],
"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,EA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AAY,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"
}
\ No newline at end of file
.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%}}
(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 button = $(this), offsetTop, offsetLeft;
button.on("click.dashiconsPicker", function(e) {
offsetTop = $(e.currentTarget).offset().top;
offsetLeft = $(e.currentTarget).offset().left;
createPopup(button);
});
function createPopup(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) {
if (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();
if ($(this).data("direction") === "back") {
$("li:gt(" + (icons.length - 26) + ")", list).prependTo(list);
} else {
$("li:lt(25)", list).appendTo(list);
}
});
popup.appendTo("body").show();
$("input", control).on("keyup", function(e) {
var search = $(this).val();
if (search === "") {
$("li:lt(25)", list).show();
} else {
$("li", list).each(function() {
if ($(this).data("icon").toLowerCase().indexOf(search.toLowerCase()) !== -1) {
$(this).show();
} else {
$(this).hide();
}
});
}
});
$(document).on("mouseup.dashicons-picker", function(e) {
if (!popup.is(e.target) && popup.has(e.target).length === 0) {
removePopup();
}
});
}
function removePopup() {
$(".dashicon-picker-container").remove();
$(document).off(".dashicons-picker");
}
});
};
$(function() {
$(".dashicons-picker").dashiconsPicker();
});
})(jQuery);
\ No newline at end of file
!function(m){"use strict";m.fn.dashiconsPicker=function(){var c=["menu","admin-site","dashboard","admin-media","admin-page","admin-comments","admin-appearance","admin-plugins","admin-users","admin-tools","admin-settings","admin-network","admin-generic","admin-home","admin-collapse","filter","admin-customizer","admin-multisite","admin-links","format-links","admin-post","format-standard","format-image","format-gallery","format-audio","format-video","format-chat","format-status","format-aside","format-quote","welcome-write-blog","welcome-edit-page","welcome-add-page","welcome-view-site","welcome-widgets-menus","welcome-comments","welcome-learn-more","image-crop","image-rotate","image-rotate-left","image-rotate-right","image-flip-vertical","image-flip-horizontal","image-filter","undo","redo","editor-bold","editor-italic","editor-ul","editor-ol","editor-quote","editor-alignleft","editor-aligncenter","editor-alignright","editor-insertmore","editor-spellcheck","editor-distractionfree","editor-expand","editor-contract","editor-kitchensink","editor-underline","editor-justify","editor-textcolor","editor-paste-word","editor-paste-text","editor-removeformatting","editor-video","editor-customchar","editor-outdent","editor-indent","editor-help","editor-strikethrough","editor-unlink","editor-rtl","editor-break","editor-code","editor-paragraph","editor-table","align-left","align-right","align-center","align-none","lock","unlock","calendar","calendar-alt","visibility","hidden","post-status","edit","post-trash","trash","sticky","external","arrow-up","arrow-down","arrow-left","arrow-right","arrow-up-alt","arrow-down-alt","arrow-left-alt","arrow-right-alt","arrow-up-alt2","arrow-down-alt2","arrow-left-alt2","arrow-right-alt2","leftright","sort","randomize","list-view","excerpt-view","grid-view","hammer","art","migrate","performance","universal-access","universal-access-alt","tickets","nametag","clipboard","heart","megaphone","schedule","wordpress","wordpress-alt","pressthis","update","screenoptions","cart","feedback","cloud","translation","tag","category","archive","tagcloud","text","media-archive","media-audio","media-code","media-default","media-document","media-interactive","media-spreadsheet","media-text","media-video","playlist-audio","playlist-video","controls-play","controls-pause","controls-forward","controls-skipforward","controls-back","controls-skipback","controls-repeat","controls-volumeon","controls-volumeoff","yes","no","no-alt","plus","plus-alt","plus-alt2","minus","dismiss","marker","star-filled","star-half","star-empty","flag","info","warning","share","share1","share-alt","share-alt2","twitter","rss","email","email-alt","facebook","facebook-alt","networking","googleplus","location","location-alt","camera","images-alt","images-alt2","video-alt","video-alt2","video-alt3","vault","shield","shield-alt","sos","search","slides","analytics","chart-pie","chart-bar","chart-line","chart-area","groups","businessman","id","id-alt","products","awards","forms","testimonial","portfolio","book","book-alt","download","upload","backup","clock","lightbulb","microphone","desktop","tablet","smartphone","phone","smiley","index-card","carrot","building","store","album","palmtree","tickets-alt","money","thumbs-up","thumbs-down","layout","align-pull-left","align-pull-right","block-default","cloud-saved","cloud-upload","columns","cover-image","embed-audio","embed-generic","embed-photo","embed-post","embed-video","exit","html","info-outline","insert-after","insert-before","insert","remove","shortcode","table-col-after","table-col-before","table-col-delete","table-row-after","table-row-before","table-row-delete","saved","amazon","google","linkedin","pinterest","podio","reddit","spotify","twitch","whatsapp","xing","youtube","database-add","database-export","database-import","database-remove","database-view","database","bell","airplane","car","calculator","ames","printer","beer","coffee","drumstick","food","bank","hourglass","money-alt","open-folder","pdf","pets","privacy","superhero","superhero-alt","edit-page","fullscreen-alt","fullscreen-exit-alt"];return this.each(function(){var s,l,n=m(this);function d(){m(".dashicon-picker-container").remove(),m(document).off(".dashicons-picker")}n.on("click.dashiconsPicker",function(e){s=m(e.currentTarget).offset().top,l=m(e.currentTarget).offset().left;var a,e=n,t=m("#menu_icon"),o=m(e.data("preview")),i=m('<div class="dashicon-picker-container"><div class="dashicon-picker-control"></div><ul class="dashicon-picker-list"></ul></div>').css({top:s,left:l}),r=i.find(".dashicon-picker-list");for(a in c)c.hasOwnProperty(a)&&r.append('<li data-icon="'+c[a]+'"><a href="#" title="'+c[a]+'"><span class="dashicons dashicons-'+c[a]+'"></span></a></li>');m("a",r).on("click",function(e){e.preventDefault();e=m(this).attr("title");t.val("dashicons-"+e).change(),o.prop("class","dashicons").addClass("dashicons-"+e),d()}),(e=i.find(".dashicon-picker-control")).html('<a data-direction="back" href="#"><span class="dashicons dashicons-arrow-left-alt2"></span></a><input type="text" class="" placeholder="Search" /><a data-direction="forward" href="#"><span class="dashicons dashicons-arrow-right-alt2"></span></a>'),m("a",e).on("click",function(e){e.preventDefault(),"back"===m(this).data("direction")?m("li:gt("+(c.length-26)+")",r).prependTo(r):m("li:lt(25)",r).appendTo(r)}),i.appendTo("body").show(),m("input",e).on("keyup",function(e){var a=m(this).val();""===a?m("li:lt(25)",r).show():m("li",r).each(function(){-1!==m(this).data("icon").toLowerCase().indexOf(a.toLowerCase())?m(this).show():m(this).hide()})}),m(document).on("mouseup.dashicons-picker",function(e){i.is(e.target)||0!==i.has(e.target).length||d()})})})},m(function(){m(".dashicons-picker").dashiconsPicker()})}(jQuery);
\ No newline at end of file
{"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,SAC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AKqC,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"}
\ No newline at end of file
<?php
/**
* Custom Post Type UI Debug Information.
*
* @package CPTUI
* @subpackage Debugging
* @author WebDevStudios
* @since 1.2.0
* @license GPL-2.0+
*/
/**
* Custom Post Type UI Debug Info
*/
class CPTUI_Debug_Info {
/**
* Tab content for the debug info tab.
*
* @since 1.2.0
*/
public function tab_site_info() {
?>
<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>
<label for="cptui_audit_textarea">
<textarea readonly="readonly" aria-readonly="true" id="cptui-audit-textarea" name="cptui_audit_textarea" rows="20" cols="100" class="large-text code">
<?php echo esc_html( $this->system_status() ); ?>
</textarea></label>
<?php
}
/**
* Generate the debug information content.
*
* @since 1.2.0
*
* @return string
*/
private function system_status() {
if ( ! current_user_can( 'manage_options' ) ) {
return '';
}
global $wpdb;
$theme_data = wp_get_theme();
$theme = $theme_data->Name . ' ' . $theme_data->Version; // phpcs:ignore.
ob_start();
?>
### Begin Custom Post Type UI Debug Info ###
Multisite: <?php echo is_multisite() ? 'Yes' . "\n" : 'No' . "\n"; ?>
SITE_URL: <?php echo esc_url( site_url() ) . "\n"; ?>
HOME_URL: <?php echo esc_url( home_url() ) . "\n"; ?>
WordPress Version: <?php echo get_bloginfo( 'version' ) . "\n"; // phpcs:ignore. ?>
Permalink Structure: <?php echo get_option( 'permalink_structure' ) . "\n"; // phpcs:ignore. ?>
Active Theme: <?php echo $theme . "\n"; // phpcs:ignore. ?>
Registered Post Types: <?php echo implode( ', ', get_post_types( '', 'names' ) ) . "\n"; // phpcs:ignore. ?>
PHP Version: <?php echo PHP_VERSION . "\n"; ?>
MySQL Version: <?php echo $wpdb->db_version() . "\n"; // phpcs:ignore. ?>
Web Server Info: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; // phpcs:ignore. ?>
Show On Front: <?php echo get_option( 'show_on_front' ) . "\n"; // phpcs:ignore. ?>
Page On Front: <?php $id = get_option( 'page_on_front' ); // phpcs:ignore.
echo get_the_title( $id ) . ' (#' . $id . ')' . "\n"; // phpcs:ignore. ?>
Page For Posts: <?php $id = get_option( 'page_for_posts' ); // phpcs:ignore.
echo get_the_title( $id ) . ' (#' . $id . ')' . "\n"; // phpcs:ignore. ?>
WordPress Memory Limit: <?php echo ( $this->num_convt( WP_MEMORY_LIMIT ) / ( 1024 ) ) . 'MB'; ?><?php echo "\n"; // phpcs:ignore. ?>
<?php
$plugins = get_plugins();
$pg_count = count( $plugins );
echo 'TOTAL PLUGINS: ' . $pg_count . "\n\n"; // phpcs:ignore.
// MU plugins.
$mu_plugins = get_mu_plugins();
if ( $mu_plugins ) :
echo "\t\t" . 'MU PLUGINS: (' . count( $mu_plugins ) . ')' . "\n\n";
foreach ( $mu_plugins as $mu_path => $mu_plugin ) {
echo "\t\t" . esc_html( $mu_plugin['Name'] ) . ': ' . esc_html( $mu_plugin['Version'] ) . "\n";
}
endif;
// Standard plugins - active.
echo "\n";
$active = get_option( 'active_plugins', [] );
$ac_count = count( $active );
$ic_count = $pg_count - $ac_count;
echo "\t\t" . 'ACTIVE PLUGINS: (' . $ac_count . ')' . "\n\n"; // phpcs:ignore.
foreach ( $plugins as $plugin_path => $plugin ) {
// If the plugin isn't active, don't show it.
if ( ! in_array( $plugin_path, $active, true ) ) {
continue;
}
echo "\t\t" . esc_html( $plugin['Name'] ) . ': ' . esc_html( $plugin['Version'] ) . "\n";
}
// Standard plugins - inactive.
echo "\n";
echo "\t\t" , 'INACTIVE PLUGINS: (' . $ic_count . ')' . "\n\n"; // phpcs:ignore.
foreach ( $plugins as $plugin_path => $plugin ) {
// If the plugin isn't active, show it here.
if ( in_array( $plugin_path, $active, true ) ) {
continue;
}
echo "\t\t" . esc_html( $plugin['Name'] ) . ': ' . esc_html( $plugin['Version'] ) . "\n";
}
// If multisite, grab network as well.
if ( is_multisite() ) :
$net_plugins = wp_get_active_network_plugins();
$net_active = get_site_option( 'active_sitewide_plugins', [] );
echo "\n";
echo 'NETWORK ACTIVE PLUGINS: (' . count( $net_plugins ) . ')' . "\n\n";
foreach ( $net_plugins as $plugin_path ) {
$plugin_base = plugin_basename( $plugin_path );
// If the plugin isn't active, don't show it.
if ( ! array_key_exists( $plugin_base, $net_active ) ) {
continue;
}
$plugin = get_plugin_data( $plugin_path );
echo esc_html( $plugin['Name'] ) . ' :' . esc_html( $plugin['Version'] ) . "\n";
}
endif;
echo "\n";
$cptui_post_types = cptui_get_post_type_data();
echo "\t\t" . 'Post Types: ' . "\n";
echo "\t\t" . wp_json_encode( $cptui_post_types ) . "\n";
echo "\n\n";
$cptui_taxonomies = cptui_get_taxonomy_data();
echo "\t\t" . 'Taxonomies: ' . "\n";
echo "\t\t" . wp_json_encode( $cptui_taxonomies ) . "\n";
echo "\n";
if ( has_action( 'cptui_custom_debug_info' ) ) {
echo "\t\t" . 'EXTRA DEBUG INFO';
}
/**
* Fires at the end of the debug info output.
*
* @since 1.3.0
*/
do_action( 'cptui_custom_debug_info' );
echo "\n";
?>
### End Debug Info ###
<?php
return ob_get_clean();
}
/**
* Helper function for number conversions.
*
* @since 1.2.0
* @access public
*
* @param mixed $v Value.
* @return int
*/
public function num_convt( $v ) {
$l = substr( $v, - 1 );
$ret = substr( $v, 0, - 1 );
switch ( strtoupper( $l ) ) {
case 'P': // Fall-through.
case 'T': // Fall-through.
case 'G': // Fall-through.
case 'M': // Fall-through.
case 'K': // Fall-through.
$ret *= 1024;
break;
default:
break;
}
return $ret;
}
/**
* Sends an email to the specified address, with the system status as the message.
*
* @since 1.2.0
*
* @param array $args Array of arguments for the method. Optional.
* @return bool
*/
public function send_email( $args = [] ) {
if ( ! isset( $args['email'] ) || ! is_email( $args['email'] ) ) {
return false;
}
stripslashes_deep( $args );
$args['email'] = sanitize_email( $args['email'] );
$message = $this->system_status();
/**
* Filters the debug email subject.
*
* @since 1.3.0
*
* @param string $value Intended email subject.
*/
$subject = apply_filters(
'cptui_debug_email_subject',
sprintf(
// translators: Placeholder will hold site home_url.
esc_html__( 'Custom Post Type UI debug information for %s', 'custom-post-type-ui' ),
esc_url( home_url( '/' ) )
)
);
$result = wp_mail( $args['email'], $subject, $message );
/**
* Fires after the debug email has been sent.
*
* @since 1.3.0
*/
do_action( 'cptui_after_debug_email_sent' );
return $result;
}
}
<?php
/**
* Custom Post Type UI About Page.
*
* @package CPTUI
* @subpackage About
* @author WebDevStudios
* @since 1.3.0
* @license GPL-2.0+
*/
// phpcs:disable WebDevStudios.All.RequireAuthor
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Enqueue our Custom Post Type UI assets.
*
* @since 1.6.0
*/
function cptui_about_assets() {
$current_screen = get_current_screen();
if ( ! is_object( $current_screen ) || 'toplevel_page_cptui_main_menu' !== $current_screen->base ) {
return;
}
if ( wp_doing_ajax() ) {
return;
}
wp_enqueue_style( 'cptui-css' );
}
add_action( 'admin_enqueue_scripts', 'cptui_about_assets' );
/**
* Display our primary menu page.
*
* @since 0.3.0
*
* @internal
*/
function cptui_settings() {
?>
<div class="wrap about-wrap">
<?php
/**
* Fires inside and at the top of the wrapper for the main plugin landing page.
*
* @since 1.0.0
*/
do_action( 'cptui_main_page_start' );
?>
<h1><?php esc_html_e( 'Custom Post Type UI', 'custom-post-type-ui' ); ?> <?php echo esc_html( CPTUI_VERSION ); ?></h1>
<?php
/**
* Fires after the main page `<h1>` heading tag.
*
* @since 1.3.0
*/
do_action( 'cptui_main_page_after_header' );
?>
<div class="cptui-intro-devblock">
<p class="about-text cptui-about-text">
<?php esc_html_e( 'Thank you for choosing Custom Post Type UI! We hope that your experience with our plugin makes creating post types and taxonomies and organizing your content quick and easy.', 'custom-post-type-ui' ); ?>
</p>
<div class="cptui-badge"></div>
</div>
<?php
/**
* Fires before the About Page changelog.
*
* @since 1.4.0
*/
do_action( 'cptui_main_page_before_changelog' );
?>
<h2>
<?php
printf(
// translators: Placeholder will hold the plugin version.
esc_html__( "What's new in version %s", 'custom-post-type-ui' ),
esc_html( CPTUI_VERSION )
);
?>
</h2>
<div class="changelog about-integrations">
<div class="cptui-feature feature-section col three-col">
<div class="col">
<h2><?php esc_html_e( 'Post type descriptions', 'custom-post-type-ui' ); ?></h2>
<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>
<h2><?php esc_html_e( 'Miscellaneous code cleanup and separation.', 'custom-post-type-ui' ); ?></h2>
<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>
<h2><?php esc_html_e( 'Branding.', 'custom-post-type-ui' ); ?></h2>
<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>
<h2><?php esc_html_e( 'Miscellaneous.', 'custom-post-type-ui' ); ?></h2>
<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>
</div>
</div>
</div>
<div class="extranotes">
<?php
/**
* Fires inside a div for extra notes.
*
* @since 1.3.0
*/
do_action( 'cptui_main_page_extra_notes' );
?>
</div>
</div>
<?php
}
/**
* Display Pluginize-based content.
*
* @since 1.4.0
*/
function cptui_pluginize_content() {
// translators: Placeholder will hold the name of the author of the plugin.
echo '<h1>' . sprintf( esc_html__( 'More from %s', 'custom-post-type-ui' ), 'WebDevStudios' ) . '</h1>';
echo '<div class="wdspromos-about">';
$ads = cptui_get_ads();
if ( ! empty( $ads ) ) {
foreach ( $ads as $ad ) {
$the_ad = sprintf(
'<img src="%s" alt="%s">',
esc_attr( $ad['image'] ),
esc_attr( $ad['text'] )
);
// Escaping $the_ad breaks the html.
printf(
'<p><a href="%s">%s</a></p>',
esc_url( $ad['url'] ),
$the_ad // phpcs:ignore
);
}
}
echo '</div>';
}
add_action( 'cptui_main_page_extra_notes', 'cptui_pluginize_content', 9 );
/**
* Render our newsletter form for the about page.
*
* @since 1.4.0
*/
function cptui_about_page_newsletter() {
if ( cptui_is_new_install() ) {
return '';
}
?>
<div class='wdsoctosignup'>
<?php
cptui_newsletter_form();
?>
</div>
<?php
return '';
}
add_action( 'cptui_main_page_before_changelog', 'cptui_about_page_newsletter' );
/**
* Marks site as not new at the end of the about/main page.
*
* Can't be done on activation or else cptui_is_new_install() will immediately start
* returning false. So we'll do it at the end of the redirected landing page.
*
* @since 1.5.0
*/
function cptui_mark_not_new() {
if ( cptui_is_new_install() ) {
cptui_set_not_new_install();
}
}
add_action( 'cptui_main_page_extra_notes', 'cptui_mark_not_new', 999 );
<?php
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Content for the Debug Info tab.
* @since 1.2.0
* @internal
*/
function cptui_render_debuginfo_section() {
$debuginfo = new CPTUI_Debug_Info();
echo '<form id="cptui_debug_info" method="post">';
$debuginfo->tab_site_info();
wp_nonce_field( 'cptui_debuginfo_nonce_action', 'cptui_debuginfo_nonce_field' );
if ( ! empty( $_POST ) && isset( $_POST['cptui_debug_info_email'] ) && isset( $_POST['cptui_debuginfo_nonce_field'] ) ) {
if ( wp_verify_nonce( 'cptui_debuginfo_nonce_field', 'cptui_debuginfo_nonce_action' ) ) {
$email_args = [];
$email_args['email'] = sanitize_text_field( $_POST['cptui_debug_info_email'] );
$debuginfo->send_email( $email_args );
}
}
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>';
/**
* Filters the text value to use on the button when sending debug information.
*
* @param string $value Text to use for the button.
*
* @since 1.2.0
*/
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>';
echo '</form>';
/**
* Fires after the display of the site information.
* @since 1.3.0
*/
do_action( 'cptui_after_site_info' );
}
<?php
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Content for the Get Code tab.
* @since 1.2.0
* @internal
*/
function cptui_render_getcode_section() {
?>
<h1><?php esc_html_e( 'Get Post Type and Taxonomy Code', 'custom-post-type-ui' ); ?></h1>
<h2><?php esc_html_e( 'All Custom Post Type UI Post Types', 'custom-post-type-ui' ); ?></h2>
<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>
<?php $cptui_post_types = cptui_get_post_type_data(); ?>
<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>
<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>
<?php
if ( ! empty( $cptui_post_types ) ) {
foreach ( $cptui_post_types as $post_type ) {
?>
<h2 id="<?php echo esc_attr( $post_type['name'] ); ?>">
<?php
$type = ! empty( $post_type['label'] ) ? esc_html( $post_type['label'] ) : esc_html( $post_type['name'] );
printf( esc_html__( '%s Post Type', 'custom-post-type-ui' ), esc_html( $type ) ); ?></h2>
<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>
<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>
<?php
}
}
?>
<h2><?php esc_html_e( 'All Custom Post Type UI Taxonomies', 'custom-post-type-ui' ); ?></h2>
<?php $cptui_taxonomies = cptui_get_taxonomy_data(); ?>
<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>
<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>
<?php
if ( ! empty( $cptui_taxonomies ) ) {
foreach ( $cptui_taxonomies as $taxonomy ) {
?>
<h2 id="<?php echo esc_attr( $taxonomy['name'] ); ?>">
<?php
$tax = ! empty( $taxonomy['label'] ) ? esc_html( $taxonomy['label'] ) : esc_html( $taxonomy['name'] );
printf( esc_html__( '%s Taxonomy', 'custom-post-type-ui' ), esc_html( $tax ) );
?>
</h2>
<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>
<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>
<?php
}
}
?>
<?php
}
<?php
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Display our copy-able code for registered post types.
*
* @param array $cptui_post_types Array of post types to render. Optional.
* @param bool $single Whether or not we are rendering a single post type. Optional. Default false.
*
* @since 1.2.0 Added $single parameter.
* @since 1.0.0
* @since 1.2.0 Added $cptui_post_types parameter.
*/
function cptui_get_post_type_code( $cptui_post_types = [], $single = false ) {
// Whitespace very much matters here, thus why it's all flush against the left side.
if ( ! empty( $cptui_post_types ) ) {
$callback = 'cptui_register_my_cpts';
if ( $single ) {
$key = key( $cptui_post_types );
$callback = 'cptui_register_my_cpts_' . str_replace( '-', '_', esc_html( $cptui_post_types[ $key ]['name'] ) );
}
?>
function <?php echo esc_html( $callback ); ?>() {
<?php
// Space before this line reflects in textarea.
foreach ( $cptui_post_types as $type ) {
echo cptui_get_single_post_type_registery( $type );
}
?>
}
add_action( 'init', '<?php echo esc_html( $callback ); ?>' );
<?php
} else {
esc_html_e( 'No post types to display at this time', 'custom-post-type-ui' );
}
}
/**
* Create output for single post type to be ready for copy/paste from Get Code.
*
* @param array $post_type Post type data to output. Optional.
*
* @since 1.0.0
*/
function cptui_get_single_post_type_registery( $post_type = [] ) {
/* This filter is documented in custom-post-type-ui/custom-post-type-ui.php */
$post_type['map_meta_cap'] = apply_filters( 'cptui_map_meta_cap', 'true', $post_type['name'], $post_type );
/* This filter is documented in custom-post-type-ui/custom-post-type-ui.php */
$user_supports_params = apply_filters( 'cptui_user_supports_params', [], $post_type['name'], $post_type );
if ( is_array( $user_supports_params ) ) {
$post_type['supports'] = array_merge( $post_type['supports'], $user_supports_params );
}
$yarpp = false; // Prevent notices.
if ( ! empty( $post_type['custom_supports'] ) ) {
$custom = explode( ',', $post_type['custom_supports'] );
foreach ( $custom as $part ) {
// We'll handle YARPP separately.
if ( in_array( $part, [ 'YARPP', 'yarpp' ], true ) ) {
$yarpp = true;
continue;
}
$post_type['supports'][] = $part;
}
}
$show_graphql = isset( $post_type['show_in_graphql'] ) ? (bool) $post_type['show_in_graphql'] : false;
$rewrite_withfront = '';
$rewrite = get_disp_boolean( $post_type['rewrite'] );
if ( false !== $rewrite ) {
$rewrite = disp_boolean( $post_type['rewrite'] );
$rewrite_slug = ' "slug" => "' . $post_type['name'] . '",';
if ( ! empty( $post_type['rewrite_slug'] ) ) {
$rewrite_slug = ' "slug" => "' . $post_type['rewrite_slug'] . '",';
}
$withfront = disp_boolean( $post_type['rewrite_withfront'] );
if ( ! empty( $withfront ) ) {
$rewrite_withfront = ' "with_front" => ' . $withfront . ' ';
}
if ( ! empty( $post_type['rewrite_slug'] ) || ! empty( $post_type['rewrite_withfront'] ) ) {
$rewrite_start = '[';
$rewrite_end = ']';
$rewrite = $rewrite_start . $rewrite_slug . $rewrite_withfront . $rewrite_end;
}
} else {
$rewrite = disp_boolean( $post_type['rewrite'] );
}
$has_archive = get_disp_boolean( $post_type['has_archive'] );
if ( false !== $has_archive ) {
$has_archive = disp_boolean( $post_type['has_archive'] );
if ( ! empty( $post_type['has_archive_string'] ) ) {
$has_archive = '"' . $post_type['has_archive_string'] . '"';
}
} else {
$has_archive = disp_boolean( $post_type['has_archive'] );
}
$supports = '';
// Do a little bit of php work to get these into strings.
if ( ! empty( $post_type['supports'] ) && is_array( $post_type['supports'] ) ) {
$supports = '[ "' . implode( '", "', $post_type['supports'] ) . '" ]';
}
if ( in_array( 'none', $post_type['supports'], true ) ) {
$supports = 'false';
}
$taxonomies = '';
if ( ! empty( $post_type['taxonomies'] ) && is_array( $post_type['taxonomies'] ) ) {
$taxonomies = '[ "' . implode( '", "', $post_type['taxonomies'] ) . '" ]';
}
if ( in_array( $post_type['query_var'], [ 'true', 'false', '0', '1' ], true ) ) {
$post_type['query_var'] = disp_boolean( $post_type['query_var'] );
}
if ( ! empty( $post_type['query_var_slug'] ) ) {
$post_type['query_var'] = '"' . $post_type['query_var_slug'] . '"';
}
if ( empty( $post_type['show_in_rest'] ) ) {
$post_type['show_in_rest'] = 'false';
}
$rest_controller_class = ! empty( $post_type['rest_controller_class'] ) ? $post_type['rest_controller_class'] : 'WP_REST_Posts_Controller';
$rest_namespace = ! empty( $post_type['rest_namespace'] ) ? $post_type['rest_namespace'] : 'wp/v2';
$show_in_menu = get_disp_boolean( $post_type['show_in_menu'] );
if ( false !== $show_in_menu ) {
$show_in_menu = disp_boolean( $post_type['show_in_menu'] );
if ( ! empty( $post_type['show_in_menu_string'] ) ) {
$show_in_menu = '"' . $post_type['show_in_menu_string'] . '"';
}
} else {
$show_in_menu = disp_boolean( $post_type['show_in_menu'] );
}
$delete_with_user = 'false';
if ( isset( $post_type['delete_with_user'] ) ) {
$delete_with_user = disp_boolean( $post_type['delete_with_user'] );
}
$can_export = 'true';
if ( isset( $post_type['can_export'] ) ) {
$can_export = disp_boolean( $post_type['can_export'] );
}
$public = isset( $post_type['public'] ) ? disp_boolean( $post_type['public'] ) : 'true';
$show_in_nav_menus = ( ! empty( $post_type['show_in_nav_menus'] ) && false !== get_disp_boolean( $post_type['show_in_nav_menus'] ) ) ? 'true' : 'false';
if ( empty( $post_type['show_in_nav_menus'] ) ) {
$show_in_nav_menus = $public;
}
$capability_type = '"post"';
if ( ! empty( $post_type['capability_type'] ) ) {
$capability_type = '"' . $post_type['capability_type'] . '"';
if ( false !== strpos( $post_type['capability_type'], ',' ) ) {
$caps = array_map( 'trim', explode( ',', $post_type['capability_type'] ) );
if ( count( $caps ) > 2 ) {
$caps = array_slice( $caps, 0, 2 );
}
$capability_type = '[ "' . $caps[0] . '", "' . $caps[1] . '" ]';
}
}
$post_type['description'] = addslashes( $post_type['description'] );
$my_theme = wp_get_theme();
$textdomain = $my_theme->get( 'TextDomain' );
if ( empty( $textdomain ) ) {
$textdomain = 'custom-post-type-ui';
}
?>
/**
* Post Type: <?php echo $post_type['label']; ?>.
*/
$labels = [
"name" => esc_html__( "<?php echo $post_type['label']; ?>", "<?php echo $textdomain; ?>" ),
"singular_name" => esc_html__( "<?php echo $post_type['singular_label']; ?>", "<?php echo $textdomain; ?>" ),
<?php
foreach ( $post_type['labels'] as $key => $label ) {
if ( ! empty( $label ) ) {
if ( 'parent' === $key && ! array_key_exists( 'parent_item_colon', $post_type['labels'] ) ) {
// Fix for incorrect label key. See #439.
echo "\t\t" . '"' . 'parent_item_colon' . '" => esc_html__( "' . $label . '", "' . $textdomain . '" ),' . "\n";
} else {
echo "\t\t" . '"' . $key . '" => esc_html__( "' . $label . '", "' . $textdomain . '" ),' . "\n";
}
}
}
?>
];
$args = [
"label" => esc_html__( "<?php echo $post_type['label']; ?>", "<?php echo $textdomain; ?>" ),
"labels" => $labels,
"description" => "<?php echo $post_type['description']; ?>",
"public" => <?php echo disp_boolean( $post_type['public'] ); ?>,
"publicly_queryable" => <?php echo disp_boolean( $post_type['publicly_queryable'] ); ?>,
"show_ui" => <?php echo disp_boolean( $post_type['show_ui'] ); ?>,
"show_in_rest" => <?php echo disp_boolean( $post_type['show_in_rest'] ); ?>,
"rest_base" => "<?php echo $post_type['rest_base']; ?>",
"rest_controller_class" => "<?php echo $rest_controller_class; ?>",
"rest_namespace" => "<?php echo $rest_namespace; ?>",
"has_archive" => <?php echo $has_archive; ?>,
"show_in_menu" => <?php echo $show_in_menu; ?>,
"show_in_nav_menus" => <?php echo $show_in_nav_menus; ?>,
"delete_with_user" => <?php echo $delete_with_user; ?>,
"exclude_from_search" => <?php echo disp_boolean( $post_type['exclude_from_search'] ); ?>,
"capability_type" => <?php echo $capability_type; ?>,
"map_meta_cap" => <?php echo disp_boolean( $post_type['map_meta_cap'] ); ?>,
"hierarchical" => <?php echo disp_boolean( $post_type['hierarchical'] ); ?>,
"can_export" => <?php echo $can_export; ?>,
"rewrite" => <?php echo $rewrite; ?>,
"query_var" => <?php echo $post_type['query_var']; ?>,
<?php if ( ! empty( $post_type['menu_position'] ) ) { ?>
"menu_position" => <?php echo $post_type['menu_position']; ?>,
<?php } ?>
<?php if ( ! empty( $post_type['menu_icon'] ) ) { ?>
"menu_icon" => "<?php echo $post_type['menu_icon']; ?>",
<?php } ?>
<?php if ( ! empty( $post_type['register_meta_box_cb'] ) ) { ?>
"register_meta_box_cb" => "<?php echo $post_type['register_meta_box_cb']; ?>",
<?php } ?>
<?php if ( ! empty( $supports ) ) { ?>
"supports" => <?php echo $supports; ?>,
<?php } ?>
<?php if ( ! empty( $taxonomies ) ) { ?>
"taxonomies" => <?php echo $taxonomies; ?>,
<?php } ?>
<?php if ( true === $yarpp ) { ?>
"yarpp_support" => <?php echo disp_boolean( $yarpp ); ?>,
<?php } ?>
<?php if ( $show_graphql ) : ?>
"show_in_graphql" => <?php echo disp_boolean( $post_type['show_in_graphql'] ); ?>,
"graphql_single_name" => "<?php echo esc_html( $post_type['graphql_single_name'] ); ?>",
"graphql_plural_name" => "<?php echo esc_html( $post_type['graphql_plural_name'] ); ?>",
<?php else: ?>
"show_in_graphql" => <?php echo disp_boolean( false ); ?>,
<?php endif; ?>
];
register_post_type( "<?php echo esc_html( $post_type['name'] ); ?>", $args );
<?php
}
<?php
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Display our copy-able code for registered taxonomies.
*
* @param array $cptui_taxonomies Array of taxonomies to render. Optional.
* @param bool $single Whether or not we are rendering a single taxonomy. Optional. Default false.
*
* @since 1.2.0 Added $single parameter.
* @since 1.0.0
* @since 1.2.0 Added $cptui_taxonomies parameter.
*/
function cptui_get_taxonomy_code( $cptui_taxonomies = [], $single = false ) {
if ( ! empty( $cptui_taxonomies ) ) {
$callback = 'cptui_register_my_taxes';
if ( $single ) {
$key = key( $cptui_taxonomies );
$callback = 'cptui_register_my_taxes_' . str_replace( '-', '_', esc_html( $cptui_taxonomies[ $key ]['name'] ) );
}
ob_start();
?>
function <?php echo esc_html( $callback ); ?>() {
<?php
foreach ( $cptui_taxonomies as $tax ) {
echo cptui_get_single_taxonomy_registery( $tax );
}
?>
}
add_action( 'init', '<?php echo esc_html( $callback ); ?>' );
<?php
} else {
esc_html_e( 'No taxonomies to display at this time', 'custom-post-type-ui' );
}
echo trim( ob_get_clean() );
}
/**
* Create output for single taxonomy to be ready for copy/paste from Get Code.
*
* @param array $taxonomy Taxonomy data to output. Optional.
*
* @since 1.0.0
*/
function cptui_get_single_taxonomy_registery( $taxonomy = [] ) {
$post_types = "''";
if ( is_array( $taxonomy['object_types'] ) ) {
$post_types = '[ "' . implode( '", "', $taxonomy['object_types'] ) . '" ]';
}
if ( false !== get_disp_boolean( $taxonomy['rewrite'] ) ) {
$rewrite = disp_boolean( $taxonomy['rewrite'] );
$rewrite_slug = ' \'slug\' => \'' . $taxonomy['name'] . '\',';
if ( ! empty( $taxonomy['rewrite_slug'] ) ) {
$rewrite_slug = ' \'slug\' => \'' . $taxonomy['rewrite_slug'] . '\',';
}
$rewrite_withfront = '';
$withfront = disp_boolean( $taxonomy['rewrite_withfront'] );
if ( ! empty( $withfront ) ) {
$rewrite_withfront = ' \'with_front\' => ' . $withfront . ', ';
}
$hierarchical = ! empty( $taxonomy['rewrite_hierarchical'] ) ? disp_boolean( $taxonomy['rewrite_hierarchical'] ) : '';
$rewrite_hierarchcial = '';
if ( ! empty( $hierarchical ) ) {
$rewrite_hierarchcial = ' \'hierarchical\' => ' . $hierarchical . ', ';
}
if ( ! empty( $taxonomy['rewrite_slug'] ) || false !== disp_boolean( $taxonomy['rewrite_withfront'] ) ) {
$rewrite_start = '[';
$rewrite_end = ']';
$rewrite = $rewrite_start . $rewrite_slug . $rewrite_withfront . $rewrite_hierarchcial . $rewrite_end;
}
} else {
$rewrite = disp_boolean( $taxonomy['rewrite'] );
}
$public = isset( $taxonomy['public'] ) ? disp_boolean( $taxonomy['public'] ) : 'true';
$publicly_queryable = isset( $taxonomy['publicly_queryable'] ) ? disp_boolean( $taxonomy['publicly_queryable'] ) : disp_boolean( $taxonomy['public'] );
$show_in_quick_edit = isset( $taxonomy['show_in_quick_edit'] ) ? disp_boolean( $taxonomy['show_in_quick_edit'] ) : disp_boolean( $taxonomy['show_ui'] );
$show_tagcloud = isset( $taxonomy['show_tagcloud'] ) ? disp_boolean( $taxonomy['show_tagcloud'] ) : disp_boolean( $taxonomy['show_ui'] );
$show_in_menu = ( ! empty( $taxonomy['show_in_menu'] ) && false !== get_disp_boolean( $taxonomy['show_in_menu'] ) ) ? 'true' : 'false';
if ( empty( $taxonomy['show_in_menu'] ) ) {
$show_in_menu = disp_boolean( $taxonomy['show_ui'] );
}
$show_in_nav_menus = ( ! empty( $taxonomy['show_in_nav_menus'] ) && false !== get_disp_boolean( $taxonomy['show_in_nav_menus'] ) ) ? 'true' : 'false';
if ( empty( $taxonomy['show_in_nav_menus'] ) ) {
$show_in_nav_menus = $public;
}
$show_in_rest = ( ! empty( $taxonomy['show_in_rest'] ) && false !== get_disp_boolean( $taxonomy['show_in_rest'] ) ) ? 'true' : 'false';
$rest_base = ! empty( $taxonomy['rest_base'] ) ? $taxonomy['rest_base'] : $taxonomy['name'];
$rest_controller_class = ! empty( $taxonomy['rest_controller_class'] ) ? $taxonomy['rest_controller_class'] : 'WP_REST_Terms_Controller';
$rest_namespace = ! empty( $taxonomy['rest_namespace'] ) ? $taxonomy['rest_namespace'] : 'wp/v2';
$sort = ( ! empty( $taxonomy['sort'] ) && false !== get_disp_boolean( $taxonomy['sort'] ) ) ? 'true' : 'false';
if ( ! empty( $taxonomy['meta_box_cb'] ) ) {
$meta_box_cb = ( false !== get_disp_boolean( $taxonomy['meta_box_cb'] ) ) ? '"' . $taxonomy['meta_box_cb'] . '"' : 'false';
}
$default_term = '';
if ( ! empty( $taxonomy['default_term'] ) ) {
$term_parts = explode( ',', $taxonomy['default_term'] );
$default_term_start = '[';
$default_term_end = ']';
if ( ! empty( $term_parts[0] ) ) {
$default_term .= "'name' => '" . trim( $term_parts[0] ) . "'";
}
if ( ! empty( $term_parts[1] ) ) {
$default_term .= ", 'slug' => '" . trim( $term_parts[1] ) . "'";
}
if ( ! empty( $term_parts[2] ) ) {
$default_term .= ", 'description' => '" . trim( $term_parts[2] ) . "'";
}
$default_term = $default_term_start . $default_term . $default_term_end;
}
$my_theme = wp_get_theme();
$textdomain = $my_theme->get( 'TextDomain' );
if ( empty( $textdomain ) ) {
$textdomain = 'custom-post-type-ui';
}
?>
/**
* Taxonomy: <?php echo esc_html( $taxonomy['label'] ); ?>.
*/
$labels = [
"name" => esc_html__( "<?php echo esc_html( $taxonomy['label'] ); ?>", "<?php echo esc_html( $textdomain ); ?>" ),
"singular_name" => esc_html__( "<?php echo esc_html( $taxonomy['singular_label'] ); ?>", "<?php echo esc_html( $textdomain ); ?>" ),
<?php
foreach ( $taxonomy['labels'] as $key => $label ) {
if ( ! empty( $label ) ) {
echo "\t\t" . '"' . esc_html( $key ) . '" => esc_html__( "' . esc_html( $label ) . '", "' . esc_html( $textdomain ) . '" ),' . "\n";
}
}
?>
];
<?php
$show_graphql = isset( $taxonomy['show_in_graphql'] ) ? (bool) $taxonomy['show_in_graphql'] : false;
?>
$args = [
"label" => esc_html__( "<?php echo $taxonomy['label']; ?>", "<?php echo $textdomain; ?>" ),
"labels" => $labels,
"public" => <?php echo $public; ?>,
"publicly_queryable" => <?php echo $publicly_queryable; ?>,
"hierarchical" => <?php echo $taxonomy['hierarchical']; ?>,
"show_ui" => <?php echo disp_boolean( $taxonomy['show_ui'] ); ?>,
"show_in_menu" => <?php echo $show_in_menu; ?>,
"show_in_nav_menus" => <?php echo $show_in_nav_menus; ?>,
"query_var" => <?php echo disp_boolean( $taxonomy['query_var'] ); ?>,
"rewrite" => <?php echo $rewrite; ?>,
"show_admin_column" => <?php echo $taxonomy['show_admin_column']; ?>,
"show_in_rest" => <?php echo $show_in_rest; ?>,
"show_tagcloud" => <?php echo $show_tagcloud; ?>,
"rest_base" => "<?php echo $rest_base; ?>",
"rest_controller_class" => "<?php echo $rest_controller_class; ?>",
"rest_namespace" => "<?php echo $rest_namespace; ?>",
"show_in_quick_edit" => <?php echo $show_in_quick_edit; ?>,
"sort" => <?php echo $sort; ?>,
<?php if ( $show_graphql ) : ?>
"show_in_graphql" => <?php echo disp_boolean( $taxonomy['show_in_graphql'] ); ?>,
"graphql_single_name" => "<?php echo esc_html( $taxonomy['graphql_single_name'] ); ?>",
"graphql_plural_name" => "<?php echo esc_html( $taxonomy['graphql_plural_name'] ); ?>",
<?php else: ?>
"show_in_graphql" => <?php echo disp_boolean( false ); ?>,
<?php endif; ?>
<?php if ( ! empty( $meta_box_cb ) ) { ?>
"meta_box_cb" => <?php echo $meta_box_cb; ?>,
<?php } ?>
<?php if ( ! empty( $default_term ) ) { ?>
"default_term" => <?php echo $default_term; ?>,
<?php } ?>
];
register_taxonomy( "<?php echo esc_html( $taxonomy['name'] ); ?>", <?php echo $post_types; ?>, $args );
<?php
}
<?php
/**
* Custom Post Type UI WP-CLI.
*
* @package CPTUI
* @subpackage WP-CLI
* @author WebDevStudios
* @since 1.6.0
* @license GPL-2.0+
*/
// phpcs:disable WebDevStudios.All.RequireAuthor
/**
* Imports and exports Custom Post Type UI setting data.
*/
class CPTUI_Import_JSON extends WP_CLI_Command {
public $args;
public $assoc_args;
public $type;
public $data = [];
/**
* Imports and parses JSON into CPTUI settings.
*
* ## Options
*
* [--type=<type>]
* : What type of import this is. Available options are `post_type` and `taxonomy`.
*
* [--data-path=<path>]
* : The server path to the file holding JSON data to import. Relative to PWD.
*/
public function import( $args, $assoc_args ) {
$this->args = $args;
$this->assoc_args = $assoc_args;
if ( ! isset( $this->assoc_args['type'] ) ) {
WP_CLI::error( esc_html__( 'Please provide whether you are importing post types or taxonomies', 'custom-post-type-ui' ) );
}
if ( ! isset( $this->assoc_args['data-path'] ) ) {
WP_CLI::error( esc_html__( 'Please provide a path to the file holding your CPTUI JSON data.', 'custom-post-type-ui' ) );
}
$this->type = $assoc_args['type'];
$json = file_get_contents( $this->assoc_args['data-path'] );
if ( empty( $json ) ) {
WP_CLI::error( esc_html__( 'No JSON data found', 'custom-post-type-ui' ) );
}
if ( 'post_type' === $this->type ) {
$this->data['cptui_post_import'] = json_decode( stripslashes_deep( trim( $json ) ), true );
}
if ( 'taxonomy' === $this->type ) {
$this->data['cptui_tax_import'] = json_decode( stripslashes_deep( trim( $json ) ), true );
}
$result = cptui_import_types_taxes_settings( $this->data );
if ( false === $result || 'import_fail' === $result ) {
WP_CLI::error( sprintf( esc_html__( 'An error on import occurred', 'custom-post-type-ui' ) ) );
} else {
WP_CLI::success(
sprintf(
/* translators: Placeholders are just for HTML markup that doesn't need translated */
esc_html__( 'Imported %s successfully', 'custom-post-type-ui' ),
$this->type
)
);
}
}
/**
* Export CPTUI settings to file.
*
* ## Options
*
* [--type=<type>]
* : Which settings to export. Available options are `post_type` and `taxonomy`.
*
* [--dest-path=<path>]
* : The path and file to export to. Relative to PWD.
*/
public function export( $args, $assoc_args ) {
$this->args = $args;
$this->assoc_args = $assoc_args;
if ( ! isset( $this->assoc_args['type'] ) ) {
WP_CLI::error( esc_html__( 'Please provide whether you are exporting your post types or taxonomies', 'custom-post-type-ui' ) );
}
if ( ! isset( $this->assoc_args['dest-path'] ) ) {
WP_CLI::error( esc_html__( 'Please provide a path to export your data to.', 'custom-post-type-ui' ) );
}
$this->type = $assoc_args['type'];
if ( 'post_type' === $this->type ) {
$content = cptui_get_post_type_data();
}
if ( 'taxonomy' === $this->type ) {
$content = cptui_get_taxonomy_data();
}
$content = wp_json_encode( $content );
$result = file_put_contents( $this->assoc_args['dest-path'], $content );
if ( false === $result ) {
WP_CLI::error( esc_html__( 'Error saving data.', 'custom-post-type-ui' ) );
}
WP_CLI::success( esc_html__( 'Successfully saved data to file.', 'custom-post-type-ui' ) );
}
}
WP_CLI::add_command( 'cptui', 'CPTUI_Import_JSON' );
=== Custom Post Type UI ===
Contributors: webdevstudios, pluginize, tw2113, williamsba1
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3084056
Tags: custom post types, post type, taxonomy, content types, CPT, CMS, post, types, custom
Requires at least: 5.9
Tested up to: 6.2.2
Stable tag: 1.13.7
License: GPL-2.0+
Requires PHP: 5.6
Admin UI for creating custom content types like post types and taxonomies
== Description ==
Custom Post Type UI provides an easy to use interface for registering and managing custom post types and taxonomies for your website.
= Custom Post Type UI Extended =
CPTUI helps create custom content types, but displaying that content can be a whole new challenge. We created [Custom Post Type UI Extended](https://pluginize.com/product/custom-post-type-ui-extended/?utm_source=cptui-desription&utm_medium=text&utm_campaign=wporg) to help with displaying your crafted content. [View our Layouts page](https://pluginize.com/cpt-ui-extended-features/?utm_source=cptui-description-examples&utm_medium=text&utm_campaign=wporg) to see available layout examples with Custom Post Type UI Extended.
Beginning with version 1.7.0, Custom Post Type UI Extended has properly moved in to the Block editor experience and is working to get all the layouts available in the new "Custom Post Type UI Block". It's now even easier to start showing your content with the existing and future layouts available with Custom Post Type UI Extended.
[Pluginize](https://pluginize.com/?utm_source=cptui&utm_medium=text&utm_campaign=wporg) was launched in 2016 by [WebDevStudios](https://webdevstudios.com/) to promote, support, and house all of their [WordPress products](https://pluginize.com/shop/?utm_source=cptui-&utm_medium=text&utm_campaign=wporg). Pluginize is not only [creating new products for WordPress, like CPTUI Extended](https://pluginize.com/product/custom-post-type-ui-extended/?utm_source=cptui&utm_medium=text&utm_campaign=wporg), but also provides ongoing support and development for WordPress community favorites like [CMB2](https://wordpress.org/plugins/cmb2/) and more.
= Plugin development =
Custom Post Type UI development is managed on GitHub, with official releases published on WordPress.org. The GitHub repo can be found at [https://github.com/WebDevStudios/custom-post-type-ui](https://github.com/WebDevStudios/custom-post-type-ui). Please use the WordPress.org support tab for potential bugs, issues, or enhancement ideas.
== Screenshots ==
1. Add new post type screen and tab.
2. Add new taxonomy screen and tab.
3. Registered post types and taxonomies from CPTUI
4. Tools screen.
5. Help/support screen.
== Changelog ==
= 1.13.7 - 2023-07-11 =
* Fixed: "themes" marked as reserved taxonomy slug. Causes issues with featured image metabox.
* Fixed: PHP notice around `sort` parameter.
= 1.13.6 - 2023-05-30 =
* Fixed: Prevent PHP errors for dynamic WordPress hooks.
* Fixed: Prevent PHP errors from array_key_exist() checks on non arrays.
* Updated: Removed Maintainn graphic and added WP Search with Algolia Pro graphic.
* Updated: Fixed a lot of text escaping for translation-ready content.
= 1.13.5 - 2023-03-27 =
* Fixed: Security issue in CPTUI Debug Info screen.
* Fixed: Added `empty()` check for `can_export` parameters.
* Updated: Changed textdomain loading from `plugins_loaded` to `init`.
= 1.13.4 - 2022-12-16 =
* Fixed: Character encoding issue on CPTUI setting save in conjunction with PHP8 compatibility.
= 1.13.3 - 2022-12-15 =
* Fixed: Multiple PHP8 compatibility notices and warnings.
* Fixed: "Invalid argument for foreach" based notices around labels.
* Updated: Added taxonomy PHP global sanitization for 3rd party parameters.
= 1.13.2 - 2022-11-29 =
* Fixed: Removed forcing of underscores in place of dashes for taxonomy slugs. Yay!
* Updated: tested up to WP 6.1.1
* Updated: Documentation links in wordpress.org FAQ section.
= 1.13.1 - 2022-09-08 =
* Fixed: Various issues caused by a misplaced output for `ob_get_clean()` outside of function.
= 1.13.0 - 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.
= 1.12.1 - 2022-05-16 =
* Fixed: JSON decoding issues around WP-CLI import.
= 1.12.0 - 2022-05-09 =
* Added: Tested on WordPress 6.0.
* Added: Auto-check, but not force, "page-attributes" when setting a post type as hierarchical.
* Added: "rest_namespace" parameters for both post types and taxonomies.
* Added: "register_meta_box_cb" parameter for post types.
* Fixed: undefined index notices for "can_export".
* Updated: list of reserved taxonomy names with more that are considered reserved.
* Updated: readme descriptions and screenshots.
= 1.11.2 - 2022-03-21 =
* Fixed: Unintended reuse of `$delete_with_user` variable and `can_export` option. Props @bogutskyy
* Fixed: PHP notices around `sort` array index.
= 1.11.1 - 2022-03-18 =
* Fixed: Errors and warnings around array_key_exists() and bool values
= 1.11.0 - 2022-03-17 =
* Added: "sort" argument for taxonomies.
* Added: "can export" argument for post types
* Added: New taxonomy labels from WordPress 5.9
* Added: Custom option to set "Enter title here" value for post types.
* Added: Notes around "exclude from search" argument for post types and taxonomy term archives.
* Added: Notes around taxonomy "hierarchical" option regarding category vs tag behavior.
* Updated: Reserved post type slugs from recent WordPress releases.
* Fixed: PHP warnings around foreach loops in cptui_published_post_format_fix()
== Upgrade Notice ==
= 1.13.7 - 2023-07-11 =
* Fixed: "themes" marked as reserved taxonomy slug. Causes issues with featured image metabox.
* Fixed: PHP notice around `sort` parameter.
= 1.13.6 - 2023-05-30 =
* Fixed: Prevent PHP errors for dynamic WordPress hooks.
* Fixed: Prevent PHP errors from array_key_exist() checks on non arrays.
* Updated: Removed Maintainn graphic and added WP Search with Algolia Pro graphic.
* Updated: Fixed a lot of text escaping for translation-ready content.
= 1.13.5 - 2023-03-27 =
* Fixed: Security issue in CPTUI Debug Info screen.
* Fixed: Added `empty()` check for `can_export` parameters.
* Updated: Changed textdomain loading from `plugins_loaded` to `init`.
= 1.13.4 - 2022-12-16 =
* Fixed: Character encoding issue on CPTUI setting save in conjunction with PHP8 compatibility.
= 1.13.3 - 2022-12-15 =
* Fixed: Multiple PHP8 compatibility notices and warnings.
* Fixed: "Invalid argument for foreach" based notices around labels.
* Updated: Added taxonomy PHP global sanitization for 3rd party parameters.
= 1.13.2 - 2022-11-29 =
* Fixed: Removed forcing of underscores in place of dashes for taxonomy slugs. Yay!
* Updated: tested up to WP 6.1.1
* Updated: Documentation links in wordpress.org FAQ section.
= 1.13.1 - 2022-09-08 =
* Fixed: Various issues caused by a misplaced output for `ob_get_clean()` outside of function.
= 1.13.0 - 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.
= 1.12.1 - 2022-05-16 =
* Fixed: JSON decoding issues around WP-CLI import.
= 1.12.0 - 2022-05-09 =
* Added: Tested on WordPress 6.0.
* Added: Auto-check, but not force, "page-attributes" when setting a post type as hierarchical.
* Added: "rest_namespace" parameters for both post types and taxonomies.
* Added: "register_meta_box_cb" parameter for post types.
* Fixed: undefined index notices for "can_export".
* Updated: list of reserved taxonomy names with more that are considered reserved.
* Updated: readme descriptions and screenshots.
= 1.11.2 - 2022-03-21 =
* Fixed: Unintended reuse of `$delete_with_user` variable and `can_export` option. Props @bogutskyy
* Fixed: PHP notices around `sort` array index.
= 1.11.1 - 2022-03-18 =
* Fixed: Errors and warnings around array_key_exists() and bool values
= 1.11.0 - 2022-03-17 =
* Added: "sort" argument for taxonomies.
* Added: "can export" argument for post types
* Added: New taxonomy labels from WordPress 5.9
* Added: Custom option to set "Enter title here" value for post types.
* Added: Notes around "exclude from search" argument for post types and taxonomy term archives.
* Added: Notes around taxonomy "hierarchical" option regarding category vs tag behavior.
* Updated: Reserved post type slugs from recent WordPress releases.
* Fixed: PHP warnings around foreach loops in cptui_published_post_format_fix()
== Installation ==
= Admin Installer via search =
1. Visit the Add New plugin screen and search for "custom post type ui".
2. Click the "Install Now" button.
3. Activate the plugin.
4. Navigate to the "CPTUI" Menu.
= Admin Installer via zip =
1. Visit the Add New plugin screen and click the "Upload Plugin" button.
2. Click the "Browse..." button and select zip file from your computer.
3. Click "Install Now" button.
4. Once done uploading, activate Custom Post Type UI.
= Manual =
1. Upload the Custom Post Type UI folder to the plugins directory in your WordPress installation.
2. Activate the plugin.
3. Navigate to the "CPTUI" Menu.
That's it! Now you can easily start creating custom post types and taxonomies in WordPress.
== Frequently Asked Questions ==
#### User documentation
Please see https://docs.pluginize.com/tutorials/custom-post-type-ui/