Skip to content

Commit

Permalink
merge in version 1.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tw2113 committed Apr 20, 2021
1 parent deb63f4 commit 1dce912
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 11 deletions.
6 changes: 3 additions & 3 deletions custom-post-type-ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.9.0
* Version: 1.9.1
* Author URI: https://webdevstudios.com/
* Text Domain: custom-post-type-ui
* Domain Path: /languages
Expand All @@ -30,8 +30,8 @@
exit;
}

define( 'CPT_VERSION', '1.9.0' ); // Left for legacy purposes.
define( 'CPTUI_VERSION', '1.9.0' );
define( 'CPT_VERSION', '1.9.1' ); // Left for legacy purposes.
define( 'CPTUI_VERSION', '1.9.1' );
define( 'CPTUI_WP_VERSION', get_bloginfo( 'version' ) );

/**
Expand Down
2 changes: 1 addition & 1 deletion inc/post-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ function cptui_manage_post_types() {
'namearray' => 'cpt_custom_post_type',
'name' => 'hierarchical',
'labeltext' => esc_html__( 'Hierarchical', 'custom-post-type-ui' ),
'aftertext' => esc_html__( '(default: false) Whether or not the post type can have parent-child relationships.', 'custom-post-type-ui' ),
'aftertext' => esc_html__( '(default: false) Whether or not the post type can have parent-child relationships. At least one published content item is needed in order to select a parent.', 'custom-post-type-ui' ),
'selections' => $select,
] );

Expand Down
33 changes: 27 additions & 6 deletions inc/tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ function cptui_get_single_taxonomy_registery( $taxonomy = [] ) {
?>
];

<?php
$show_graphql = isset( $taxonomy['show_in_graphql'] ) ? (bool) $taxonomy['show_in_graphql'] : false;
?>

$args = [
"label" => __( "<?php echo $taxonomy['label']; ?>", "<?php echo $textdomain; ?>" ),
"labels" => $labels,
Expand All @@ -342,12 +346,19 @@ function cptui_get_single_taxonomy_registery( $taxonomy = [] ) {
"rest_base" => "<?php echo $rest_base; ?>",
"rest_controller_class" => "<?php echo $rest_controller_class; ?>",
"show_in_quick_edit" => <?php echo $show_in_quick_edit; ?>,
<?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 } ?>
<?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'] ); ?>",
"show_in_graphql" => "<?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
Expand Down Expand Up @@ -420,6 +431,9 @@ function cptui_get_single_post_type_registery( $post_type = [] ) {
}
}


$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 ) {
Expand Down Expand Up @@ -579,6 +593,13 @@ function cptui_get_single_post_type_registery( $post_type = [] ) {
<?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'] ); ?>",
"show_in_graphql" => "<?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 );
Expand Down
10 changes: 9 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
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.7.0
Stable tag: 1.9.0
Stable tag: 1.9.1
License: GPL-2.0+
Requires PHP: 5.6

Expand All @@ -31,6 +31,10 @@ Official development of Custom Post Type UI is on GitHub, with official stable r

== Changelog ==

= 1.9.1 - 2021-04-19 =
* Fixed: missed WPGraphQL settings in our Get Tools/Export functionality.
* Updated: note about needing a published item to set parent/child relationships in post types.

= 1.9.0 - 2021-03-30 =
* Added: WPGraphQL Support when WPGraphQL is installed and active.
* Fixed: Better handling of code in post_format based helper functions.
Expand All @@ -54,6 +58,10 @@ Official development of Custom Post Type UI is on GitHub, with official stable r

== Upgrade Notice ==

= 1.9.1 - 2021-04-19 =
* Fixed: missed WPGraphQL settings in our Get Tools/Export functionality.
* Updated: note about needing a published item to set parent/child relationships in post types.

= 1.9.0 - 2021-03-30 =
* Added: WPGraphQL Support when WPGraphQL is installed and active.
* Fixed: Better handling of code in post_format based helper functions.
Expand Down

0 comments on commit 1dce912

Please sign in to comment.