Changeset 2570566
- Timestamp:
- 07/23/2021 05:29:52 AM (4 years ago)
- Location:
- wp-term-manager/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-term-manager/trunk/includes/Settings.php
r2169149 r2570566 19 19 20 20 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' ] ); 25 25 } 26 26 … … 29 29 */ 30 30 public function register_options() { 31 $primary = array(31 $primary = [ 32 32 'id' => 'wptm_settings', 33 33 'menu_title' => __( 'WP Term Manager', 'wptm' ), 34 'object_types' => array( 'options-page' ),34 'object_types' => [ 'options-page' ], 35 35 'option_key' => 'wptm_settings', 36 36 'parent_slug' => 'tools.php' 37 );37 ]; 38 38 39 39 $primary_options = new_cmb2_box( $primary ); 40 40 41 41 $primary_options->add_field( 42 array(42 [ 43 43 'name' => __( 'Exclude Terms', 'wptm' ), 44 44 'desc' => __( 'Choose which terms to hide from being displayed.', 'wptm' ), … … 46 46 'id' => 'exclude', 47 47 'render_row_cb' => [ $this, 'exclude_field' ] 48 )48 ] 49 49 ); 50 50 51 51 $primary_options->add_field( 52 array(52 [ 53 53 'name' => __( 'Remove Plugin', 'wptm' ), 54 54 'desc' => __( 'Remove all plugin data from database on uninstall.', 'wptm' ), 55 55 'type' => 'checkbox', 56 56 'id' => 'clean_db' 57 )57 ] 58 58 ); 59 59 } … … 108 108 public function exclude_options() { 109 109 $taxonomies = get_taxonomies(); 110 $args = array(110 $args = [ 111 111 'taxonomy' => $taxonomies, 112 112 'hide_empty' => false, 113 113 'orderby' => 'term_group' 114 );114 ]; 115 115 116 116 $terms = get_terms( $args ); … … 139 139 * @return string|void 140 140 */ 141 public function exclude_ categories( $exclusions, $args ) {141 public function exclude_terms( $exclusions, $args ) { 142 142 143 143 if ( ! is_admin() ) { -
wp-term-manager/trunk/readme.txt
r2169149 r2570566 4 4 Tags: terms, categories, category, tags, tag, manager 5 5 Requires at least: 3.9 6 Tested up to: 5. 36 Tested up to: 5.8 7 7 Requires PHP: 5.6 8 Stable tag: 1.0. 08 Stable tag: 1.0.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 31 31 32 32 == Changelog == 33 = 1.0.1 - 07-22-2021 = 34 * Code cleanup. 35 * Confirm plugin is still awesome. 33 36 = 1.0.0 - 09-30-2019 = 34 37 * Initial release.
Note: See TracChangeset
for help on using the changeset viewer.