From 24f9970598f19473a04ae64cfe63ef89481833f2 Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Fri, 14 Aug 2020 09:01:35 -0500 Subject: [PATCH] merge in a small but still good 1.8.0 --- CHANGELOG.md | 56 ++++++- css/cptui.css | 2 +- custom-post-type-ui.php | 20 ++- inc/about.php | 12 +- inc/taxonomies.php | 14 ++ inc/tools.php | 21 +++ js/cptui.js | 25 +-- js/cptui.min.js | 2 +- readme.txt | 345 ++++++++++++++++------------------------ 9 files changed, 256 insertions(+), 241 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c6b957e..dc42ba6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,57 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Not documented. +## [1.6.2] - 2019-05-20 +### Added +- "themes" is now a reserved post type slug due to conflicts with WordPress internally. + +### Fixed +- Updated wording around "Supports" section of post type settings screen. + +## [1.6.1] - 2018-12-03 +### Fixed +- Missed quote for "publicly_queryable" in taxonomy "get code" output. +- Adjusted handling of capitalization on the word "false" when being used to disable a taxonomy metabox via the "metabox callback" setting. The word "false" needs to be all lowercase to disable. + +### Updated +- Added note about ability to pass "false" for the "metabox callback" setting to disable the metabox. +- Fall back to "custom-post-type-ui" textdomain in "get code" output if theme does not have their own. +- Make "Show In Rest" setting default to true taxonomies for sake of easier Gutenberg integration in the future. 1.6.0 had just post types doing this. + +## [1.6.0] - 2018-10-22 +### Added +- Support for `meta_box_cb` parameter for `register_taxonomy` and taxonomies. +- Dynamically warn about existing slugs. +- "delete_with_user" support for post types. +- Filters for post type and taxonomy data right before saving of final data. +- `cptui_get_taxonomy_exists` function to check if a provided taxonomy is registered. +- Required PHP version to readme.txt +- Filter on taxonomies to be listed as available for association with a post type. +- Warning indicators to our "Slug changed" and "Slug exists" warnings for post types and taxonomies. +- Support for "publicly_queryable" parameter for taxonomies. +- Support for "rest_controller_class" parameters for both post types and taxonomies. +- Some initial WP-CLI support for importing and exporting CPTUI settings. +- `name_admin_bar` support in post type labels. +- Handling of array versions for "capability_type" field. + +### Updated +- Bump minimum WordPress version to 4.7. +- Pass the object_type array to `cptui_pre_register_taxonomy` filter as extra parameter. +- Adjusted preserved label handling to aid with plugin performance. Props alex-solovyev +- Utilize `wp_doing_ajax()` function for our AJAX checks. +- Clarify what is exported with the Post Types and Taxonomies spots for the Tools section. +- Clarify that the listed post types to associate to a CPTUI taxonomy are public post types by default. +- Make "Show In Rest" setting default to true for sake of easier Gutenberg integration in the future. + +### Fixed +- Only register archive slug if has_archive is set to true. +- Error occurred when attempting to unset post types while editing a taxonomy. +- Prevent errors from non-existant callback functions during post type or taxonomy processing. +- Incorrect use of reserved taxonomy slugs function in a check for reserved post types. +- Make sure "No post type selected" alert trigger from both buttons on the taxonomy settings edit screen. +- Add our stylesheet only on our CPTUI pages. Fixes responsive bug on post editor screen. +- Removed duplicate "label" in taxonomy "get code" section. + ## [1.5.8] - 2018-04-16 ### Fixed - Corrected issue with `Get Code` area regarding post types and `show in menu` field values. @@ -386,7 +437,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [Gary Jones]: https://github.com/GaryJones -[Unreleased]: https://github.com/WebDevStudios/custom-post-type-ui/compare/1.5.8...HEAD +[Unreleased]: https://github.com/WebDevStudios/custom-post-type-ui/compare/1.6.2...HEAD +[1.6.2]: https://github.com/WebDevStudios/custom-post-type-ui/compare/1.6.1...1.6.2 +[1.6.1]: https://github.com/WebDevStudios/custom-post-type-ui/compare/1.6.0...1.6.1 +[1.6.0]: https://github.com/WebDevStudios/custom-post-type-ui/compare/1.5.8...1.6.0 [1.5.8]: https://github.com/WebDevStudios/custom-post-type-ui/compare/1.5.7...1.5.8 [1.5.7]: https://github.com/WebDevStudios/custom-post-type-ui/compare/1.5.6...1.5.7 [1.5.6]: https://github.com/WebDevStudios/custom-post-type-ui/compare/1.5.5...1.5.6 diff --git a/css/cptui.css b/css/cptui.css index fb14b82c..5a822d5e 100644 --- a/css/cptui.css +++ b/css/cptui.css @@ -210,7 +210,7 @@ .about-wrap .cptui-about-text { margin-bottom: 1em !important; - margin-right: 0px; + margin-right: 0; max-width: calc(100% - 173px); } diff --git a/custom-post-type-ui.php b/custom-post-type-ui.php index b12de347..e7566a45 100644 --- a/custom-post-type-ui.php +++ b/custom-post-type-ui.php @@ -16,7 +16,7 @@ * Plugin URI: https://github.com/WebDevStudios/custom-post-type-ui/ * Description: Admin panel for creating custom post types and custom taxonomies in WordPress * Author: WebDevStudios - * Version: 1.7.5 + * Version: 1.8.0 * Author URI: https://webdevstudios.com/ * Text Domain: custom-post-type-ui * Domain Path: /languages @@ -30,8 +30,8 @@ exit; } -define( 'CPT_VERSION', '1.7.5' ); // Left for legacy purposes. -define( 'CPTUI_VERSION', '1.7.5' ); +define( 'CPT_VERSION', '1.8.0' ); // Left for legacy purposes. +define( 'CPTUI_VERSION', '1.8.0' ); define( 'CPTUI_WP_VERSION', get_bloginfo( 'version' ) ); /** @@ -677,6 +677,19 @@ function cptui_register_single_taxonomy( $taxonomy = [] ) { if ( ! empty( $taxonomy['meta_box_cb'] ) ) { $meta_box_cb = ( false !== get_disp_boolean( $taxonomy['meta_box_cb'] ) ) ? $taxonomy['meta_box_cb'] : false; } + $default_term = null; + if ( ! empty( $taxonomy['default_term'] ) ) { + $term_parts = explode(',', $taxonomy['default_term'] ); + 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] ); + } + } $args = [ 'labels' => $labels, @@ -696,6 +709,7 @@ function cptui_register_single_taxonomy( $taxonomy = [] ) { 'rest_controller_class' => $rest_controller_class, 'show_in_quick_edit' => $show_in_quick_edit, 'meta_box_cb' => $meta_box_cb, + 'default_term' => $default_term, ]; $object_type = ! empty( $taxonomy['object_types'] ) ? $taxonomy['object_types'] : ''; diff --git a/inc/about.php b/inc/about.php index a1adaf20..c3eef666 100644 --- a/inc/about.php +++ b/inc/about.php @@ -85,16 +85,12 @@ function cptui_settings() {
-

