Changeset 12507 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
- Timestamp:
- 03/29/2023 08:31:18 AM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
r12492 r12507 38 38 add_action( 'all_admin_notices', array( $this, 'admin_notices' ) ); 39 39 add_filter( 'display_post_states', array( $this, 'post_states' ), 10, 2 ); 40 add_action( 'admin_menu', array( $this, 'admin_menu' ), 9 ); 40 41 41 42 add_filter( 'wp_insert_post_data', array( $this, 'check_existing_plugin_slug_on_post_update' ), 10, 2 ); … … 141 142 } 142 143 } 144 } 145 146 /** 147 * Add the Repo Tools menu item to the admin menu. 148 */ 149 public function admin_menu() { 150 add_menu_page( 151 __( 'Plugin Tools', 'wporg-plugins' ), 152 __( 'Plugin Tools', 'wporg-plugins' ), 153 'plugin_review', 154 'plugin-tools', 155 array( $this, 'plugin_tools_page' ), 156 'dashicons-admin-tools', 157 30 158 ); 159 } 160 161 /** 162 * Render the Repo Tools dashboard page, just a basic list of the menu items. 163 */ 164 public function plugin_tools_page() { 165 global $submenu; 166 ?> 167 <div class="wrap"> 168 <h1><?php _e( 'Plugin Tools', 'wporg-plugins' ); ?></h1> 169 <ul> 170 <?php 171 foreach ( $submenu['plugin-tools'] ?? [] as $page ) { 172 if ( 'plugin-tools' === $page[2] ) { 173 continue; 174 } 175 176 printf( 177 '<li><a href="%s">%s</a></li>', 178 esc_url( admin_url( 'admin.php?page=' . $page[2] ) ), 179 esc_html( $page[0] ) 180 ); 181 } 182 ?> 183 </ul> 184 </div> 185 <?php 143 186 } 144 187
Note: See TracChangeset
for help on using the changeset viewer.