Changeset 2776
- Timestamp:
- 03/21/2016 10:41:10 PM (9 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php
r2752 r2776 2 2 namespace WordPressdotorg\Plugin_Directory\Admin; 3 3 use \WordPressdotorg\Plugin_Directory; 4 use \WordPressdotorg\Plugin_Directory\Admin\List_Table\Plugin_Posts; 4 5 5 6 /** … … 30 31 31 32 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) ); 33 add_filter( 'admin_head-edit.php', array( $this, 'plugin_posts_list_table' ) ); 32 34 33 35 add_action( 'wp_ajax_replyto-comment', array( $this, 'save_custom_comment' ), 0 ); … … 65 67 global $post_type; 66 68 67 if ( 'post.php' === $hook_suffix && 'plugin' === $post_type ) { 68 wp_enqueue_style( 'plugin-admin-edit-css', plugins_url( 'css/edit-form.css', Plugin_Directory\PLUGIN_FILE ), array( 'edit' ), 1 ); 69 wp_enqueue_script( 'plugin-admin-edit-js', plugins_url( 'js/edit-form.js', Plugin_Directory\PLUGIN_FILE ), array( 'wp-util', 'wp-lists' ), 1 ); 70 wp_localize_script( 'plugin-admin-edit-js', 'pluginDirectory', array( 71 'removeCommitterAYS' => __( 'Are you sure you want to remove this committer?', 'wporg-plugins' ), 72 ) ); 69 if ( 'plugin' === $post_type ) { 70 switch ( $hook_suffix ) { 71 case 'post.php': 72 wp_enqueue_style( 'plugin-admin-post-css', plugins_url( 'css/edit-form.css', Plugin_Directory\PLUGIN_FILE ), array( 'edit' ), 1 ); 73 wp_enqueue_script( 'plugin-admin-post-js', plugins_url( 'js/edit-form.js', Plugin_Directory\PLUGIN_FILE ), array( 'wp-util', 'wp-lists' ), 1 ); 74 wp_localize_script( 'plugin-admin-post-js', 'pluginDirectory', array( 75 'removeCommitterAYS' => __( 'Are you sure you want to remove this committer?', 'wporg-plugins' ), 76 ) ); 77 break; 78 79 case 'edit.php': 80 wp_enqueue_style( 'plugin-admin-edit-css', plugins_url( 'css/plugin-list.css', Plugin_Directory\PLUGIN_FILE ), array(), 1 ); 81 break; 82 } 83 } 84 } 85 86 /** 87 * Replaces the WP_Posts_List_Table object with the extended Plugin_Posts list table object. 88 * 89 * @global string $post_type The current post type. 90 * @global \WP_Posts_List_Table $wp_list_table The WP_Posts_List_Table object. 91 */ 92 public function plugin_posts_list_table() { 93 global $post_type, $wp_list_table; 94 95 if ( 'plugin' === $post_type ) { 96 $wp_list_table = new Plugin_Posts(); 73 97 } 74 98 }
Note: See TracChangeset
for help on using the changeset viewer.