Changeset 2966107
- Timestamp:
- 09/12/2023 10:53:54 PM (3 years ago)
- Location:
- shadow-terms
- Files:
-
- 4 added
- 12 edited
- 1 copied
-
assets/banner-1544x500.jpg (added)
-
assets/banner-772x250.jpg (added)
-
assets/icon-128x128.jpg (added)
-
assets/icon-256x256.jpg (added)
-
tags/1.1.0 (copied) (copied from shadow-terms/trunk)
-
tags/1.1.0/LICENSE (modified) (2 diffs)
-
tags/1.1.0/includes/api.php (modified) (4 diffs)
-
tags/1.1.0/includes/sync.php (modified) (2 diffs)
-
tags/1.1.0/includes/taxonomy.php (modified) (6 diffs)
-
tags/1.1.0/plugin.php (modified) (1 diff)
-
tags/1.1.0/readme.txt (modified) (2 diffs)
-
trunk/LICENSE (modified) (2 diffs)
-
trunk/includes/api.php (modified) (4 diffs)
-
trunk/includes/sync.php (modified) (2 diffs)
-
trunk/includes/taxonomy.php (modified) (6 diffs)
-
trunk/plugin.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shadow-terms/tags/1.1.0/LICENSE
r2825530 r2966107 1 1 Shadow Terms plugin for WordPress 2 2 3 Copyright 2022 by Happy Prime and contributors3 Copyright 2022-2023 by Happy Prime and contributors 4 4 5 5 This program is free software; you can redistribute it and/or modify … … 362 362 363 363 The source code for any program binaries or compressed scripts that are 364 included with Turn Comments Offcan be freely obtained at the following URL:364 included with Shadow Terms can be freely obtained at the following URL: 365 365 366 366 https://github.com/happyprime/shadow-terms/ -
shadow-terms/tags/1.1.0/includes/api.php
r2825530 r2966107 16 16 * @return string The shadow taxonomy slug. Empty if not found. 17 17 */ 18 function get_taxonomy_slug( int $post_id ) : string {18 function get_taxonomy_slug( int $post_id ): string { 19 19 $post = get_post( $post_id ); 20 20 … … 40 40 * @return int The term ID. 0 if not available. 41 41 */ 42 function get_term_id( int $post_id ) : int {42 function get_term_id( int $post_id ): int { 43 43 $post = get_post( $post_id ); 44 44 … … 70 70 * @return int The post ID. 0 if not found. 71 71 */ 72 function get_post_id( int $term_id ) : int {72 function get_post_id( int $term_id ): int { 73 73 $term = get_term( $term_id ); 74 74 … … 108 108 * the shadow taxonomy. 109 109 */ 110 function get_connected_post_types( string $post_type ) : array {110 function get_connected_post_types( string $post_type ): array { 111 111 $supports = get_all_post_type_supports( $post_type ); 112 112 -
shadow-terms/tags/1.1.0/includes/sync.php
r2914474 r2966107 22 22 * @param null|\WP_Post $post_before The post object before the update. 23 23 */ 24 function sync_shadow_taxonomies( int $post_id, \WP_Post $post_after, bool $update, $post_before ) : void {24 function sync_shadow_taxonomies( int $post_id, \WP_Post $post_after, bool $update, $post_before ): void { 25 25 // The post before object may be null for new posts, so juggle that 26 26 // possibility to capture status and title before doing anything else. … … 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( int $post_id, \WP_Post $post ): void { 106 106 if ( ! post_type_supports( $post->post_type, 'shadow-terms' ) ) { 107 107 return; -
shadow-terms/tags/1.1.0/includes/taxonomy.php
r2825530 r2966107 23 23 * @since 1.0.0 24 24 */ 25 function register() : void {25 function register(): void { 26 26 $post_types = get_post_types_by_support( 'shadow-terms' ); 27 27 … … 36 36 * @since 1.0.0 37 37 */ 38 function register_route() : void {38 function register_route(): void { 39 39 // Register a REST route used to associate posts with a post's shadow term. 40 40 register_rest_route( … … 57 57 * be registered. 58 58 */ 59 function register_taxonomy( string $post_type ) : void {59 function register_taxonomy( string $post_type ): void { 60 60 $post_type_object = get_post_type_object( $post_type ); 61 61 … … 75 75 ); 76 76 77 /** 78 * Filter the arguments used to register a shadow taxonomy. 79 * 80 * @since 1.1.0 81 * 82 * @param array $args The arguments used to register the taxonomy. 83 * @param string $post_type The post type this taxonomy is shadowing. 84 */ 85 $args = apply_filters( 'shadow_terms_register_taxonomy_args', $args, $post_type ); 86 77 87 \register_taxonomy( 78 88 $post_type . '_connect', … … 89 99 * @return bool True if capable. False if not. 90 100 */ 91 function can_associate_posts() : bool {101 function can_associate_posts(): bool { 92 102 return current_user_can( 'edit_posts' ); 93 103 } … … 101 111 * @return \WP_REST_Response The response data. 102 112 */ 103 function handle_rest_associate( \WP_REST_Request $request ) : \WP_REST_Response {113 function handle_rest_associate( \WP_REST_Request $request ): \WP_REST_Response { 104 114 $post_id = (int) $request->get_param( 'postId' ); 105 115 $associated_post_id = (int) $request->get_param( 'associatedPostId' ); -
shadow-terms/tags/1.1.0/plugin.php
r2914474 r2966107 3 3 * Plugin Name: Shadow Terms 4 4 * Description: Use terms from generated taxonomies to associate related content. 5 * Version: 1. 0.15 * Version: 1.1.0 6 6 * Plugin URI: https://github.com/happyprime/shadow-terms/ 7 7 * Author: Happy Prime -
shadow-terms/tags/1.1.0/readme.txt
r2914474 r2966107 3 3 Tags: terms, related, content 4 4 Requires at least: 5.9 5 Tested up to: 6. 26 Stable tag: 1. 0.15 Tested up to: 6.3 6 Stable tag: 1.1.0 7 7 License: GPLv2 or later 8 8 Requires PHP: 7.4 … … 41 41 ## Changelog 42 42 43 ### 1.1.0 44 45 * Add filtering to shadow taxonomy taxonomy arguments. 46 * Update development tooling. 47 43 48 ### 1.0.1 44 49 -
shadow-terms/trunk/LICENSE
r2825530 r2966107 1 1 Shadow Terms plugin for WordPress 2 2 3 Copyright 2022 by Happy Prime and contributors3 Copyright 2022-2023 by Happy Prime and contributors 4 4 5 5 This program is free software; you can redistribute it and/or modify … … 362 362 363 363 The source code for any program binaries or compressed scripts that are 364 included with Turn Comments Offcan be freely obtained at the following URL:364 included with Shadow Terms can be freely obtained at the following URL: 365 365 366 366 https://github.com/happyprime/shadow-terms/ -
shadow-terms/trunk/includes/api.php
r2825530 r2966107 16 16 * @return string The shadow taxonomy slug. Empty if not found. 17 17 */ 18 function get_taxonomy_slug( int $post_id ) : string {18 function get_taxonomy_slug( int $post_id ): string { 19 19 $post = get_post( $post_id ); 20 20 … … 40 40 * @return int The term ID. 0 if not available. 41 41 */ 42 function get_term_id( int $post_id ) : int {42 function get_term_id( int $post_id ): int { 43 43 $post = get_post( $post_id ); 44 44 … … 70 70 * @return int The post ID. 0 if not found. 71 71 */ 72 function get_post_id( int $term_id ) : int {72 function get_post_id( int $term_id ): int { 73 73 $term = get_term( $term_id ); 74 74 … … 108 108 * the shadow taxonomy. 109 109 */ 110 function get_connected_post_types( string $post_type ) : array {110 function get_connected_post_types( string $post_type ): array { 111 111 $supports = get_all_post_type_supports( $post_type ); 112 112 -
shadow-terms/trunk/includes/sync.php
r2914474 r2966107 22 22 * @param null|\WP_Post $post_before The post object before the update. 23 23 */ 24 function sync_shadow_taxonomies( int $post_id, \WP_Post $post_after, bool $update, $post_before ) : void {24 function sync_shadow_taxonomies( int $post_id, \WP_Post $post_after, bool $update, $post_before ): void { 25 25 // The post before object may be null for new posts, so juggle that 26 26 // possibility to capture status and title before doing anything else. … … 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( int $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
r2825530 r2966107 23 23 * @since 1.0.0 24 24 */ 25 function register() : void {25 function register(): void { 26 26 $post_types = get_post_types_by_support( 'shadow-terms' ); 27 27 … … 36 36 * @since 1.0.0 37 37 */ 38 function register_route() : void {38 function register_route(): void { 39 39 // Register a REST route used to associate posts with a post's shadow term. 40 40 register_rest_route( … … 57 57 * be registered. 58 58 */ 59 function register_taxonomy( string $post_type ) : void {59 function register_taxonomy( string $post_type ): void { 60 60 $post_type_object = get_post_type_object( $post_type ); 61 61 … … 75 75 ); 76 76 77 /** 78 * Filter the arguments used to register a shadow taxonomy. 79 * 80 * @since 1.1.0 81 * 82 * @param array $args The arguments used to register the taxonomy. 83 * @param string $post_type The post type this taxonomy is shadowing. 84 */ 85 $args = apply_filters( 'shadow_terms_register_taxonomy_args', $args, $post_type ); 86 77 87 \register_taxonomy( 78 88 $post_type . '_connect', … … 89 99 * @return bool True if capable. False if not. 90 100 */ 91 function can_associate_posts() : bool {101 function can_associate_posts(): bool { 92 102 return current_user_can( 'edit_posts' ); 93 103 } … … 101 111 * @return \WP_REST_Response The response data. 102 112 */ 103 function handle_rest_associate( \WP_REST_Request $request ) : \WP_REST_Response {113 function handle_rest_associate( \WP_REST_Request $request ): \WP_REST_Response { 104 114 $post_id = (int) $request->get_param( 'postId' ); 105 115 $associated_post_id = (int) $request->get_param( 'associatedPostId' ); -
shadow-terms/trunk/plugin.php
r2914474 r2966107 3 3 * Plugin Name: Shadow Terms 4 4 * Description: Use terms from generated taxonomies to associate related content. 5 * Version: 1. 0.15 * Version: 1.1.0 6 6 * Plugin URI: https://github.com/happyprime/shadow-terms/ 7 7 * Author: Happy Prime -
shadow-terms/trunk/readme.txt
r2914474 r2966107 3 3 Tags: terms, related, content 4 4 Requires at least: 5.9 5 Tested up to: 6. 26 Stable tag: 1. 0.15 Tested up to: 6.3 6 Stable tag: 1.1.0 7 7 License: GPLv2 or later 8 8 Requires PHP: 7.4 … … 41 41 ## Changelog 42 42 43 ### 1.1.0 44 45 * Add filtering to shadow taxonomy taxonomy arguments. 46 * Update development tooling. 47 43 48 ### 1.0.1 44 49
Note: See TracChangeset
for help on using the changeset viewer.