Commit Graph

259 Commits

Author SHA1 Message Date
Dominik Schilling
e4abc1ecbf Filesystem API: Output buffering for request_filesystem_credentials() should wrap the function directly.
Previously `ob_end_clean()` was only called when the previous condition was successful which led to unexpected results when another output buffering was involved, like PHPUnit's.

Fixes #37488.
Built from https://develop.svn.wordpress.org/trunk@38167


git-svn-id: http://core.svn.wordpress.org/trunk@38108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-27 17:11:56 +00:00
Sergey Biryukov
48f9940cfc I18N: Change unnecessary uppercased words in WP_Upgrader::generic_strings() to lower case.
See #18218.
Built from https://develop.svn.wordpress.org/trunk@38074


git-svn-id: http://core.svn.wordpress.org/trunk@38015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-17 13:29:29 +00:00
Sergey Biryukov
139387b7e5 Docs: Use 3-digit, x.x.x-style semantic versioning for _doing_it_wrong(), _deprecated_function(), _deprecated_argument(), and _deprecated_file() throughout core.
Props metodiew.
Fixes #36495.
Built from https://develop.svn.wordpress.org/trunk@37985


git-svn-id: http://core.svn.wordpress.org/trunk@37926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-06 12:40:29 +00:00
Dominik Schilling
1244eaff8f Plugins: Fix order of arguments for the strpos() function added in [37562].
See #36706.
Built from https://develop.svn.wordpress.org/trunk@37580


git-svn-id: http://core.svn.wordpress.org/trunk@37548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-26 23:15:31 +00:00
Dominik Schilling
6b51ac4956 Plugins: In get_plugin_data() use the plugin slug for the text domain when no text domain is defined in the header.
Fixes #36706.
Built from https://develop.svn.wordpress.org/trunk@37562


