Plugin Directory

Changeset 2990082


Ignore:
Timestamp:
11/06/2023 04:13:18 PM (2 years ago)
Author:
webdevstudios
Message:

release 1.0.6

Location:
taxonomy-switcher
Files:
12 added
4 edited

Legend:

Unmodified
Added
Removed
  • taxonomy-switcher/trunk/Taxonomy_Switcher.php

    r2611773 r2990082  
    11<?php
     2
    23/**
    34 * Class Taxonomy_Switcher.
     
    5354     */
    5455    public $messages = [];
     56
     57    /**
     58     * Whether or not is our option page.
     59     *
     60     * @var bool
     61     */
     62    public $is_ui;
    5563
    5664    /**
     
    130138     *
    131139     * @param string $notice Notice to store and/or display.
     140     *
    132141     * @return array
    133142     */
     
    138147            echo $notice;
    139148        }
     149
    140150        return $this->notices;
    141151    }
     
    147157     *
    148158     * @param string $key Array key to retrieve.
     159     *
    149160     * @return mixed
    150161     */
     
    163174            'switched'        => sprintf( __( 'Taxonomies switched for %s!', 'wds' ), $count_name ),
    164175        ];
     176
    165177        return $this->messages[ $key ];
    166178    }
     
    182194        ];
    183195
    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        ] );
    185200
    186201        $terms = get_terms( $this->from, $args );
     
    249264        }
    250265
     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
    251285        return true;
    252286    }
  • taxonomy-switcher/trunk/Taxonomy_Switcher_UI.php

    r2611773 r2990082  
    8585        $this->admin_slug  = 'taxonomy-switcher';
    8686
    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, [
    8888            $this,
    8989            'do_page',
  • taxonomy-switcher/trunk/readme.txt

    r2914979 r2990082  
    11=== Taxonomy Switcher ===
    2 Contributors: webdevstudios, pluginize, sc0ttkclark, jtsternberg
     2Contributors: webdevstudios, pluginize
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3084056
    44Tags: taxonomy, taxonomies, term, terms, category, categories, convert, converter, tag, tags, custom taxonomy, custom taxonomies, switch taxonomies
    55Requires at least: 5.2
    6 Tested up to: 6.2.1
    7 Stable tag: 1.0.5
     6Tested up to: 6.4
     7Stable tag: 1.0.6
    88License: GNU AGPLv3
    99License URI: http://www.gnu.org/licenses/agpl-3.0.html
     
    4646== Changelog ==
    4747
     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
    4854= 1.0.5 =
    4955* Updated: Confirmed WP 6.2.1 compatibility.
  • taxonomy-switcher/trunk/taxonomy-switcher.php

    r2914979 r2990082  
    44Plugin URI: https://github.com/WebDevStudios/taxonomy-switcher
    55Description: Switches the Taxonomy of terms to a different Taxonomy
    6 Version: 1.0.5
     6Version: 1.0.6
    77Author: WebDevStudios
    88Author URI: http://webdevstudios.com
     
    1313 */
    1414class 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;
    1525
    1626    /**
Note: See TracChangeset for help on using the changeset viewer.