-

-
-
-

-

+

+

-

-

+

+

diff --git a/inc/taxonomies.php b/inc/taxonomies.php index 2a2de5f2..17efe297 100644 --- a/inc/taxonomies.php +++ b/inc/taxonomies.php @@ -1055,6 +1055,14 @@ function cptui_manage_taxonomies() { 'labeltext' => esc_html__( 'Metabox callback', 'custom-post-type-ui' ), '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' ), ] ); + + echo $ui->get_text_input( [ + 'namearray' => 'cpt_custom_tax', + 'name' => 'default_term', + 'textvalue' => isset( $current['default_term'] ) ? esc_attr( $current['default_term'] ) : '', + 'labeltext' => esc_html__( 'Default Term', 'custom-post-type-ui' ), + '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' ), + ] ); ?> @@ -1278,6 +1286,7 @@ function cptui_delete_taxonomy( $data = [] ) { $success = update_option( 'cptui_taxonomies', $taxonomies ); } } + delete_option( "default_term_{$data['cpt_custom_tax']['name']}" ); /** * Fires after a taxonomy is deleted from our saved options. @@ -1323,6 +1332,9 @@ function cptui_update_taxonomy( $data = [] ) { return cptui_admin_notices( 'error', '', false, esc_html__( 'Please provide a taxonomy name', 'custom-post-type-ui' ) ); } + // Maybe a little harsh, but we shouldn't be saving THAT frequently. + delete_option( "default_term_{$data['cpt_custom_tax']['name']}" ); + if ( empty( $data['cpt_post_types'] ) ) { add_filter( 'cptui_custom_error_message', 'cptui_empty_cpt_on_taxonomy' ); return 'error'; @@ -1397,6 +1409,7 @@ function cptui_update_taxonomy( $data = [] ) { $rest_base = trim( $data['cpt_custom_tax']['rest_base'] ); $rest_controller_class = trim( $data['cpt_custom_tax']['rest_controller_class'] ); $show_quickpanel_bulk = ! empty( $data['cpt_custom_tax']['show_in_quick_edit'] ) ? disp_boolean( $data['cpt_custom_tax']['show_in_quick_edit'] ) : ''; + $default_term = trim( $data['cpt_custom_tax']['default_term'] ); $meta_box_cb = trim( $data['cpt_custom_tax']['meta_box_cb'] ); // We may or may not need to force a boolean false keyword. @@ -1429,6 +1442,7 @@ function cptui_update_taxonomy( $data = [] ) { 'rest_controller_class' => $rest_controller_class, 'labels' => $data['cpt_tax_labels'], 'meta_box_cb' => $meta_box_cb, + 'default_term' => $default_term, ]; $taxonomies[ $data['cpt_custom_tax']['name'] ]['object_types'] = $data['cpt_post_types']; diff --git a/inc/tools.php b/inc/tools.php index bdb5b174..2f8bf7cf 100644 --- a/inc/tools.php +++ b/inc/tools.php @@ -285,6 +285,24 @@ function cptui_get_single_taxonomy_registery( $taxonomy = [] ) { $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 ) ) { @@ -327,6 +345,9 @@ function cptui_get_single_taxonomy_registery( $taxonomy = [] ) { "meta_box_cb" => , + + "default_term" => , + ]; register_taxonomy( "", , $args ); '+msg+"").appendTo("#poststuff").dialog({dialogClass:"wp-dialog",modal:!0,autoOpen:!0,buttons:{OK:function(){$(e.target).closest("form");$(e.target).unbind("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){return s=s.replace(/[^a-z0-9\s]/gi,"_")}(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'+cptui_tax_data.no_associated_type+"").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))}))})}(jQuery); \ No newline at end of file +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();$("#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);$('
'+msg+"
").appendTo("#poststuff").dialog({dialogClass:"wp-dialog",modal:!0,autoOpen:!0,buttons:{OK:function(){$(e.target).closest("form");$(e.target).unbind("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'+cptui_tax_data.no_associated_type+"").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))}))})}(jQuery); \ No newline at end of file diff --git a/readme.txt b/readme.txt index 4d074df1..5e152df3 100644 --- a/readme.txt +++ b/readme.txt @@ -1,208 +1,137 @@ -=== Custom Post Type UI === -Contributors: webdevstudios, pluginize, tw2113, vegasgeek, modemlooper, williamsba1 -Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3084056 -Tags: custom post types, CPT, CMS, post, types, post type, taxonomy, tax, custom, content types, post types -Requires at least: 5.5.0 -Tested up to: 5.5.0 -Stable tag: 1.7.5 -License: GPL-2.0+ -Requires PHP: 5.6 - -Admin UI for creating custom post types and custom taxonomies for WordPress - -== Description == - -Custom Post Type UI provides an easy to use interface for registering and managing custom post types and taxonomies for your website. - -While CPTUI helps solve the problem of creating custom post types, displaying the data gleaned from them can be a whole new challenge. That’s why 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). [View our Layouts page](https://pluginize.com/cpt-ui-extended-features/?utm_source=cptui-description-examples&utm_medium=text&utm_campaign=wporg) to see some examples that are available with Custom Post Type UI Extended. - -Official development of Custom Post Type UI is on GitHub, with official stable 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 Support tab for potential bugs, issues, or enhancement ideas. - -[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 all the time, 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. - -== 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. Import/Export Post Types screen. -5. Get Code screen. -6. Help/support screen. - -== Changelog == - -= 1.7.5 - 2020-08-11 = -* Updated: Addressed UI issues with WordPress 5.5.0 -* Updated: Moved required minimum WordPress version to 5.5.0 - -= 1.7.4 - 2020-03-17 = -* Added: Nonce admin verification for import functionality. -* Added: Extra escaping of markup and output for "Get Code" areas. - -= 1.7.3 - 2020-02-05 = -* Updated: styles and appearance to better match WordPress core. -* Updated: Change newsletter service integration. Hey, sign up for our newsletter! Props @Oceas - -= 1.7.2 - 2020-01-08 = -* Fixed: Duplicate entries for "delete_with_user" in get code. -* Fixed: Delete button for post types and taxonomies at bottom of page did not trigger dialog prompt. - -= 1.7.1 - 2019-11-06 = -* Fixed: Random-ish redirects to the "Add new" tab for post types or taxonomies -* Fixed: JavaScript error when trying to delete a taxonomy. - -= 1.7.0 - 2019-11-06 = -* Actually added this time: Delete with user support for post types. Managed to miss the code with 1.6.0 which was a long time ago. -* Added: Ability to disable registration of post types or taxonomies, via code filter, without deleting them completely from settings. -* Added: New post type labels introduced in WordPress 5.0.0. -* Added: Link to Dashicon documentation for when editing menu icon. Props @juliekuehl -* Added: Ability to automatically fill in additional labels based on chosen plural and singular label text. -* Updated: Added post type templates documentation to help section. -* Updated: Redirect user to the "add" tab if deleting the last post type or taxonomy created. -* Updated: Touched up tab markup to match semantic improvements provided by WordPress 5.2.0. -* Fixed: potential duplicate output of "parent_item_colon" with "Get Code" output. -* Misc: Added code of conduct file to github repo. Props GaryJones. - -= 1.6.2 - 2019-05-20 = -* Added: "themes" is now a reserved post type slug due to conflicts with WordPress internally. -* Fixed: Updated wording around "Supports" section of post type settings screen. - -= 1.6.1 - 2018-12-03 = -* Fixed: Missed quote for "publicly_queryable" in taxonomy "get code" output. -* Fixed: Adjusted handling of capitalization on the word "false" when being used to disable a taxonomy metabox via the "metabox callback" setting. The word "false" needs to be all lowercase to disable. -* Updated: Added note about ability to pass "false" for the "metabox callback" setting to disable the metabox. -* Updated: Fall back to "custom-post-type-ui" textdomain in "get code" output if theme does not have their own. -* Updated: Make "Show In Rest" setting default to true taxonomies for sake of easier Gutenberg integration in the future. 1.6.0 had just post types doing this. - -= 1.6.0 - 2018-10-22 = -* Added: Support for `meta_box_cb` parameter for `register_taxonomy` and taxonomies. -* Added: Dynamically warn about existing slugs. -* Added: "delete_with_user" support for post types. -* Added: Filters for post type and taxonomy data right before saving of final data. -* Added: `cptui_get_taxonomy_exists` function to check if a provided taxonomy is registered. -* Added: Required PHP version to readme.txt -* Added: Filter on taxonomies to be listed as available for association with a post type. -* Added: Warning indicators to our "Slug changed" and "Slug exists" warnings for post types and taxonomies. -* Added: Support for "publicly_queryable" parameter for taxonomies. -* Added: Support for "rest_controller_class" parameters for both post types and taxonomies. -* Added: Some initial WP-CLI support for importing and exporting CPTUI settings. -* Added: `name_admin_bar` support in post type labels. -* Added: Handling of array versions for "capability_type" field. -* Updated: Bump minimum WordPress version to 4.7. -* Updated: Pass the object_type array to `cptui_pre_register_taxonomy` filter as extra parameter. -* Updated: Adjusted preserved label handling to aid with plugin performance. Props alex-solovyev -* Updated: Utilize `wp_doing_ajax()` function for our AJAX checks. -* Updated: Clarify what is exported with the Post Types and Taxonomies spots for the Tools section. -* Updated: Clarify that the listed post types to associate to a CPTUI taxonomy are public post types by default. -* Updated: Make "Show In Rest" setting default to true for sake of easier Gutenberg integration in the future. -* Fixed: Only register archive slug if has_archive is set to true. -* Fixed: Error occurred when attempting to unset post types while editing a taxonomy. -* Fixed: Prevent errors from non-existant callback functions during post type or taxonomy processing. -* Fixed: Incorrect use of reserved taxonomy slugs function in a check for reserved post types. -* Fixed: Make sure "No post type selected" alert trigger from both buttons on the taxonomy settings edit screen. -* Fixed: Add our stylesheet only on our CPTUI pages. Fixes responsive bug on post editor screen. -* Fixed: Removed duplicate "label" in taxonomy "get code" section. - - -== Upgrade Notice == - -= 1.7.5 - 2020-08-11 = -* Updated: Addressed UI issues with WordPress 5.5.0 -* Updated: Moved required minimum WordPress version to 5.5.0 - -= 1.7.4 - 2020-03-17 = -* Added: Nonce admin verification for import functionality. -* Added: Extra escaping of markup and output for "Get Code" areas. - -= 1.7.3 - 2020-02-05 = -* Updated: styles and appearance to better match WordPress core. -* Updated: Change newsletter service integration. Hey, sign up for our newsletter! Props @Oceas - -= 1.7.2 - 2020-01-08 = -* Fixed: Duplicate entries for "delete_with_user" in get code. -* Fixed: Delete button for post types and taxonomies at bottom of page did not trigger dialog prompt. - -= 1.7.1 - 2019-11-06 = -* Fixed: Random-ish redirects to the "Add new" tab for post types or taxonomies -* Fixed: JavaScript error when trying to delete a taxonomy. - -= 1.7.0 - 2019-11-06 = -* Actually added this time: Delete with user support for post types. Managed to miss the code with 1.6.0 which was a long time ago. -* Added: Ability to disable registration of post types or taxonomies, via code filter, without deleting them completely from settings. -* Added: New post type labels introduced in WordPress 5.0.0. -* Added: Link to Dashicon documentation for when editing menu icon. Props @juliekuehl -* Added: Ability to automatically fill in additional labels based on chosen plural and singular label text. -* Updated: Added post type templates documentation to help section. -* Updated: Redirect user to the "add" tab if deleting the last post type or taxonomy created. -* Updated: Touched up tab markup to match semantic improvements provided by WordPress 5.2.0. -* Fixed: potential duplicate output of "parent_item_colon" with "Get Code" output. -* Misc: Added code of conduct file to github repo. Props GaryJones. - -= 1.6.2 - 2019-05-20 = -* Added: "themes" is now a reserved post type slug due to conflicts with WordPress internally. -* Fixed: Updated wording around "Supports" section of post type settings screen. - -= 1.6.1 - 2018-12-03 = -* Fixed: Missed quote for "publicly_queryable" in taxonomy "get code" output. -* Fixed: Adjusted handling of capitalization on the word "false" when being used to disable a taxonomy metabox via the "metabox callback" setting. The word "false" needs to be all lowercase to disable. -* Updated: Added note about ability to pass "false" for the "metabox callback" setting to disable the metabox. -* Updated: Fall back to "custom-post-type-ui" textdomain in "get code" output if theme does not have their own. -* Updated: Make "Show In Rest" setting default to true taxonomies for sake of easier Gutenberg integration in the future. 1.6.0 had just post types doing this. - -= 1.6.0 - 2018-10-22 = -* Added: Support for `meta_box_cb` parameter for `register_taxonomy` and taxonomies. -* Added: Dynamically warn about existing slugs. -* Added: "delete_with_user" support for post types. -* Added: Filters for post type and taxonomy data right before saving of final data. -* Added: `cptui_get_taxonomy_exists` function to check if a provided taxonomy is registered. -* Added: Required PHP version to readme.txt -* Added: Filter on taxonomies to be listed as available for association with a post type. -* Added: Warning indicators to our "Slug changed" and "Slug exists" warnings for post types and taxonomies. -* Added: Support for "publicly_queryable" parameter for taxonomies. -* Added: Support for "rest_controller_class" parameters for both post types and taxonomies. -* Added: Some initial WP-CLI support for importing and exporting CPTUI settings. -* Added: `name_admin_bar` support in post type labels. -* Added: Handling of array versions for "capability_type" field. -* Updated: Bump minimum WordPress version to 4.7. -* Updated: Pass the object_type array to `cptui_pre_register_taxonomy` filter as extra parameter. -* Updated: Adjusted preserved label handling to aid with plugin performance. Props alex-solovyev -* Updated: Utilize `wp_doing_ajax()` function for our AJAX checks. -* Updated: Clarify what is exported with the Post Types and Taxonomies spots for the Tools section. -* Updated: Clarify that the listed post types to associate to a CPTUI taxonomy are public post types by default. -* Updated: Make "Show In Rest" setting default to true for sake of easier Gutenberg integration in the future. -* Fixed: Only register archive slug if has_archive is set to true. -* Fixed: Error occurred when attempting to unset post types while editing a taxonomy. -* Fixed: Prevent errors from non-existant callback functions during post type or taxonomy processing. -* Fixed: Incorrect use of reserved taxonomy slugs function in a check for reserved post types. -* Fixed: Make sure "No post type selected" alert trigger from both buttons on the taxonomy settings edit screen. -* Fixed: Add our stylesheet only on our CPTUI pages. Fixes responsive bug on post editor screen. -* Fixed: Removed duplicate "label" in taxonomy "get code" section. - -== 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 http://docs.pluginize.com/category/126-custom-post-type-ui - -#### Code/API documentation -Please see http://codex.pluginize.com/cptui/ +=== Custom Post Type UI === +Contributors: webdevstudios, pluginize, tw2113, vegasgeek, modemlooper, williamsba1 +Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3084056 +Tags: custom post types, CPT, CMS, post, types, post type, taxonomy, tax, custom, content types, post types +Requires at least: 5.5 +Tested up to: 5.5 +Stable tag: 1.8.0 +License: GPL-2.0+ +Requires PHP: 5.6 + +Admin UI for creating custom post types and custom taxonomies for WordPress + +== Description == + +Custom Post Type UI provides an easy to use interface for registering and managing custom post types and taxonomies for your website. + +While CPTUI helps solve the problem of creating custom post types, displaying the data gleaned from them can be a whole new challenge. That’s why 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). [View our Layouts page](https://pluginize.com/cpt-ui-extended-features/?utm_source=cptui-description-examples&utm_medium=text&utm_campaign=wporg) to see some examples that are available with Custom Post Type UI Extended. + +Official development of Custom Post Type UI is on GitHub, with official stable 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 Support tab for potential bugs, issues, or enhancement ideas. + +[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 all the time, 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. + +== 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. Import/Export Post Types screen. +5. Get Code screen. +6. Help/support screen. + +== Changelog == + += 1.8.0 - 2020-08-14 = +* Added: support for default terms with a custom taxonomy. +* Updated: Removed the forcing of underscores for post type slugs. Taxonomies are still forced. +* Fixed: jQuery compatibility issue with WordPress 5.5.0 + += 1.7.5 - 2020-08-11 = +* Updated: Addressed UI issues with WordPress 5.5.0 +* Updated: Moved required minimum WordPress version to 5.5.0 + += 1.7.4 - 2020-03-17 = +* Added: Nonce admin verification for import functionality. +* Added: Extra escaping of markup and output for "Get Code" areas. + += 1.7.3 - 2020-02-05 = +* Updated: styles and appearance to better match WordPress core. +* Updated: Change newsletter service integration. Hey, sign up for our newsletter! Props @Oceas + += 1.7.2 - 2020-01-08 = +* Fixed: Duplicate entries for "delete_with_user" in get code. +* Fixed: Delete button for post types and taxonomies at bottom of page did not trigger dialog prompt. + += 1.7.1 - 2019-11-06 = +* Fixed: Random-ish redirects to the "Add new" tab for post types or taxonomies +* Fixed: JavaScript error when trying to delete a taxonomy. + += 1.7.0 - 2019-11-06 = +* Actually added this time: Delete with user support for post types. Managed to miss the code with 1.6.0 which was a long time ago. +* Added: Ability to disable registration of post types or taxonomies, via code filter, without deleting them completely from settings. +* Added: New post type labels introduced in WordPress 5.0.0. +* Added: Link to Dashicon documentation for when editing menu icon. Props @juliekuehl +* Added: Ability to automatically fill in additional labels based on chosen plural and singular label text. +* Updated: Added post type templates documentation to help section. +* Updated: Redirect user to the "add" tab if deleting the last post type or taxonomy created. +* Updated: Touched up tab markup to match semantic improvements provided by WordPress 5.2.0. +* Fixed: potential duplicate output of "parent_item_colon" with "Get Code" output. +* Misc: Added code of conduct file to github repo. Props GaryJones. + +== Upgrade Notice == + += 1.8.0 - 2020-08-14 = +* Added: support for default terms with a custom taxonomy. +* Updated: Removed the forcing of underscores for post type slugs. Taxonomies are still forced. +* Fixed: jQuery compatibility issue with WordPress 5.5.0 + += 1.7.5 - 2020-08-11 = +* Updated: Addressed UI issues with WordPress 5.5.0 +* Updated: Moved required minimum WordPress version to 5.5.0 + += 1.7.4 - 2020-03-17 = +* Added: Nonce admin verification for import functionality. +* Added: Extra escaping of markup and output for "Get Code" areas. + += 1.7.3 - 2020-02-05 = +* Updated: styles and appearance to better match WordPress core. +* Updated: Change newsletter service integration. Hey, sign up for our newsletter! Props @Oceas + += 1.7.2 - 2020-01-08 = +* Fixed: Duplicate entries for "delete_with_user" in get code. +* Fixed: Delete button for post types and taxonomies at bottom of page did not trigger dialog prompt. + += 1.7.1 - 2019-11-06 = +* Fixed: Random-ish redirects to the "Add new" tab for post types or taxonomies +* Fixed: JavaScript error when trying to delete a taxonomy. + += 1.7.0 - 2019-11-06 = +* Actually added this time: Delete with user support for post types. Managed to miss the code with 1.6.0 which was a long time ago. +* Added: Ability to disable registration of post types or taxonomies, via code filter, without deleting them completely from settings. +* Added: New post type labels introduced in WordPress 5.0.0. +* Added: Link to Dashicon documentation for when editing menu icon. Props @juliekuehl +* Added: Ability to automatically fill in additional labels based on chosen plural and singular label text. +* Updated: Added post type templates documentation to help section. +* Updated: Redirect user to the "add" tab if deleting the last post type or taxonomy created. +* Updated: Touched up tab markup to match semantic improvements provided by WordPress 5.2.0. +* Fixed: potential duplicate output of "parent_item_colon" with "Get Code" output. +* Misc: Added code of conduct file to github repo. Props GaryJones. + +== 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 http://docs.pluginize.com/category/126-custom-post-type-ui + +#### Code/API documentation +Please see http://codex.pluginize.com/cptui/