45 if ( $pagenum > $total_pages && $total_pages > 0 ) { |
45 if ( $pagenum > $total_pages && $total_pages > 0 ) { |
46 wp_redirect( add_query_arg( 'paged', $total_pages ) ); |
46 wp_redirect( add_query_arg( 'paged', $total_pages ) ); |
47 exit; |
47 exit; |
48 } |
48 } |
49 |
49 |
|
50 // Used in the HTML title tag. |
50 $title = __( 'Add Plugins' ); |
51 $title = __( 'Add Plugins' ); |
51 $parent_file = 'plugins.php'; |
52 $parent_file = 'plugins.php'; |
52 |
53 |
53 wp_enqueue_script( 'plugin-install' ); |
54 wp_enqueue_script( 'plugin-install' ); |
54 if ( 'plugin-information' != $tab ) { |
55 if ( 'plugin-information' !== $tab ) { |
55 add_thickbox(); |
56 add_thickbox(); |
56 } |
57 } |
57 |
58 |
58 $body_id = $tab; |
59 $body_id = $tab; |
59 |
60 |
60 wp_enqueue_script( 'updates' ); |
61 wp_enqueue_script( 'updates' ); |
61 |
62 |
62 /** |
63 /** |
63 * Fires before each tab on the Install Plugins screen is loaded. |
64 * Fires before each tab on the Install Plugins screen is loaded. |
64 * |
65 * |
65 * The dynamic portion of the action hook, `$tab`, allows for targeting |
66 * The dynamic portion of the hook name, `$tab`, allows for targeting |
66 * individual tabs, for instance 'install_plugins_pre_plugin-information'. |
67 * individual tabs. |
|
68 * |
|
69 * Possible hook names include: |
|
70 * |
|
71 * - `install_plugins_pre_beta` |
|
72 * - `install_plugins_pre_favorites` |
|
73 * - `install_plugins_pre_featured` |
|
74 * - `install_plugins_pre_plugin-information` |
|
75 * - `install_plugins_pre_popular` |
|
76 * - `install_plugins_pre_recommended` |
|
77 * - `install_plugins_pre_search` |
|
78 * - `install_plugins_pre_upload` |
67 * |
79 * |
68 * @since 2.7.0 |
80 * @since 2.7.0 |
69 */ |
81 */ |
70 do_action( "install_plugins_pre_{$tab}" ); |
82 do_action( "install_plugins_pre_{$tab}" ); |
71 |
83 |
95 get_current_screen()->add_help_tab( |
107 get_current_screen()->add_help_tab( |
96 array( |
108 array( |
97 'id' => 'adding-plugins', |
109 'id' => 'adding-plugins', |
98 'title' => __( 'Adding Plugins' ), |
110 'title' => __( 'Adding Plugins' ), |
99 'content' => |
111 'content' => |
100 '<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>' . |
112 '<p>' . __( 'If you know what you are 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>' . |
101 '<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>' . |
113 '<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>' . |
102 '<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>' . |
114 '<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>' . |
103 '<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>', |
115 '<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>', |
104 ) |
116 ) |
105 ); |
117 ); |
161 } |
173 } |
162 |
174 |
163 /** |
175 /** |
164 * Fires after the plugins list table in each tab of the Install Plugins screen. |
176 * Fires after the plugins list table in each tab of the Install Plugins screen. |
165 * |
177 * |
166 * The dynamic portion of the action hook, `$tab`, allows for targeting |
178 * The dynamic portion of the hook name, `$tab`, allows for targeting |
167 * individual tabs, for instance 'install_plugins_plugin-information'. |
179 * individual tabs. |
|
180 * |
|
181 * Possible hook names include: |
|
182 * |
|
183 * - `install_plugins_beta` |
|
184 * - `install_plugins_favorites` |
|
185 * - `install_plugins_featured` |
|
186 * - `install_plugins_plugin-information` |
|
187 * - `install_plugins_popular` |
|
188 * - `install_plugins_recommended` |
|
189 * - `install_plugins_search` |
|
190 * - `install_plugins_upload` |
168 * |
191 * |
169 * @since 2.7.0 |
192 * @since 2.7.0 |
170 * |
193 * |
171 * @param int $paged The current page number of the plugins list table. |
194 * @param int $paged The current page number of the plugins list table. |
172 */ |
195 */ |