Changeset 12507 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-author-cards.php
- Timestamp:
- 03/29/2023 08:31:18 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-author-cards.php
r7310 r12507 4 4 use WordPressdotorg\Plugin_Directory; 5 5 use WordPressdotorg\Plugin_Directory\Admin\Metabox\Author_Card; 6 use const WordPressdotorg\Plugin_Directory\PLUGIN_FILE; 6 7 7 8 /** … … 26 27 private function __construct() { 27 28 add_action( 'admin_menu', array( $this, 'add_to_menu' ) ); 28 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );29 29 } 30 30 31 31 /** 32 * Enqueue JS and CSS assets needed for any wp-admin screens. 33 * 34 * @param string $hook_suffix The hook suffix of the current screen. 32 * Add the Author Cards tool to the Tools menu. 35 33 */ 36 public function enqueue_assets( $hook_suffix ) {37 switch ( $hook_suffix ) {38 case 'tools_page_authorcards':39 wp_enqueue_style( 'plugin-admin-post-css', plugins_url( 'css/edit-form.css', Plugin_Directory\PLUGIN_FILE ), array( 'edit' ), 5 );40 break;41 }42 }43 44 34 public function add_to_menu() { 45 add_submenu_page(46 ' tools.php',35 $hook = add_submenu_page( 36 'plugin-tools', 47 37 __( 'Author Cards', 'wporg-plugins' ), 48 38 __( 'Author Cards', 'wporg-plugins' ), … … 51 41 array( $this, 'show_form' ) 52 42 ); 43 44 add_action( "admin_print_styles-{$hook}", array( $this, 'enqueue_assets' ) ); 53 45 } 54 46 47 /** 48 * Enqueue JS and CSS assets needed for any wp-admin screens. 49 */ 50 public function enqueue_assets() { 51 wp_enqueue_style( 'plugin-admin-post-css', plugins_url( 'css/edit-form.css', PLUGIN_FILE ), array( 'edit' ), 5 ); 52 } 53 54 /** 55 * Display the Author Cards tool. 56 */ 55 57 public function show_form() { 56 58 if ( ! current_user_can( 'plugin_review' ) ) {
Note: See TracChangeset
for help on using the changeset viewer.