Changeset 3043795
- Timestamp:
- 03/01/2024 07:36:13 PM (2 years ago)
- Location:
- shadow-terms
- Files:
-
- 2 added
- 10 edited
- 1 copied
-
tags/1.2.0 (copied) (copied from shadow-terms/trunk)
-
tags/1.2.0/includes/api.php (modified) (1 diff)
-
tags/1.2.0/includes/sync.php (modified) (1 diff)
-
tags/1.2.0/includes/taxonomy.php (modified) (3 diffs)
-
tags/1.2.0/phpstan.neon.dist (added)
-
tags/1.2.0/plugin.php (modified) (1 diff)
-
tags/1.2.0/readme.txt (modified) (2 diffs)
-
trunk/includes/api.php (modified) (1 diff)
-
trunk/includes/sync.php (modified) (1 diff)
-
trunk/includes/taxonomy.php (modified) (3 diffs)
-
trunk/phpstan.neon.dist (added)
-
trunk/plugin.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shadow-terms/tags/1.2.0/includes/api.php
r2966107 r3043795 111 111 $supports = get_all_post_type_supports( $post_type ); 112 112 113 if ( is _array( $supports['shadow-terms'] ) && is_array( $supports['shadow-terms'][0] ) ) {113 if ( isset( $supports['shadow-terms'] ) && is_array( $supports['shadow-terms'] ) && is_array( $supports['shadow-terms'][0] ) ) { 114 114 return $supports['shadow-terms'][0]; 115 115 } -
shadow-terms/tags/1.2.0/includes/sync.php
r2966107 r3043795 103 103 * @param \WP_Post $post The post object. 104 104 */ 105 function delete_term( int$post_id, \WP_Post $post ): void {105 function delete_term( $post_id, \WP_Post $post ): void { 106 106 if ( ! post_type_supports( $post->post_type, 'shadow-terms' ) ) { 107 107 return; -
shadow-terms/tags/1.2.0/includes/taxonomy.php
r2966107 r3043795 68 68 'rewrite' => false, 69 69 'hierarchical' => true, 70 'capabilities' => array( 71 'manage_terms' => 'override_shadow_terms', 72 'edit_terms' => 'override_shadow_terms', 73 'delete_terms' => 'override_shadow_terms', 74 ), 70 75 'show_ui' => true, 71 76 'show_in_menu' => false, … … 74 79 'show_admin_column' => true, 75 80 ); 81 82 // If a post type is not publicly queryable and not visible in the REST API, 83 // we should not expose that post type's shadow terms to unauthorized users. 84 if ( false === $post_type_object->publicly_queryable && false === $post_type_object->show_in_rest && ! is_user_logged_in() ) { 85 $args['show_in_rest'] = false; 86 } 76 87 77 88 /** … … 108 119 * @since 1.0.0 109 120 * 110 * @param \WP_REST_Request $request The vote submission request.121 * @param \WP_REST_Request $request The request to associate posts. 111 122 * @return \WP_REST_Response The response data. 112 123 */ -
shadow-terms/tags/1.2.0/plugin.php
r2966107 r3043795 3 3 * Plugin Name: Shadow Terms 4 4 * Description: Use terms from generated taxonomies to associate related content. 5 * Version: 1. 1.05 * Version: 1.2.0 6 6 * Plugin URI: https://github.com/happyprime/shadow-terms/ 7 7 * Author: Happy Prime -
shadow-terms/tags/1.2.0/readme.txt
r2966107 r3043795 3 3 Tags: terms, related, content 4 4 Requires at least: 5.9 5 Tested up to: 6. 36 Stable tag: 1. 1.05 Tested up to: 6.4 6 Stable tag: 1.2.0 7 7 License: GPLv2 or later 8 8 Requires PHP: 7.4 … … 41 41 ## Changelog 42 42 43 ### 1.2.0 44 45 * Do not show "Add New" term option for shadow taxonomies, which are automatically managed. Thanks [@s3rgiosan](https://profiles.wordpress.org/s3rgiosan/)! 46 * Do not show shadow terms in REST API to unauthenticated users if their original post type is not publicly available via REST endpoint. 47 43 48 ### 1.1.0 44 49 -
shadow-terms/trunk/includes/api.php
r2966107 r3043795 111 111 $supports = get_all_post_type_supports( $post_type ); 112 112 113 if ( is _array( $supports['shadow-terms'] ) && is_array( $supports['shadow-terms'][0] ) ) {113 if ( isset( $supports['shadow-terms'] ) && is_array( $supports['shadow-terms'] ) && is_array( $supports['shadow-terms'][0] ) ) { 114 114 return $supports['shadow-terms'][0]; 115 115 } -
shadow-terms/trunk/includes/sync.php
r2966107 r3043795 103 103 * @param \WP_Post $post The post object. 104 104 */ 105 function delete_term( int$post_id, \WP_Post $post ): void {105 function delete_term( $post_id, \WP_Post $post ): void { 106 106 if ( ! post_type_supports( $post->post_type, 'shadow-terms' ) ) { 107 107 return; -
shadow-terms/trunk/includes/taxonomy.php
r2966107 r3043795 68 68 'rewrite' => false, 69 69 'hierarchical' => true, 70 'capabilities' => array( 71 'manage_terms' => 'override_shadow_terms', 72 'edit_terms' => 'override_shadow_terms', 73 'delete_terms' => 'override_shadow_terms', 74 ), 70 75 'show_ui' => true, 71 76 'show_in_menu' => false, … … 74 79 'show_admin_column' => true, 75 80 ); 81 82 // If a post type is not publicly queryable and not visible in the REST API, 83 // we should not expose that post type's shadow terms to unauthorized users. 84 if ( false === $post_type_object->publicly_queryable && false === $post_type_object->show_in_rest && ! is_user_logged_in() ) { 85 $args['show_in_rest'] = false; 86 } 76 87 77 88 /** … … 108 119 * @since 1.0.0 109 120 * 110 * @param \WP_REST_Request $request The vote submission request.121 * @param \WP_REST_Request $request The request to associate posts. 111 122 * @return \WP_REST_Response The response data. 112 123 */ -
shadow-terms/trunk/plugin.php
r2966107 r3043795 3 3 * Plugin Name: Shadow Terms 4 4 * Description: Use terms from generated taxonomies to associate related content. 5 * Version: 1. 1.05 * Version: 1.2.0 6 6 * Plugin URI: https://github.com/happyprime/shadow-terms/ 7 7 * Author: Happy Prime -
shadow-terms/trunk/readme.txt
r2966107 r3043795 3 3 Tags: terms, related, content 4 4 Requires at least: 5.9 5 Tested up to: 6. 36 Stable tag: 1. 1.05 Tested up to: 6.4 6 Stable tag: 1.2.0 7 7 License: GPLv2 or later 8 8 Requires PHP: 7.4 … … 41 41 ## Changelog 42 42 43 ### 1.2.0 44 45 * Do not show "Add New" term option for shadow taxonomies, which are automatically managed. Thanks [@s3rgiosan](https://profiles.wordpress.org/s3rgiosan/)! 46 * Do not show shadow terms in REST API to unauthenticated users if their original post type is not publicly available via REST endpoint. 47 43 48 ### 1.1.0 44 49
Note: See TracChangeset
for help on using the changeset viewer.