Changeset 2914474
- Timestamp:
- 05/18/2023 07:41:58 PM (3 years ago)
- Location:
- shadow-terms
- Files:
-
- 6 edited
- 1 copied
-
tags/1.0.1 (copied) (copied from shadow-terms/trunk)
-
tags/1.0.1/includes/sync.php (modified) (3 diffs)
-
tags/1.0.1/plugin.php (modified) (1 diff)
-
tags/1.0.1/readme.txt (modified) (2 diffs)
-
trunk/includes/sync.php (modified) (3 diffs)
-
trunk/plugin.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shadow-terms/tags/1.0.1/includes/sync.php
r2825530 r2914474 29 29 $title_before = null === $post_before ? '' : $post_before->post_title; 30 30 $title_after = $post_after->post_title; 31 $slug_before = null === $post_before ? '' : $post_before->post_name; 32 $slug_after = $post_after->post_name; 31 33 32 34 // One version of the post must be published for us to make a change. … … 66 68 } 67 69 68 // If a post is to remain published, but the title has changed, update the term. 69 if ( $term_before && 'publish' === $post_after->post_status && $title_before !== $title_after ) { 70 $changed = $title_before !== $title_after || $slug_before !== $slug_after; 71 72 // If a post is to remain published, but the title or slug has changed, update the term. 73 if ( $term_before && 'publish' === $post_after->post_status && $changed ) { 70 74 wp_update_term( 71 75 $term_before->term_id, … … 73 77 array( 74 78 'name' => $title_after, 75 'slug' => sanitize_title( $title_after ),79 'slug' => $slug_after, 76 80 ) 77 81 ); -
shadow-terms/tags/1.0.1/plugin.php
r2825530 r2914474 3 3 * Plugin Name: Shadow Terms 4 4 * Description: Use terms from generated taxonomies to associate related content. 5 * Version: 1.0. 05 * Version: 1.0.1 6 6 * Plugin URI: https://github.com/happyprime/shadow-terms/ 7 7 * Author: Happy Prime -
shadow-terms/tags/1.0.1/readme.txt
r2889495 r2914474 4 4 Requires at least: 5.9 5 5 Tested up to: 6.2 6 Stable tag: 1.0. 06 Stable tag: 1.0.1 7 7 License: GPLv2 or later 8 8 Requires PHP: 7.4 … … 41 41 ## Changelog 42 42 43 ### 1.0.1 44 45 * Fix: Ensure term and post slugs sync properly on post update. 46 43 47 ### 1.0.0 44 48 -
shadow-terms/trunk/includes/sync.php
r2825530 r2914474 29 29 $title_before = null === $post_before ? '' : $post_before->post_title; 30 30 $title_after = $post_after->post_title; 31 $slug_before = null === $post_before ? '' : $post_before->post_name; 32 $slug_after = $post_after->post_name; 31 33 32 34 // One version of the post must be published for us to make a change. … … 66 68 } 67 69 68 // If a post is to remain published, but the title has changed, update the term. 69 if ( $term_before && 'publish' === $post_after->post_status && $title_before !== $title_after ) { 70 $changed = $title_before !== $title_after || $slug_before !== $slug_after; 71 72 // If a post is to remain published, but the title or slug has changed, update the term. 73 if ( $term_before && 'publish' === $post_after->post_status && $changed ) { 70 74 wp_update_term( 71 75 $term_before->term_id, … … 73 77 array( 74 78 'name' => $title_after, 75 'slug' => sanitize_title( $title_after ),79 'slug' => $slug_after, 76 80 ) 77 81 ); -
shadow-terms/trunk/plugin.php
r2825530 r2914474 3 3 * Plugin Name: Shadow Terms 4 4 * Description: Use terms from generated taxonomies to associate related content. 5 * Version: 1.0. 05 * Version: 1.0.1 6 6 * Plugin URI: https://github.com/happyprime/shadow-terms/ 7 7 * Author: Happy Prime -
shadow-terms/trunk/readme.txt
r2889495 r2914474 4 4 Requires at least: 5.9 5 5 Tested up to: 6.2 6 Stable tag: 1.0. 06 Stable tag: 1.0.1 7 7 License: GPLv2 or later 8 8 Requires PHP: 7.4 … … 41 41 ## Changelog 42 42 43 ### 1.0.1 44 45 * Fix: Ensure term and post slugs sync properly on post update. 46 43 47 ### 1.0.0 44 48
Note: See TracChangeset
for help on using the changeset viewer.