Plugin Directory

Changeset 2570566


Ignore:
Timestamp:
07/23/2021 05:29:52 AM (4 years ago)
Author:
landonbotis
Message:

Code cleanup and confirmed still working great with WordPress 5.8

Location:
wp-term-manager/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-term-manager/trunk/includes/Settings.php

    r2169149 r2570566  
    1919
    2020    protected function __construct() {
    21         add_action( 'cmb2_admin_init', array( $this, 'register_options' ) );
    22         add_action( 'cmb2_admin_init', array( $this, 'clean_db' ) );
    23         add_filter( 'list_terms_exclusions', array( $this, 'exclude_categories' ), 10, 2 );
    24         add_action( 'admin_footer', array( $this, 'admin_scripts' ) );
     21        add_action( 'cmb2_admin_init', [ $this, 'register_options' ] );
     22        add_action( 'cmb2_admin_init', [ $this, 'clean_db' ] );
     23        add_filter( 'list_terms_exclusions', [ $this, 'exclude_terms' ], 10, 2 );
     24        add_action( 'admin_footer', [ $this, 'admin_scripts' ] );
    2525    }
    2626
     
    2929     */
    3030    public function register_options() {
    31         $primary = array(
     31        $primary = [
    3232            'id'           => 'wptm_settings',
    3333            'menu_title'   => __( 'WP Term Manager', 'wptm' ),
    34             'object_types' => array( 'options-page' ),
     34            'object_types' => [ 'options-page' ],
    3535            'option_key'   => 'wptm_settings',
    3636            'parent_slug'  => 'tools.php'
    37         );
     37        ];
    3838
    3939        $primary_options = new_cmb2_box( $primary );
    4040
    4141        $primary_options->add_field(
    42             array(
     42            [
    4343                'name'          => __( 'Exclude Terms', 'wptm' ),
    4444                'desc'          => __( 'Choose which terms to hide from being displayed.', 'wptm' ),
     
    4646                'id'            => 'exclude',
    4747                'render_row_cb' => [ $this, 'exclude_field' ]
    48             )
     48            ]
    4949        );
    5050
    5151        $primary_options->add_field(
    52             array(
     52            [
    5353                'name' => __( 'Remove Plugin', 'wptm' ),
    5454                'desc' => __( 'Remove all plugin data from database on uninstall.', 'wptm' ),
    5555                'type' => 'checkbox',
    5656                'id'   => 'clean_db'
    57             )
     57            ]
    5858        );
    5959    }
     
    108108    public function exclude_options() {
    109109        $taxonomies = get_taxonomies();
    110         $args       = array(
     110        $args       = [
    111111            'taxonomy'   => $taxonomies,
    112112            'hide_empty' => false,
    113113            'orderby'    => 'term_group'
    114         );
     114        ];
    115115
    116116        $terms = get_terms( $args );
     
    139139     * @return string|void
    140140     */
    141     public function exclude_categories( $exclusions, $args ) {
     141    public function exclude_terms( $exclusions, $args ) {
    142142
    143143        if ( ! is_admin() ) {
  • wp-term-manager/trunk/readme.txt

    r2169149 r2570566  
    44Tags: terms, categories, category, tags, tag, manager
    55Requires at least: 3.9
    6 Tested up to: 5.3
     6Tested up to: 5.8
    77Requires PHP: 5.6
    8 Stable tag: 1.0.0
     8Stable tag: 1.0.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3131
    3232== Changelog ==
     33= 1.0.1 - 07-22-2021 =
     34* Code cleanup.
     35* Confirm plugin is still awesome.
    3336= 1.0.0 - 09-30-2019 =
    3437* Initial release.
Note: See TracChangeset for help on using the changeset viewer.