~canonical-sysadmins/wordpress/4.8.1

« back to all changes in this revision

Viewing changes to wp-admin/plugin-install.php

  • Committer: Barry Price
  • Date: 2016-08-17 04:50:12 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: barry.price@canonical.com-20160817045012-qfui81zhqnqv2ba9
Merge WP4.6 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
require_once( dirname( __FILE__ ) . '/admin.php' );
16
16
 
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.'));
19
19
 
20
20
if ( is_multisite() && ! is_network_admin() ) {
21
21
        wp_redirect( network_admin_url( 'plugin-install.php' ) );
66
66
 */
67
67
do_action( "install_plugins_pre_$tab" );
68
68
 
 
69
/*
 
70
 * Call the pre upload action on every non-upload plugin install 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
}
 
77
 
69
78
get_current_screen()->add_help_tab( array(
70
79
'id'            => 'overview',
71
80
'title'         => __('Overview'),
72
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" 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>'
 
84
 
74
85
) );
75
86
get_current_screen()->add_help_tab( array(
76
87
'id'            => 'adding-plugins',
77
88
'title'         => __('Adding Plugins'),
78
89
'content'       =>
79
 
        '<p>' . __('If you know what you&#8217;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&#8217;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&#8217;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&#8217;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&#8217;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&#8217;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&#8217;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&#8217;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
96
get_current_screen()->set_help_sidebar(
99
110
 */
100
111
include(ABSPATH . 'wp-admin/admin-header.php');
101
112
?>
102
 
<div class="wrap">
 
113
<div class="wrap <?php echo esc_attr( "plugin-install-tab-$tab" ); ?>">
103
114
<h1>
104
115
        <?php
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' );
110
 
                } else {
111
 
                        $href = self_admin_url( 'plugin-install.php?tab=upload' );
112
 
                        $text = __( 'Upload Plugin' );
113
 
                }
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' )
 
122
                );
115
123
        }
116
124
        ?>
117
125
</h1>
118
126
 
119
127
<?php
 
128
/*
 
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.
 
131
 */
 
132
if ( $tab !== 'upload' ) {
 
133
        ?>
 
134
        <div class="upload-plugin-wrap">
 
135
                <?php
 
136
                /** This action is documented in wp-admin/plugin-install.php */
 
137
                do_action( 'install_plugins_upload' );
 
138
                ?>
 
139
        </div>
 
140
        <?php
 
141
}
 
142
 
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.
134
157
 */
135
158
do_action( "install_plugins_$tab", $paged ); ?>
 
159
 
 
160
        <span class="spinner"></span>
136
161
</div>
137
162
 
138
163
<?php
139
164
wp_print_request_filesystem_credentials_modal();
 
165
wp_print_admin_notice_templates();
140
166
 
141
167
/**
142
168
 * WordPress Administration Template Footer.