Skip to content

Commit 1dce912

Browse files
committed
merge in version 1.9.1
1 parent deb63f4 commit 1dce912

File tree

4 files changed

+40
-11
lines changed

4 files changed

+40
-11
lines changed

custom-post-type-ui.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Plugin URI: https://github.com/WebDevStudios/custom-post-type-ui/
1717
* Description: Admin panel for creating custom post types and custom taxonomies in WordPress
1818
* Author: WebDevStudios
19-
* Version: 1.9.0
19+
* Version: 1.9.1
2020
* Author URI: https://webdevstudios.com/
2121
* Text Domain: custom-post-type-ui
2222
* Domain Path: /languages
@@ -30,8 +30,8 @@
3030
exit;
3131
}
3232

33-
define( 'CPT_VERSION', '1.9.0' ); // Left for legacy purposes.
34-
define( 'CPTUI_VERSION', '1.9.0' );
33+
define( 'CPT_VERSION', '1.9.1' ); // Left for legacy purposes.
34+
define( 'CPTUI_VERSION', '1.9.1' );
3535
define( 'CPTUI_WP_VERSION', get_bloginfo( 'version' ) );
3636

3737
/**

inc/post-types.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ function cptui_manage_post_types() {
990990
'namearray' => 'cpt_custom_post_type',
991991
'name' => 'hierarchical',
992992
'labeltext' => esc_html__( 'Hierarchical', 'custom-post-type-ui' ),
993-
'aftertext' => esc_html__( '(default: false) Whether or not the post type can have parent-child relationships.', 'custom-post-type-ui' ),
993+
'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' ),
994994
'selections' => $select,
995995
] );
996996

inc/tools.php

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ function cptui_get_single_taxonomy_registery( $taxonomy = [] ) {
326326
?>
327327
];
328328

329+
<?php
330+
$show_graphql = isset( $taxonomy['show_in_graphql'] ) ? (bool) $taxonomy['show_in_graphql'] : false;
331+
?>
332+
329333
$args = [
330334
"label" => __( "<?php echo $taxonomy['label']; ?>", "<?php echo $textdomain; ?>" ),
331335
"labels" => $labels,
@@ -342,12 +346,19 @@ function cptui_get_single_taxonomy_registery( $taxonomy = [] ) {
342346
"rest_base" => "<?php echo $rest_base; ?>",
343347
"rest_controller_class" => "<?php echo $rest_controller_class; ?>",
344348
"show_in_quick_edit" => <?php echo $show_in_quick_edit; ?>,
345-
<?php if ( ! empty( $meta_box_cb ) ) { ?>
346-
"meta_box_cb" => <?php echo $meta_box_cb; ?>,
347-
<?php } ?>
348-
<?php if ( ! empty( $default_term ) ) { ?>
349-
"default_term" => <?php echo $default_term; ?>,
350-
<?php } ?>
349+
<?php if ( $show_graphql ) : ?>
350+
"show_in_graphql" => <?php echo disp_boolean( $taxonomy['show_in_graphql'] ); ?>,
351+
"graphql_single_name" => "<?php echo esc_html( $taxonomy['graphql_single_name'] ); ?>",
352+
"show_in_graphql" => "<?php echo esc_html( $taxonomy['graphql_plural_name'] ); ?>",
353+
<?php else: ?>
354+
"show_in_graphql" => <?php echo disp_boolean( false ); ?>,
355+
<?php endif; ?>
356+
<?php if ( ! empty( $meta_box_cb ) ) { ?>
357+
"meta_box_cb" => <?php echo $meta_box_cb; ?>,
358+
<?php } ?>
359+
<?php if ( ! empty( $default_term ) ) { ?>
360+
"default_term" => <?php echo $default_term; ?>,
361+
<?php } ?>
351362
];
352363
register_taxonomy( "<?php echo esc_html( $taxonomy['name'] ); ?>", <?php echo $post_types; ?>, $args );
353364
<?php
@@ -420,6 +431,9 @@ function cptui_get_single_post_type_registery( $post_type = [] ) {
420431
}
421432
}
422433

434+
435+
$show_graphql = isset( $post_type['show_in_graphql'] ) ? (bool) $post_type['show_in_graphql'] : false;
436+
423437
$rewrite_withfront = '';
424438
$rewrite = get_disp_boolean( $post_type['rewrite'] );
425439
if ( false !== $rewrite ) {
@@ -579,6 +593,13 @@ function cptui_get_single_post_type_registery( $post_type = [] ) {
579593
<?php if ( true === $yarpp ) { ?>
580594
"yarpp_support" => <?php echo disp_boolean( $yarpp ); ?>,
581595
<?php } ?>
596+
<?php if ( $show_graphql ) : ?>
597+
"show_in_graphql" => <?php echo disp_boolean( $post_type['show_in_graphql'] ); ?>,
598+
"graphql_single_name" => "<?php echo esc_html( $post_type['graphql_single_name'] ); ?>",
599+
"show_in_graphql" => "<?php echo esc_html( $post_type['graphql_plural_name'] ); ?>",
600+
<?php else: ?>
601+
"show_in_graphql" => <?php echo disp_boolean( false ); ?>,
602+
<?php endif; ?>
582603
];
583604

584605
register_post_type( "<?php echo esc_html( $post_type['name'] ); ?>", $args );

readme.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
44
Tags: custom post types, CPT, CMS, post, types, post type, taxonomy, tax, custom, content types, post types
55
Requires at least: 5.5
66
Tested up to: 5.7.0
7-
Stable tag: 1.9.0
7+
Stable tag: 1.9.1
88
License: GPL-2.0+
99
Requires PHP: 5.6
1010

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

3232
== Changelog ==
3333

34+
= 1.9.1 - 2021-04-19 =
35+
* Fixed: missed WPGraphQL settings in our Get Tools/Export functionality.
36+
* Updated: note about needing a published item to set parent/child relationships in post types.
37+
3438
= 1.9.0 - 2021-03-30 =
3539
* Added: WPGraphQL Support when WPGraphQL is installed and active.
3640
* Fixed: Better handling of code in post_format based helper functions.
@@ -54,6 +58,10 @@ Official development of Custom Post Type UI is on GitHub, with official stable r
5458

5559
== Upgrade Notice ==
5660

61+
= 1.9.1 - 2021-04-19 =
62+
* Fixed: missed WPGraphQL settings in our Get Tools/Export functionality.
63+
* Updated: note about needing a published item to set parent/child relationships in post types.
64+
5765
= 1.9.0 - 2021-03-30 =
5866
* Added: WPGraphQL Support when WPGraphQL is installed and active.
5967
* Fixed: Better handling of code in post_format based helper functions.

0 commit comments

Comments
 (0)