diff --git wp-admin/includes/plugin-install.php wp-admin/includes/plugin-install.php
index e1c1ec0..703bbbd 100644
|
|
|
|
| 22 | 22 | * |
| 23 | 23 | * @since 2.7.0 |
| 24 | 24 | * |
| 25 | | * @param string $action |
| 26 | | * @param array|object $args Optional. Arguments to serialize for the Plugin Info API. |
| | 25 | * @param string $action Requested information. |
| | 26 | * @param array|object $args Optional. Arguments to serialize for the Plugin Info API. |
| 27 | 27 | * @return object plugins_api response object on success, WP_Error on failure. |
| 28 | 28 | */ |
| 29 | 29 | function plugins_api($action, $args = null) { |
| … |
… |
function plugins_api($action, $args = null) {
|
| 34 | 34 | if ( !isset($args->per_page) ) |
| 35 | 35 | $args->per_page = 24; |
| 36 | 36 | |
| 37 | | // Allows a plugin to override the WordPress.org API entirely. |
| 38 | | // Use the filter 'plugins_api_result' to merely add results. |
| 39 | | // Please ensure that a object is returned from the following filters. |
| | 37 | /** |
| | 38 | * Override the Plugin API arguments. |
| | 39 | * |
| | 40 | * Please ensure that an object is returned. |
| | 41 | * |
| | 42 | * @since 2.7.0 |
| | 43 | * |
| | 44 | * @param object $args Plugin API arguments. |
| | 45 | * @param string $action Requested information. |
| | 46 | */ |
| 40 | 47 | $args = apply_filters('plugins_api_args', $args, $action); |
| | 48 | |
| | 49 | /** |
| | 50 | * Allows a plugin to override the WordPress.org API entirely. |
| | 51 | * |
| | 52 | * Please ensure that an object is returned. |
| | 53 | * |
| | 54 | * @since 2.7.0 |
| | 55 | * |
| | 56 | * @param bool|object The result object. Default is false. |
| | 57 | * @param string $action Requested information. |
| | 58 | * @param object $args Plugin API arguments. |
| | 59 | */ |
| 41 | 60 | $res = apply_filters('plugins_api', false, $action, $args); |
| 42 | 61 | |
| 43 | 62 | if ( false === $res ) { |
| … |
… |
function plugins_api($action, $args = null) {
|
| 64 | 83 | $res->external = true; |
| 65 | 84 | } |
| 66 | 85 | |
| | 86 | /** |
| | 87 | * Merely add a result. |
| | 88 | * |
| | 89 | * @since 2.7.0 |
| | 90 | * |
| | 91 | * @param object $res Response object or WP_Error. |
| | 92 | * @param string $action Requested information. |
| | 93 | * @param object $args Plugin API arguments. |
| | 94 | */ |
| 67 | 95 | return apply_filters('plugins_api_result', $res, $action, $args); |
| 68 | 96 | } |
| 69 | 97 | |
| … |
… |
function plugins_api($action, $args = null) {
|
| 73 | 101 | * @since 2.7.0 |
| 74 | 102 | * |
| 75 | 103 | * @param array $args |
| 76 | | * @return array |
| | 104 | * @return array Popular tags. |
| 77 | 105 | */ |
| 78 | 106 | function install_popular_tags( $args = array() ) { |
| 79 | 107 | $key = md5(serialize($args)); |
| … |
… |
function install_popular_tags( $args = array() ) {
|
| 90 | 118 | return $tags; |
| 91 | 119 | } |
| 92 | 120 | |
| | 121 | /** |
| | 122 | * Display dashboard for the 'Install Plugins' page. |
| | 123 | * |
| | 124 | * @since 2.7.0 |
| | 125 | * |
| | 126 | */ |
| 93 | 127 | function install_dashboard() { |
| 94 | 128 | ?> |
| 95 | 129 | <p><?php printf( __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%1$s">WordPress Plugin Directory</a> or upload a plugin in .zip format via <a href="%2$s">this page</a>.' ), 'http://wordpress.org/plugins/', self_admin_url( 'plugin-install.php?tab=upload' ) ); ?></p> |
| … |
… |
add_action('install_plugins_dashboard', 'install_dashboard');
|
| 125 | 159 | * Display search form for searching plugins. |
| 126 | 160 | * |
| 127 | 161 | * @since 2.7.0 |
| | 162 | * |
| | 163 | * @param bool $type_selector Choose a search type. Default is true. |
| 128 | 164 | */ |
| 129 | 165 | function install_search_form( $type_selector = true ) { |
| 130 | 166 | $type = isset($_REQUEST['type']) ? wp_unslash( $_REQUEST['type'] ) : 'term'; |
| … |
… |
function install_search_form( $type_selector = true ) {
|
| 147 | 183 | |
| 148 | 184 | /** |
| 149 | 185 | * Upload from zip |
| | 186 | * |
| 150 | 187 | * @since 2.8.0 |
| 151 | 188 | * |
| 152 | | * @param string $page |
| | 189 | * @param string $page Currently unused. |
| 153 | 190 | */ |
| 154 | 191 | function install_plugins_upload( $page = 1 ) { |
| 155 | 192 | ?> |
| … |
… |
add_action('install_plugins_upload', 'install_plugins_upload', 10, 1);
|
| 167 | 204 | |
| 168 | 205 | /** |
| 169 | 206 | * Show a username form for the favorites page |
| | 207 | * |
| 170 | 208 | * @since 3.5.0 |
| 171 | 209 | * |
| 172 | 210 | */ |
| … |
… |
function install_plugins_favorites_form() {
|
| 188 | 226 | /** |
| 189 | 227 | * Display plugin content based on plugin list. |
| 190 | 228 | * |
| | 229 | * @global WP_Plugin_Install_List_Table $wp_list_table List of items to display. |
| | 230 | * |
| 191 | 231 | * @since 2.7.0 |
| | 232 | * |
| 192 | 233 | */ |
| 193 | 234 | function display_plugins_table() { |
| 194 | 235 | global $wp_list_table; |
| … |
… |
add_action( 'install_plugins_favorites', 'display_plugins_table' );
|
| 207 | 248 | /** |
| 208 | 249 | * Determine the status we can perform on a plugin. |
| 209 | 250 | * |
| | 251 | * This function is called recursively, $loop prevents further loops. |
| | 252 | * |
| 210 | 253 | * @since 3.0.0 |
| | 254 | * |
| | 255 | * @param array|object $api Plugin API response object. |
| | 256 | * @param bool $loop Prevents further loops. Default is false. |
| | 257 | * @return array Plugin status, install URL, and version. |
| 211 | 258 | */ |
| 212 | 259 | function install_plugin_install_status($api, $loop = false) { |
| 213 | | // this function is called recursively, $loop prevents further loops. |
| 214 | 260 | if ( is_array($api) ) |
| 215 | 261 | $api = (object) $api; |
| 216 | 262 | |
| … |
… |
function install_plugin_install_status($api, $loop = false) {
|
| 271 | 317 | /** |
| 272 | 318 | * Display plugin information in dialog box form. |
| 273 | 319 | * |
| | 320 | * @global string $tab Requested information. |
| | 321 | * |
| 274 | 322 | * @since 2.7.0 |
| | 323 | * |
| 275 | 324 | */ |
| 276 | 325 | function install_plugin_information() { |
| 277 | 326 | global $tab; |