Changeset 1686878
- Timestamp:
- 06/28/2017 11:06:29 AM (8 years ago)
- File:
-
- 1 edited
-
extended-wp-reset/trunk/extended-wp-reset.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
extended-wp-reset/trunk/extended-wp-reset.php
r1684893 r1686878 67 67 require_once( ABSPATH . 'wp-includes/pluggable.php' ); 68 68 } 69 if( current_user_can( 'remove_users' ) ) { 70 71 $network = ( is_network_admin() ? 'network_' : '' ); 72 add_action( "{$network}admin_menu", array( $this, 'addPluginPage' ), 0 ); 73 add_action( 'admin_init', array( $this, 'resetWP' ), 0 ); 74 add_action( 'init', array( $this, 'loadTextDomain' ) ); 75 } 69 70 $network = ( is_network_admin() ? 'network_' : '' ); 71 add_action( "{$network}admin_menu", array( $this, 'addPluginPage' ), 0 ); 72 add_action( 'admin_init', array( $this, 'resetWP' ), 0 ); 73 add_action( 'init', array( $this, 'loadTextDomain' ) ); 76 74 } 77 75 … … 90 88 public function addPluginPage() 91 89 { 92 $name = esc_html( __('Extended WP Reset', 'extended-wp-reset' ) ); 93 $page = add_menu_page( $name, $name, $this->isWPMU() ? self::NETWORK_ADMIN_CAP : self::ADMIN_CAP, self::BASE_SLUG, array( $this, 'render_plugin_options_page' ), 'dashicons-admin-generic' ); 94 array_push( $this->_pages, $page ); 90 if( current_user_can( 'remove_users' ) ) { 91 $name = esc_html( __('Extended WP Reset', 'extended-wp-reset' ) ); 92 $page = add_menu_page( $name, $name, $this->isWPMU() ? self::NETWORK_ADMIN_CAP : self::ADMIN_CAP, self::BASE_SLUG, array( $this, 'render_plugin_options_page' ), 'dashicons-admin-generic' ); 93 array_push( $this->_pages, $page ); 94 } 95 95 } 96 96 … … 100 100 public function render_plugin_options_page() 101 101 { 102 $filePath = plugin_dir_path( __FILE__ ) . 'inc/index.php'; 103 if ( is_file( $filePath ) && is_readable( $filePath ) ) { 104 wp_enqueue_script( 'jquery' ); 105 wp_enqueue_script( 'wp-reset-js', plugin_dir_url( __FILE__ ) . 'res/admin.js', array( 'jquery' ) ); 106 require( $filePath ); 102 if( current_user_can( 'remove_users' ) ) { 103 $filePath = plugin_dir_path( __FILE__ ) . 'inc/index.php'; 104 if ( is_file( $filePath ) && is_readable( $filePath ) ) { 105 wp_enqueue_script( 'jquery' ); 106 wp_enqueue_script( 'wp-reset-js', plugin_dir_url( __FILE__ ) . 'res/admin.js', array( 'jquery' ) ); 107 require( $filePath ); 108 } 107 109 } 108 110 }
Note: See TracChangeset
for help on using the changeset viewer.