git-svn-id: http://core.svn.wordpress.org/trunk@37530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-25 16:54:28 +00:00
Drew Jaynes
1947f4d17c Docs: Apply inline @see tags to hooks referenced in DocBlocks for wp-admin/* files.
Applying these specially-crafted `@see` tags allows the Code Reference parser to recognize and link these elements as actions and filters.

See #36921.

Built from https://develop.svn.wordpress.org/trunk@37537


git-svn-id: http://core.svn.wordpress.org/trunk@37505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-23 17:28:27 +00:00
Drew Jaynes
a54c2a7279 Docs: Remove/replace invalid inline @link tags from DocBlocks in wp-admin/includes/*.
See #36910.

Built from https://develop.svn.wordpress.org/trunk@37485


git-svn-id: http://core.svn.wordpress.org/trunk@37453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 17:22:27 +00:00
Drew Jaynes
b1804afeaf Docs: Standardize on 'backward compatibility/compatible' nomenclature in core inline docs.
Also use 'back-compat' in some inline comments where backward compatibility is the subject and shorthand feels more natural.

Note: 'backwards compatibility/compatibile' can also be considered correct, though it's primary seen in regular use in British English.

Props ocean90.
Fixes #36835.

Built from https://develop.svn.wordpress.org/trunk@37431


git-svn-id: http://core.svn.wordpress.org/trunk@37397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-13 18:41:31 +00:00
Drew Jaynes
fe3b007fdd Docs: Remove inline @see tags from function, class, and method references in inline docs.
Known functions, classes, and methods are now auto-linked in Code Reference pages following #meta1483.

Note: Hook references are still linked via inline `@see` tags due to the unlikelihood of reliably matching for known hooks based on a RegEx pattern.

See #32246.

Built from https://develop.svn.wordpress.org/trunk@37342


git-svn-id: http://core.svn.wordpress.org/trunk@37308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-02 04:00:28 +00:00
Dominik Schilling
697a6d5560 Plugins: In uninstall_plugin() pass the plugin file to wp_register_plugin_realpath().
`wp_register_plugin_realpath()` calls `dirname( $file );` to remove the basename. The basename must be included in the argument or the symlinked directory won't be registered.

Props andy.
Fixes #36709.
Built from https://develop.svn.wordpress.org/trunk@37331


git-svn-id: http://core.svn.wordpress.org/trunk@37297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-30 15:04:27 +00:00
Drew Jaynes
9b531bb473 Docs: Minorly improve the hook doc summary for the pre_uninstall_plugin action, introduced in [36124].
See #34569. See #35986.

Built from https://develop.svn.wordpress.org/trunk@36824


git-svn-id: http://core.svn.wordpress.org/trunk@36791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-03 08:58:26 +00:00
Eric Lewis
d01e8db4ad Plugins: Clarify that mu-plugins can't be "active" in docs.
Plugins installed in the plugins/ folder can be activated by users. This puts the plugin in an "active" state. Plugins in the mu-folder/ are "must-use" plugins that are always loaded. They can't be activated, and thereby can't be "active." Because of this, using the `is_plugin_active()` or `is_plugin_active_for_network()` returns false when checking for these plugins. This clarifies that behavior in the functions' docs.

Built from https://develop.svn.wordpress.org/trunk@36397


git-svn-id: http://core.svn.wordpress.org/trunk@36364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-26 00:32:27 +00:00
Dominik Schilling
0a6f311922 Plugins: In _get_plugin_data_markup_translate() remove the fallback to the "default" textdomain for Akismet.
Akismet has its own language files since WordPress 3.9.

Props jrf.
Fixes #35436.
Built from https://develop.svn.wordpress.org/trunk@36283


git-svn-id: http://core.svn.wordpress.org/trunk@36250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-13 13:56:26 +00:00
Dominik Schilling
a51129c2a6 Plugins: In _get_plugin_data_markup_translate() don't reload translations if they're already loaded.
Props jrf.
Fixes #35439.
Built from https://develop.svn.wordpress.org/trunk@36282


git-svn-id: http://core.svn.wordpress.org/trunk@36249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-13 13:04:27 +00:00
Pascal Birchler
7e516f5cf8 Plugins: Add a new pre_uninstall_plugin action that runs right before uninstalling a plugin.
Fixes #34569.
Built from https://develop.svn.wordpress.org/trunk@36124


git-svn-id: http://core.svn.wordpress.org/trunk@36090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-30 22:38:26 +00:00
Drew Jaynes
5a69733045 Docs: Properly mark the optional $redirect, $network_wide, and $silent parameters as such in the DocBlock for activate_plugin().
See #32246.

Built from https://develop.svn.wordpress.org/trunk@36072


git-svn-id: http://core.svn.wordpress.org/trunk@36037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-23 07:00:27 +00:00
Pascal Birchler
54b8c3e53b Docs: Fix some minor DocBlock alignment issues.
See #32246.
Built from https://develop.svn.wordpress.org/trunk@35885


git-svn-id: http://core.svn.wordpress.org/trunk@35849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-12 15:37:28 +00:00
Pascal Birchler
1294c2bc3a Admin Menu: Deprecate add_object_page() and add_utility_page().
These functions are not used in core and are just wrappers for `add_menu_page()`.

Fixes #23108.
Built from https://develop.svn.wordpress.org/trunk@35874


git-svn-id: http://core.svn.wordpress.org/trunk@35838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-11 22:12:26 +00:00
Sergey Biryukov
60c8e272f5 Docs: Improve DocBlock formatting for add_menu_page() and add_submenu_page() wrappers.
See #34360.
Built from https://develop.svn.wordpress.org/trunk@35731


git-svn-id: http://core.svn.wordpress.org/trunk@35695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-23 17:56:26 +00:00
Drew Jaynes
283b7d0a66 Plugins: Rename the delete_plugin action hook (introduced in [35094]) to deleted_plugin as it fires ''following'' a plugin deletion attempt.
Further, introduce a new `delete_plugin` action hook, to be fired ''before'' a plugin deletion attempt. Both changes bring parity with other such transactional hooks in core that fire before and after certain actions, including on plugin activation/deactivation and install/uninstall, among others.

Props johnjamesjacoby.
Fixes #26904.

Built from https://develop.svn.wordpress.org/trunk@35669


git-svn-id: http://core.svn.wordpress.org/trunk@35633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-18 17:58:26 +00:00
Drew Jaynes
6b14ca9407 Docs: Fix two notations for the $_wp_real_parent_file global, which is an array.
Props NExt-Season.
Fixes #34443.

Built from https://develop.svn.wordpress.org/trunk@35495


git-svn-id: http://core.svn.wordpress.org/trunk@35459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-03 20:13:26 +00:00
Scott Taylor
35dd8003b0 Admin Menu: allow more than one menu item to be added at the same priority/position.
Props chriscct7.
Fixes #23316.

Built from https://develop.svn.wordpress.org/trunk@35477


git-svn-id: http://core.svn.wordpress.org/trunk@35441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-31 20:31:24 +00:00
Sergey Biryukov
dcf2676b16 Docs: Use consistent naming and capitalization of menu names in add_submenu_page() wrappers.
Props atomicjack, Mckilem.
Fixes #34360.
Built from https://develop.svn.wordpress.org/trunk@35373


git-svn-id: http://core.svn.wordpress.org/trunk@35337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-23 12:02:24 +00:00
Drew Jaynes
bcc7f8d079 Plugins: Introduce the delete_plugin transactional hook, which fires immediately after a plugin deletion attempt occurs.
Props Veraxus for the initial patch.
Fixes #26904.

Built from https://develop.svn.wordpress.org/trunk@35094


git-svn-id: http://core.svn.wordpress.org/trunk@35059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-13 00:57:25 +00:00
Jeremy Felt
9926983b66 Revert [34778], continue using _site_option() for the current network.
The `_network_option()` parameter order will be changing to accept `$network_id` first. The `_site_option()` functions will remain in use throughout core as our way of retrieving a network option for the current network.

See #28290.

Built from https://develop.svn.wordpress.org/trunk@34912


git-svn-id: http://core.svn.wordpress.org/trunk@34877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 17:11:25 +00:00
Drew Jaynes
0b332f6d7a Docs: Add missing DocBlock summaries to three functions in wp-admin/includes/plugin.php.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@34825


git-svn-id: http://core.svn.wordpress.org/trunk@34790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 02:55:24 +00:00
Drew Jaynes
6650dfea4f Docs: Document the plugin data array returned by get_plugin_data() with a hash-notation.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@34818


git-svn-id: http://core.svn.wordpress.org/trunk@34783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-04 19:06:27 +00:00
Jeremy Felt
54512d64cb MS: Use *_network_option() functions throughout core.
Replaces all uses of `*_site_option()` with the corresponding "network" function.

This excludes one usage in `wp-admin/admin-footer.php` that needs more investigation.

Props spacedmonkey.
See #28290.

Built from https://develop.svn.wordpress.org/trunk@34778


git-svn-id: http://core.svn.wordpress.org/trunk@34743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 19:08:26 +00:00
John Blackbourn
aa35e473f7 callback is not a valid type in PHP, PSR-5, or phpDocumentor. callable should be used instead.
Fixes #34032

Built from https://develop.svn.wordpress.org/trunk@34566


git-svn-id: http://core.svn.wordpress.org/trunk@34530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-25 23:58:25 +00:00
Dominik Schilling
d1bdd59183 Don't use <code> in translation strings in wp-admin/includes/plugin.php.
Props ramiy.
Fixes #31856.
Built from https://develop.svn.wordpress.org/trunk@34314


git-svn-id: http://core.svn.wordpress.org/trunk@34278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-18 20:29:26 +00:00
Scott Taylor
a1d949f361 Move plugin_sandbox_scrape() from wp-admin/plugins.php to wp-admin/includes/plugin.php.
See #33813.

Built from https://develop.svn.wordpress.org/trunk@34018


git-svn-id: http://core.svn.wordpress.org/trunk@33987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-10 21:24:24 +00:00
Scott Taylor
ef87172270 foreach is a statement, not a function.
See #33491.

Built from https://develop.svn.wordpress.org/trunk@33734


git-svn-id: http://core.svn.wordpress.org/trunk@33702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-25 20:28:22 +00:00
Scott Taylor
8b1286417e ob_get_contents() followed by ob_end_clean() can be replaced by ob_get_clean().
See #32444.

Built from https://develop.svn.wordpress.org/trunk@32965


git-svn-id: http://core.svn.wordpress.org/trunk@32936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-27 01:12:24 +00:00
Drew Jaynes
e9758d4e48 Fix a typo in the DocBlock for get_plugins().
Props onnimonni, swissspidy.
Fixes #32758.

Built from https://develop.svn.wordpress.org/trunk@32927


git-svn-id: http://core.svn.wordpress.org/trunk@32898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-24 12:22:27 +00:00
Scott Taylor
00de0e6341 In unregister_setting(), search for $option_name in a segment of $new_whitelist_options keyed by $option_group.
Props nofearinc.
Fixes #26479.

Built from https://develop.svn.wordpress.org/trunk@32905


git-svn-id: http://core.svn.wordpress.org/trunk@32876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-22 20:51:26 +00:00
Scott Taylor
42d51a4f89 Add doc blocks to functions that are missing them.
If the function has no need for `@param` or `@return`, do an archeaological dig to find `@since`.

See #32444.

Built from https://develop.svn.wordpress.org/trunk@32672


git-svn-id: http://core.svn.wordpress.org/trunk@32642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-31 03:18:25 +00:00
Scott Taylor
a51dfa3971 In the style of #30947 and default-filters.php, add 2 new files to wp-admin/includes:
`admin-filters.php`
`ms-admin-filters.php`

There are random actions and filters littered among files like `misc.php`. These files contain functions that won't work outside of admin context and are typically only loaded in files that have already loaded the admin bootstrap.

See #32529.

Built from https://develop.svn.wordpress.org/trunk@32653


git-svn-id: http://core.svn.wordpress.org/trunk@32623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 17:04:26 +00:00
Scott Taylor
282e28ad81 Add @global annotations to (the rest of the?) wp-admin/* files.
Does not include list table file changes.

See #32444.

Built from https://develop.svn.wordpress.org/trunk@32643


git-svn-id: http://core.svn.wordpress.org/trunk@32613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 02:06:31 +00:00
Scott Taylor
b56b9b3e5c Add @global annotations for wp-admin/*.
See #32444.

Built from https://develop.svn.wordpress.org/trunk@32642


git-svn-id: http://core.svn.wordpress.org/trunk@32612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-28 21:41:30 +00:00
Dion Hulse
2ba7f3da75 Allow plugins to activate other plugins within their Activation hook. Fixes #32368
Built from https://develop.svn.wordpress.org/trunk@32504


git-svn-id: http://core.svn.wordpress.org/trunk@32474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-14 06:58:27 +00:00
Drew Jaynes
e7e93f50cf Add a missing @return tag to the DocBlock for `uninstall_plugin().
See #32246.

Built from https://develop.svn.wordpress.org/trunk@32340


git-svn-id: http://core.svn.wordpress.org/trunk@32311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-04 01:08:27 +00:00
Scott Taylor
0f6d0b84d1 Remove unused local vars in delete_plugins(), delete_theme(), WP_Date_Query->validate_date_values(), global_terms(), and WP_Text_Diff_Renderer_Table->_changed().
This will clear out the "Unused Code" label in the next Scrutinizer report.

See #30799.

Built from https://develop.svn.wordpress.org/trunk@31217


git-svn-id: http://core.svn.wordpress.org/trunk@31198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 21:19:22 +00:00
Scott Taylor
8ee598169f After [31105], don't ditch the isset() calls for BC. Declare $page_hook as null so it is initialized for all execution paths but will still fail isset() checks.
Fixes #30958.

Built from https://develop.svn.wordpress.org/trunk@31106


git-svn-id: http://core.svn.wordpress.org/trunk@31087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-08 22:52:22 +00:00
Scott Taylor
60e1dd409b Properly declare $hook_suffix, $plugin_page, $typenow, and $taxnow as globals in wp-admin/admin.php.
Fixes #30958.

Built from https://develop.svn.wordpress.org/trunk@31105


git-svn-id: http://core.svn.wordpress.org/trunk@31086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-08 22:15:24 +00:00
Scott Taylor
383a5c6c24 In wp-includes/plugin.php, collapse 3 else-newline-tab-if statements.
See #30799.

Built from https://develop.svn.wordpress.org/trunk@31091


git-svn-id: http://core.svn.wordpress.org/trunk@31072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-08 07:13:24 +00:00
Scott Taylor
60b0cd7943 The keyword elseif should be used instead of else if so that all control keywords look like single words.
This was a mess, is now standardized across the codebase, except for a few 3rd-party libs. 

See #30799.

Built from https://develop.svn.wordpress.org/trunk@31090


git-svn-id: http://core.svn.wordpress.org/trunk@31071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-08 07:05:25 +00:00
Andrew Nacin
bc60e63518 Use correct function name in docs for get_plugin_data().
props eliorivero.
fixes #30699.

Built from https://develop.svn.wordpress.org/trunk@31008


git-svn-id: http://core.svn.wordpress.org/trunk@30989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-31 08:08:22 +00:00
Boone Gorges
95dba4c8c0 When no plugins are active, return an empty array from validate_active_plugins().
This creates parity with the behavior of the function when plugins *are* active,
but none are invalid. It also makes it possible to write unit tests for the
function.

Props sgrant.
Fixes #30860.
Built from https://develop.svn.wordpress.org/trunk@31003


git-svn-id: http://core.svn.wordpress.org/trunk@30984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-30 19:31:22 +00:00
Scott Taylor
67417897ec Improve the @param docs for src/wp-admin/includes/plugin.php.
See #30224.

Built from https://develop.svn.wordpress.org/trunk@30668


git-svn-id: http://core.svn.wordpress.org/trunk@30658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 22:23:23 +00:00
Drew Jaynes
78bb3e5ff5 Docs Formatting: Backtick-escape inline code for all dynamic hook docs in wp-admin/includes/*.
Also adds a few inline `@see` cross-references as they apply.

Affects DocBlocks for the following hooks:
* `views_{$this->screen->id}`
* `bulk_actions-{$this->screen->id}`
* `manage_{$this->screen->id}_sortable_columns`
* `theme_action_links_$stylesheet`
* `after_theme_row_$stylesheet`
* `install_plugins_table_api_args_$tab`
* `$prefix . plugin_action_links`
* `after_plugin_row_$plugin_file`
* `manage_taxonomies_for_{$post_type}_columns`
* `manage_{$post_type}_posts_columns`
* `manage_{$post->post_type}_posts_custom_column`
* `{$taxonomy}_row_actions`
* `manage_{$this->screen->taxonomy}_custom_column`
* `install_themes_table_api_args_' . $tab`
* `auto_update_ . $type`
* `{$action}_prefilter`
* `admin_head_{$content_func}`
* `nav_menu_items_{$post_type_name}`
* `activate_ . $plugin`
* `deactivate_ . $plugin`
* `edit_{$post_type}_per_page`
* `postbox_classes_{$page}_{$id}`
* `_wp_post_revision_field_$field`
* `manage_{$screen->id}_columns`
* `in_plugin_update_message-{$file}`
* `in_theme_update_message-{$theme_key}`

See #30552.

Built from https://develop.svn.wordpress.org/trunk@30648


git-svn-id: http://core.svn.wordpress.org/trunk@30638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 11:28:24 +00:00