62 * The dynamic portion of the action hook, `$tab`, allows for targeting |
62 * The dynamic portion of the action hook, `$tab`, allows for targeting |
63 * individual tabs, for instance 'install_plugins_pre_plugin-information'. |
63 * individual tabs, for instance 'install_plugins_pre_plugin-information'. |
64 * |
64 * |
65 * @since 2.7.0 |
65 * @since 2.7.0 |
66 */ |
66 */ |
67 do_action( "install_plugins_pre_$tab" ); |
67 do_action( "install_plugins_pre_{$tab}" ); |
|
68 |
|
69 /* |
|
70 * Call the pre upload action on every non-upload plugin installation screen |
|
71 * because the form is always displayed on these screens. |
|
72 */ |
|
73 if ( 'upload' !== $tab ) { |
|
74 /** This action is documented in wp-admin/plugin-install.php */ |
|
75 do_action( 'install_plugins_pre_upload' ); |
|
76 } |
68 |
77 |
69 get_current_screen()->add_help_tab( array( |
78 get_current_screen()->add_help_tab( array( |
70 'id' => 'overview', |
79 'id' => 'overview', |
71 'title' => __('Overview'), |
80 'title' => __('Overview'), |
72 'content' => |
81 'content' => |
73 '<p>' . sprintf(__('Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href="%s" target="_blank">WordPress.org Plugin Directory</a> are compatible with the license WordPress uses. You can find new plugins to install by searching or browsing the Directory right here in your own Plugins section.'), 'https://wordpress.org/plugins/') . '</p>' |
82 '<p>' . sprintf( __('Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href="%s">WordPress Plugin Directory</a> are compatible with the license WordPress uses.' ), __( 'https://wordpress.org/plugins/' ) ) . '</p>' . |
|
83 '<p>' . __( 'You can find new plugins to install by searching or browsing the directory right here in your own Plugins section.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __( 'The search results will be updated as you type.' ) . '</span></p>' |
|
84 |
74 ) ); |
85 ) ); |
75 get_current_screen()->add_help_tab( array( |
86 get_current_screen()->add_help_tab( array( |
76 'id' => 'adding-plugins', |
87 'id' => 'adding-plugins', |
77 'title' => __('Adding Plugins'), |
88 'title' => __('Adding Plugins'), |
78 'content' => |
89 'content' => |
79 '<p>' . __('If you know what you’re looking for, Search is your best bet. The Search screen has options to search the WordPress.org Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting popular tags. Tags in larger type mean more plugins have been labeled with that tag.') . '</p>' . |
90 '<p>' . __('If you know what you’re looking for, Search is your best bet. The Search screen has options to search the WordPress Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting popular tags. Tags in larger type mean more plugins have been labeled with that tag.') . '</p>' . |
80 '<p>' . __('If you just want to get an idea of what’s available, you can browse Featured and Popular plugins by using the links in the upper left of the screen. These sections rotate regularly.') . '</p>' . |
91 '<p>' . __( 'If you just want to get an idea of what’s available, you can browse Featured and Popular plugins by using the links above the plugins list. These sections rotate regularly.' ) . '</p>' . |
81 '<p>' . __('You can also browse a user’s favorite plugins, by using the Favorites link in the upper left of the screen and entering their WordPress.org username.') . '</p>' . |
92 '<p>' . __( 'You can also browse a user’s favorite plugins, by using the Favorites link above the plugins list and entering their WordPress.org username.' ) . '</p>' . |
82 '<p>' . __('If you want to install a plugin that you’ve downloaded elsewhere, click the Upload link in the upper left. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.') . '</p>' |
93 '<p>' . __( 'If you want to install a plugin that you’ve downloaded elsewhere, click the Upload Plugin button above the plugins list. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.' ) . '</p>' |
83 ) ); |
94 ) ); |
84 |
95 |
85 get_current_screen()->set_help_sidebar( |
96 get_current_screen()->set_help_sidebar( |
86 '<p><strong>' . __('For more information:') . '</strong></p>' . |
97 '<p><strong>' . __('For more information:') . '</strong></p>' . |
87 '<p>' . __('<a href="https://codex.wordpress.org/Plugins_Add_New_Screen" target="_blank">Documentation on Installing Plugins</a>') . '</p>' . |
98 '<p>' . __('<a href="https://codex.wordpress.org/Plugins_Add_New_Screen">Documentation on Installing Plugins</a>') . '</p>' . |
88 '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
99 '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>' |
89 ); |
100 ); |
|
101 |
|
102 get_current_screen()->set_screen_reader_content( array( |
|
103 'heading_views' => __( 'Filter plugins list' ), |
|
104 'heading_pagination' => __( 'Plugins list navigation' ), |
|
105 'heading_list' => __( 'Plugins list' ), |
|
106 ) ); |
90 |
107 |
91 /** |
108 /** |
92 * WordPress Administration Template Header. |
109 * WordPress Administration Template Header. |
93 */ |
110 */ |
94 include(ABSPATH . 'wp-admin/admin-header.php'); |
111 include(ABSPATH . 'wp-admin/admin-header.php'); |
95 ?> |
112 ?> |
96 <div class="wrap"> |
113 <div class="wrap <?php echo esc_attr( "plugin-install-tab-$tab" ); ?>"> |
97 <h2> |
114 <h1 class="wp-heading-inline"><?php |
98 <?php |
115 echo esc_html( $title ); |
99 echo esc_html( $title ); |
116 ?></h1> |
100 if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_plugins' ) ) { |
|
101 if ( $tab === 'upload' ) { |
|
102 $href = self_admin_url( 'plugin-install.php' ); |
|
103 $text = _x( 'Browse', 'plugins' ); |
|
104 } else { |
|
105 $href = self_admin_url( 'plugin-install.php?tab=upload' ); |
|
106 $text = __( 'Upload Plugin' ); |
|
107 } |
|
108 echo ' <a href="' . $href . '" class="upload add-new-h2">' . $text . '</a>'; |
|
109 } |
|
110 ?> |
|
111 </h2> |
|
112 |
117 |
113 <?php |
118 <?php |
114 if ( $tab !== 'upload' ) { |
119 if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_plugins' ) ) { |
|
120 printf( ' <a href="%s" class="upload-view-toggle page-title-action"><span class="upload">%s</span><span class="browse">%s</span></a>', |
|
121 ( 'upload' === $tab ) ? self_admin_url( 'plugin-install.php' ) : self_admin_url( 'plugin-install.php?tab=upload' ), |
|
122 __( 'Upload Plugin' ), |
|
123 __( 'Browse Plugins' ) |
|
124 ); |
|
125 } |
|
126 ?> |
|
127 |
|
128 <hr class="wp-header-end"> |
|
129 |
|
130 <?php |
|
131 /* |
|
132 * Output the upload plugin form on every non-upload plugin installation screen, so it can be |
|
133 * displayed via JavaScript rather then opening up the devoted upload plugin page. |
|
134 */ |
|
135 if ( 'upload' !== $tab ) { |
|
136 ?> |
|
137 <div class="upload-plugin-wrap"> |
|
138 <?php |
|
139 /** This action is documented in wp-admin/plugin-install.php */ |
|
140 do_action( 'install_plugins_upload' ); |
|
141 ?> |
|
142 </div> |
|
143 <?php |
115 $wp_list_table->views(); |
144 $wp_list_table->views(); |
116 echo '<br class="clear" />'; |
145 echo '<br class="clear" />'; |
117 } |
146 } |
118 |
147 |
119 /** |
148 /** |