Changeset 2990082
- Timestamp:
- 11/06/2023 04:13:18 PM (2 years ago)
- Location:
- taxonomy-switcher
- Files:
-
- 12 added
- 4 edited
-
tags/1.0.6 (added)
-
tags/1.0.6/LICENSE (added)
-
tags/1.0.6/README.md (added)
-
tags/1.0.6/Taxonomy_Switcher.php (added)
-
tags/1.0.6/Taxonomy_Switcher_UI.php (added)
-
tags/1.0.6/js (added)
-
tags/1.0.6/js/taxonomy-switcher.js (added)
-
tags/1.0.6/readme.txt (added)
-
tags/1.0.6/screenshot-1.png (added)
-
tags/1.0.6/screenshot-2.png (added)
-
tags/1.0.6/taxonomy-switcher.php (added)
-
tags/1.0.6/wp-cli.php (added)
-
trunk/Taxonomy_Switcher.php (modified) (8 diffs)
-
trunk/Taxonomy_Switcher_UI.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/taxonomy-switcher.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
taxonomy-switcher/trunk/Taxonomy_Switcher.php
r2611773 r2990082 1 1 <?php 2 2 3 /** 3 4 * Class Taxonomy_Switcher. … … 53 54 */ 54 55 public $messages = []; 56 57 /** 58 * Whether or not is our option page. 59 * 60 * @var bool 61 */ 62 public $is_ui; 55 63 56 64 /** … … 130 138 * 131 139 * @param string $notice Notice to store and/or display. 140 * 132 141 * @return array 133 142 */ … … 138 147 echo $notice; 139 148 } 149 140 150 return $this->notices; 141 151 } … … 147 157 * 148 158 * @param string $key Array key to retrieve. 159 * 149 160 * @return mixed 150 161 */ … … 163 174 'switched' => sprintf( __( 'Taxonomies switched for %s!', 'wds' ), $count_name ), 164 175 ]; 176 165 177 return $this->messages[ $key ]; 166 178 } … … 182 194 ]; 183 195 184 $args = apply_filters( 'taxonomy_switcher_get_terms_args', $args, $this->from, $this->to, [ 'parent' => $this->parent, 'terms' => $this->terms ] ); 196 $args = apply_filters( 'taxonomy_switcher_get_terms_args', $args, $this->from, $this->to, [ 197 'parent' => $this->parent, 198 'terms' => $this->terms 199 ] ); 185 200 186 201 $terms = get_terms( $this->from, $args ); … … 249 264 } 250 265 266 $post_ids = $wpdb->get_col( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_menu_item_object_id' AND meta_value IN ( {$term_ids} );" ); 267 update_postmeta_cache( $post_ids ); 268 foreach ( $post_ids as $post_id ) { 269 $type = get_post_meta( $post_id, '_menu_item_type', true ); 270 $object = get_post_meta( $post_id, '_menu_item_object', true ); 271 if ( 'taxonomy' !== $type ) { 272 continue; 273 } 274 if ( $this->from !== $object ) { 275 continue; 276 } 277 update_post_meta( $post_id, '_menu_item_object', $this->to ); 278 clean_post_cache( $post_id ); 279 } 280 281 // Clean term caches 282 clean_term_cache( $term_ids, $this->from ); 283 clean_term_cache( $term_ids, $this->to ); 284 251 285 return true; 252 286 } -
taxonomy-switcher/trunk/Taxonomy_Switcher_UI.php
r2611773 r2990082 85 85 $this->admin_slug = 'taxonomy-switcher'; 86 86 87 $this->options_page = add_management_page( $this->admin_title, $this->admin_title, 'manage_ categories', $this->admin_slug, [87 $this->options_page = add_management_page( $this->admin_title, $this->admin_title, 'manage_options', $this->admin_slug, [ 88 88 $this, 89 89 'do_page', -
taxonomy-switcher/trunk/readme.txt
r2914979 r2990082 1 1 === Taxonomy Switcher === 2 Contributors: webdevstudios, pluginize , sc0ttkclark, jtsternberg2 Contributors: webdevstudios, pluginize 3 3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3084056 4 4 Tags: taxonomy, taxonomies, term, terms, category, categories, convert, converter, tag, tags, custom taxonomy, custom taxonomies, switch taxonomies 5 5 Requires at least: 5.2 6 Tested up to: 6. 2.17 Stable tag: 1.0. 56 Tested up to: 6.4 7 Stable tag: 1.0.6 8 8 License: GNU AGPLv3 9 9 License URI: http://www.gnu.org/licenses/agpl-3.0.html … … 46 46 == Changelog == 47 47 48 = 1.0.6 = 49 * Updated: Confirmed WP 6.4 compatibility. 50 * Updated: Moved capability back to manage_options to sync with options page. 51 * Updated: Clear caches after conversion. 52 * Fixed: PHP8 deprecation notices. 53 48 54 = 1.0.5 = 49 55 * Updated: Confirmed WP 6.2.1 compatibility. -
taxonomy-switcher/trunk/taxonomy-switcher.php
r2914979 r2990082 4 4 Plugin URI: https://github.com/WebDevStudios/taxonomy-switcher 5 5 Description: Switches the Taxonomy of terms to a different Taxonomy 6 Version: 1.0. 56 Version: 1.0.6 7 7 Author: WebDevStudios 8 8 Author URI: http://webdevstudios.com … … 13 13 */ 14 14 class Taxonomy_Switcher_Init { 15 16 /** 17 * @var Taxonomy_Switcher_UI 18 */ 19 private Taxonomy_Switcher_UI $ui; 20 21 /** 22 * @var mixed 23 */ 24 private $notices; 15 25 16 26 /**
Note: See TracChangeset
for help on using the changeset viewer.