15
15
require_once( dirname( __FILE__ ) . '/admin.php' );
17
17
if ( ! current_user_can('install_plugins') )
18
wp_die(__('You do not have sufficient permissions to install plugins on this site.'));
18
wp_die(__('Sorry, you are not allowed to install plugins on this site.'));
20
20
if ( is_multisite() && ! is_network_admin() ) {
21
21
wp_redirect( network_admin_url( 'plugin-install.php' ) );
67
67
do_action( "install_plugins_pre_$tab" );
70
* Call the pre upload action on every non-upload plugin install screen
71
* because the form is always displayed on these screens.
73
if ( 'upload' !== $tab ) {
74
/** This action is documented in wp-admin/plugin-install.php */
75
do_action( 'install_plugins_pre_upload' );
69
78
get_current_screen()->add_help_tab( array(
70
79
'id' => 'overview',
71
80
'title' => __('Overview'),
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" target="_blank">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>'
75
86
get_current_screen()->add_help_tab( array(
76
87
'id' => 'adding-plugins',
77
88
'title' => __('Adding Plugins'),
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>' .
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>' .
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>' .
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>'
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>' .
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>' .
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>' .
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>'
85
96
get_current_screen()->set_help_sidebar(
100
111
include(ABSPATH . 'wp-admin/admin-header.php');
113
<div class="wrap <?php echo esc_attr( "plugin-install-tab-$tab" ); ?>">
105
116
echo esc_html( $title );
106
117
if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_plugins' ) ) {
107
if ( $tab === 'upload' ) {
108
$href = self_admin_url( 'plugin-install.php' );
109
$text = _x( 'Browse', 'plugins' );
111
$href = self_admin_url( 'plugin-install.php?tab=upload' );
112
$text = __( 'Upload Plugin' );
114
echo ' <a href="' . $href . '" class="upload page-title-action">' . $text . '</a>';
118
printf( ' <a href="%s" class="upload-view-toggle page-title-action"><span class="upload">%s</span><span class="browse">%s</span></a>',
119
( 'upload' === $tab ) ? self_admin_url( 'plugin-install.php' ) : self_admin_url( 'plugin-install.php?tab=upload' ),
120
__( 'Upload Plugin' ),
121
__( 'Browse Plugins' )
129
* Output the upload plugin form on every non-upload plugin install screen, so it can be
130
* displayed via JavaScript rather then opening up the devoted upload plugin page.
132
if ( $tab !== 'upload' ) {
134
<div class="upload-plugin-wrap">
136
/** This action is documented in wp-admin/plugin-install.php */
137
do_action( 'install_plugins_upload' );
120
143
if ( $tab !== 'upload' ) {
121
144
$wp_list_table->views();
122
145
echo '<br class="clear" />';
133
156
* @param int $paged The current page number of the plugins list table.
135
158
do_action( "install_plugins_$tab", $paged ); ?>
160
<span class="spinner"></span>
139
164
wp_print_request_filesystem_credentials_modal();
165
wp_print_admin_notice_templates();
142
168
* WordPress Administration Template Footer.