Commit Graph

8360 Commits

Author SHA1 Message Date
Boone Gorges
8b8dcb2ae4 Introduce 'page_of_comment' filter.
This filter allows developers to modify the output of `get_page_of_comment()`.

As a side effect of this new filter, comment page numbers will always be
returned as integers. Previously, they would sometimes be returned as floats -
eg `float(2.0)` instead of `int(2)`.

Props laceous.
See #13939.

git-svn-id: https://develop.svn.wordpress.org/trunk@34808 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 19:38:49 +00:00
Boone Gorges
3b89b3ca28 Use 'comments_per_page' option as fallback in get_page_of_comment().
The function now uses the following order of precedence when calculating
comment pagination: 1. the 'per_page' value passed in the `$args` array,
2. the 'comments_per_page' query var in `$wp_query`, and 3. the
'comments_per_page' setting from options-discussion.php. This change allows
`get_page_of_comment()` to return an accurate value before the main query
has been run.

Props laceous.
See #13939.

git-svn-id: https://develop.svn.wordpress.org/trunk@34806 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 19:25:25 +00:00
Boone Gorges
ddc75e22ee Only count top-level comments when calculating threaded pagination.
The change in [34535] did not properly account for threading.

See #13939, #11334.

git-svn-id: https://develop.svn.wordpress.org/trunk@34805 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 19:15:55 +00:00
Boone Gorges
b240a2a939 Ensure that WP_User_Query vars are filled after 'pre_get_users'.
This prevents notices from being thrown when a 'pre_get_users' callback
removes required values from the list of `query_vars`.

For backward compatibility with previous uses of 'pre_get_users', default
values are parsed both before and after the action is fired.

Fixes #33449.

git-svn-id: https://develop.svn.wordpress.org/trunk@34804 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 18:44:40 +00:00
Sergey Biryukov
02f76495c6 Add single-{post_type}-{post_name}.php to the top of the template hierarchy for single posts.
This is consistent with page and taxonomy templates, which support slugs as well.

Props ericjuden, johnbillion.
Fixes #18859.

git-svn-id: https://develop.svn.wordpress.org/trunk@34800 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 14:59:46 +00:00
Sergey Biryukov
fb6b3313c7 Abstract functionality from wp-comments-post.php into a function, wp_handle_comment_submission().
Add unit tests.

Props johnbillion.
Fixes #34059.

git-svn-id: https://develop.svn.wordpress.org/trunk@34799 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 14:46:09 +00:00
Sergey Biryukov
ef1a428bd5 Merge some strings with the same meaning in wp-includes/class-wp-xmlrpc-server.php.
Props pavelevap.
Fixes #33644.

git-svn-id: https://develop.svn.wordpress.org/trunk@34798 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 14:08:43 +00:00
Sergey Biryukov
ee0d153629 Merge some strings in wp-admin/upload.php with existing strings with the same meaning.
Props pavelevap.
Fixes #31727.

git-svn-id: https://develop.svn.wordpress.org/trunk@34797 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 13:56:05 +00:00
Drew Jaynes
433f6600c0 Users: Introduce the users_list_table_query_args filter, for modifying the WP_User_Query arguments used within the prepare_items() methods in the users list tables.
The current list table is passed as a second parameter, `$this`, and can take the form of either a `WP_Users_List_Table` or `WP_MS_Users_List_Table` instance depending on the context in which the filter was evaluated.

Props juliobox for the initial patch.
Fixes #25360.


git-svn-id: https://develop.svn.wordpress.org/trunk@34796 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 07:23:20 +00:00
Boone Gorges
da083f165d Remove search_terms from WP_Query doc block.
It's not actually a query param.

Introduced in [28887].

git-svn-id: https://develop.svn.wordpress.org/trunk@34795 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 04:35:57 +00:00
Sergey Biryukov
68f5a79880 Respect the force_delete parameter of get_delete_post_link().
Previously, it only worked if `EMPTY_TRASH_DAYS` was disabled.

Props johnbillion, chriscct7.
Fixes #26832.

git-svn-id: https://develop.svn.wordpress.org/trunk@34794 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 01:49:52 +00:00
John Blackbourn
96faf97a0f Adjust _default_wp_die_handler() formatting so it doesn't confuse Sublime Text's parsing and syntax highlighting.
Fixes #34135


git-svn-id: https://develop.svn.wordpress.org/trunk@34793 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 01:31:26 +00:00
Boone Gorges
e677f26aa8 Remove dead code added to get_comment_link() in [34735].
See #34073.

git-svn-id: https://develop.svn.wordpress.org/trunk@34792 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 01:26:40 +00:00
Sergey Biryukov
217d44bd60 Twenty Fifteen: Document the 'twentyfifteen_color_schemes' filter.
Props DrewAPicture.
Fixes #34119.

git-svn-id: https://develop.svn.wordpress.org/trunk@34791 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 01:09:20 +00:00
John Blackbourn
2212c0f858 Use wp_login_url() for login links when signing up for a new blog or activating a new blog on Multisite.
Fixes #31495
Props GregLone for the intial patch


git-svn-id: https://develop.svn.wordpress.org/trunk@34790 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 00:33:47 +00:00
Weston Ruter
2ef0449316 Customize: Fix nav_menu_item CSS classes array being incorrectly presented in input field as comma-delimited list.
Instead of using `Array.toString()` to serialize an array with comma delimiters, explicitly `join` the array using spaces instead. Also ensure that `xfn` is handled properly if it ever gets stored as an array. 

Props tyxla, westonruter.
Fixes #34111.


git-svn-id: https://develop.svn.wordpress.org/trunk@34788 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-03 00:14:22 +00:00
John Blackbourn
066eed4902 Introduce a register_taxonomy_args filter for filtering the arguments passed when calling register_taxonomy(). This is the taxonomy equivalent of the newly introduced register_post_type_args filter.
Fixes #33990
Props tyxla for initial patch


git-svn-id: https://develop.svn.wordpress.org/trunk@34787 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 23:56:16 +00:00
John Blackbourn
780460af28 Remove the unnecessary dynamic prefix used in the plugin_action_links filter name, and in those of its brethren. This way, network_admin_plugin_action_links gets listed as a separate filter.
Fixes #34117


git-svn-id: https://develop.svn.wordpress.org/trunk@34786 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 23:43:20 +00:00
John Blackbourn
337b94a0a5 Add VideoPress as a trusted oEmbed provider.
Fixes #34031
Props kraftbj


git-svn-id: https://develop.svn.wordpress.org/trunk@34785 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 23:19:18 +00:00
John Blackbourn
4703e75f31 shttp is not a protocol.
See #27115


git-svn-id: https://develop.svn.wordpress.org/trunk@34784 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 22:47:41 +00:00
John Blackbourn
3fee278cf4 Switch the remaining user-facing links to wordpress.org over to HTTPS.
Fixes #27115


git-svn-id: https://develop.svn.wordpress.org/trunk@34783 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 22:45:53 +00:00
Drew Jaynes
bf22859e52 Docs: Fix the placement and ordering of some @since tags following [34780].
See #12133. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34782 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 20:49:49 +00:00
Drew Jaynes
e0c487bc61 Docs: Improve a variety of inline docs in wp-includes/l10n.php.
* Corrects phrasing used in the descriptions for and filters in `_n()` and `_nx()`, particularly with regard to the use of 'singular' instead of 'single' or '1', and 'plural' instead of 'not 1'.
* Adds example usage to `_n()`, `_nx()`, `_nx_noop()`, and `translate_nooped_plural()`.
* Adds hash notation `@return` doc for `_n_noop()` and `_nx_noop()`.
* Adds missing default values for the optional `$domain` parameter in several places.

Props johnbillion.
Fixes #34127.


git-svn-id: https://develop.svn.wordpress.org/trunk@34781 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 20:44:18 +00:00
John Blackbourn
48300f62b3 Introduce support for array format field names in WP_Widget::get_field_name() and WP_Widget::get_field_id().
Fixes #12133
Props ch1902, welcher


git-svn-id: https://develop.svn.wordpress.org/trunk@34780 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 20:23:54 +00:00
Jeremy Felt
d9031e0d51 Docs: Add deprecation note for $use_cache in get_site_option().
Props johnbillion.
See #28290.


git-svn-id: https://develop.svn.wordpress.org/trunk@34779 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 19:31:04 +00:00
Jeremy Felt
3c177b8c6f 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@34778 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 19:07:23 +00:00
Jeremy Felt
464f857316 MS: Introduce *_network_option functions.
Introduces `add_network_option()`, `update_network_option()`, `get_network_option()`, and `delete_network_option()`, which use the internals previously found in the `*_site_option()` functions and allow for a network ID to enable cross network storage and retrieval of network options.

* `*_site_option()` functions are now wrappers for `*_network_option()` and will interact with options for the current network in a multisite environment.
* All will continue to fallback to `*_option()` for non-multisite uses.
* Adds basic tests for cross network storage and retrieval.
* Existing tests for `*_site_option()` functions provide coverage for storage and retrieval of current network options.

Props spacedmonkey, DrewAPicture, jeremyfelt.
See #28290.


git-svn-id: https://develop.svn.wordpress.org/trunk@34777 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 18:00:30 +00:00
Drew Jaynes
e2f61478de Docs: Remove documentation for a phantom parameter not actually passed to the is_email filter.
The documentation error was introduced in [26485].

Props chrisvendiadvertisingcom.
Fixes #34097.


git-svn-id: https://develop.svn.wordpress.org/trunk@34770 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 07:02:23 +00:00
Drew Jaynes
0fcc70b853 Introduce the wp_add_nav_menu_item action, fired immediately after a new nav menu item has been added.
This hook can be leveraged both for the legacy menus interface and the menus integration in the Customizer, as both use the containing function, `wp_update_nav_menu_item()`.

Props MikeHansenMe, tyxla.
Fixes #30983.


git-svn-id: https://develop.svn.wordpress.org/trunk@34769 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 06:45:32 +00:00
Drew Jaynes
f6ce56219a Docs: Fix a few syntatical issues with inline documentation in wp-includes/post-template.php.
Props welcher.
See #30224.


git-svn-id: https://develop.svn.wordpress.org/trunk@34768 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 06:37:48 +00:00
Drew Jaynes
80e4265277 Docs: Also clarify the expected element types depending on the value of $action in the hook doc for the plugins_api filter.
See [34763] for context.

See #34035.


git-svn-id: https://develop.svn.wordpress.org/trunk@34764 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 04:51:39 +00:00
Drew Jaynes
4c6d50413b Docs: Clarify the expected replacement element type if replacing the object or array in plugins_api() via the plugins_api hook.
If the `$action` type is 'query_plugins' or 'plugin_information', the API will return an object, thus an object should be passed if replacing it. For 'hot_tags' and 'hot_categories', the same logic applies, but with arrays instead.

See #34035.


git-svn-id: https://develop.svn.wordpress.org/trunk@34763 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 04:47:14 +00:00
Scott Taylor
a31e54344c Posts: In wp_insert_post(), don't set post_date to current time if it can be derived from a passed value for post_date_gmt.
Adds unit tests.

Props oso96_2000, kawauso.
Fixes #15946.


git-svn-id: https://develop.svn.wordpress.org/trunk@34762 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 04:35:34 +00:00
Scott Taylor
5a24a0a4f8 Shortcodes/Formatting: Add PCRE Performance Testing
* Move pattern from `wptexturize()` into a separate function.
* Move pattern from `wp_html_split()` into a separate function.
* Beautify code for `wp_html_split()`.
* Remove unnecessary instances of `/s` modifier in patterns that don't use dots.
* Add `tests/phpunit/data/formatting/whole-posts.php` for testing larger strings.
* Add function `benchmark_pcre_backtracking()`.
* Add tests for `wp_html_split()`.
* Add tests for `wptexturize()`.
* Add tests for `get_shortcode_regex()`.

Props miqrogroove.
Fixes #34121.


git-svn-id: https://develop.svn.wordpress.org/trunk@34761 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 04:25:40 +00:00
Scott Taylor
c152375b58 Plugins: on the Install page, move the name of each plugin into the <h4> to accommodate screen readers.
Props afercia, ChrisMKindred.
Fixes #32400.


git-svn-id: https://develop.svn.wordpress.org/trunk@34760 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 04:15:12 +00:00
Jeremy Felt
2322255d81 MS: Remove @todo for ms_protect_special_option() from delete_site_option().
This todo has been in place since the original merge of MU. At the time of merge, `wpmu_protect_special_option()` protected an empty array, and there has been no noticeable need since. As we introduce `_network_option()`, let's leave this behind. A new ticket can be opened if necessary.

See #28290.


git-svn-id: https://develop.svn.wordpress.org/trunk@34756 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 22:45:18 +00:00
John Blackbourn
ed81797117 Deprecate get_admin_users_for_domain(). This function has never been used in core.
Fixes #34122


git-svn-id: https://develop.svn.wordpress.org/trunk@34755 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 22:26:19 +00:00
John Blackbourn
d3229b6dfc This function is blessed.
git-svn-id: https://develop.svn.wordpress.org/trunk@34754 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 22:23:51 +00:00
John Blackbourn
cfbd8056c2 Deprecate create_empty_blog(). This function has never been used in core.
Fixes #34120


git-svn-id: https://develop.svn.wordpress.org/trunk@34753 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 22:09:18 +00:00
Dominik Schilling (ocean90)
b2bb4ea2d5 Install: Replace the "Privacy" setting with the "Search Engine Visibility" setting from Reading Settings.
Props Clorith, ocean90.
Fixes #27628.
See #16416.

git-svn-id: https://develop.svn.wordpress.org/trunk@34752 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 21:34:38 +00:00
Dominik Schilling (ocean90)
00762410b0 Upgrader: Clear plugin/theme caches directly after a plugin/theme has been installed.
`wp_update_plugins()` and `wp_update_themes()` are both hooked into `upgrader_process_complete` with priority 10. But at this stage the caches in `get_plugins()`, `search_theme_directories()`, and `wp_get_themes()` aren't refreshed yet so both functions couldn't fetch any translations for the new plugin/theme.
To reset the caches `wp_clean_themes_cache()` and `wp_clean_plugins_cache()` are now hooked into `upgrader_process_complete` with priority 9.

Fixes #34029.

git-svn-id: https://develop.svn.wordpress.org/trunk@34751 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 21:20:09 +00:00
Jeremy Felt
a8b5a8ec63 MS: Remove registration of ID column in Sites and Users list tables.
Reverts a portion of [34289] and leaves the render for the column behind. A plugin can register these fields for display via filter.

Fixes #18661.


git-svn-id: https://develop.svn.wordpress.org/trunk@34750 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 20:57:06 +00:00
Jeremy Felt
b71708647c MS: Provide better UI when a main site's /blog prefix is changed.
The main site on a new network is forced by default into using `/blog` as the prefix for its permalink structure. This can be changed easily through the network admin, though the `options-permalink.php` screen is then unusable to make further changes to the structure.

Now, if `/blog/` is not at the beginning of the `permalink_structure` option, we do not force `/blog` as a prefix in the UI.

Fixes #12002.


git-svn-id: https://develop.svn.wordpress.org/trunk@34749 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 20:38:40 +00:00
Dominik Schilling (ocean90)
2f16a92362 Language Upgrader: Re-use the automatic upgrader skin if the parent upgrader is using it.
Prevents broken Ajax responses when `Language_Pack_Upgrader::async_upgrade()` gets triggered during a shiny update.

Fixes #34048.

git-svn-id: https://develop.svn.wordpress.org/trunk@34748 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 20:24:18 +00:00
Scott Taylor
e0b34f44a3 Shortcodes: Fix PCRE performance bugs in get_shortcode_regexp() and related to wptexturize(), do_shortcode(), and strip_shortcodes()
Alters unit tests.

Props miqrogroove.
Fixes #33517.


git-svn-id: https://develop.svn.wordpress.org/trunk@34747 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 18:04:13 +00:00
Drew Jaynes
08f047176b Docs: Update the argument descriptions for $child_of and $hierarchical in get_pages() to more closely reflect expected behavior.
See #18701. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34746 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 17:39:25 +00:00
Scott Taylor
1b70f27b04 Shortcodes: prevent registration of invalid shortcode names.
Adds unit tests.

Props miqrogroove.
Fixes #34090.


git-svn-id: https://develop.svn.wordpress.org/trunk@34745 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 17:33:58 +00:00
Scott Taylor
3c50d18785 Shortcodes: clarify the @return docs for shortcode_parse_atts().
Props miqrogroove.
See #23307.


git-svn-id: https://develop.svn.wordpress.org/trunk@34744 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 17:31:58 +00:00
Andrea Fercia
875ed40ffb In wp_comment_reply() change the H5 headings in fieldset legends for better accessibility.
Also, add a "Edit Comment" legend before the Quick Edit form to pair it with "Reply to Comment" and "Add new Comment" and move the Name, Email, and URL fields after the Comment textarea.

Props joedolson, afercia.

Fixes #33757.

git-svn-id: https://develop.svn.wordpress.org/trunk@34743 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 14:51:25 +00:00
Andrea Fercia
b61d943435 Bump H3 headings to H2 on the Network Site Users screen for better accessibility.
Fixes #34081.

git-svn-id: https://develop.svn.wordpress.org/trunk@34742 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 14:32:15 +00:00
Dion Hulse
e4a147150e Rewrite insert_with_markers() to use flock() when available, significant cleanup of the function too.
The call to `flock()` is an exclusive advisory lock, which in my testing only PHP respects (apache continues to read it).
Not all filesystems support locking (remote NFS mounts for example) so this offers minimal benefit to those platforms, but offers much better protection against file corruption on systems which do support it.
The call is blocking, so a second process will wait for the first to complete before writing if supported.

See #31767


git-svn-id: https://develop.svn.wordpress.org/trunk@34740 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 07:45:35 +00:00
Dion Hulse
f99f06206e Updates: SSH2 Transport: Add a connection error when the SFTP subsystem cannot be initialized.
Fixes #33478


git-svn-id: https://develop.svn.wordpress.org/trunk@34739 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 05:42:20 +00:00
Dion Hulse
bb7763c1d1 Updates: SSH2 Transport: Use a work around to avoid a bug where PHP's SSH2 extension fails to list the contents of the / directory.
This fixes issues where SSH2 with chrooted environments runs into a `Unable to locate WordPress Content directory (wp-content).` error.

The workaround is to simply list the contents of the `/./` directory instead of `/`.

Fixes #33919


git-svn-id: https://develop.svn.wordpress.org/trunk@34738 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 05:39:44 +00:00
Gary Pendergast
f9f56fb942 WPDB: Allow null values in the CRUD functions.
Specifically, `::insert()`, `::replace()`, `::update()`, and `::delete()` can now set a column to `NULL`, or add the `IS NULL` condition to the `WHERE` clause.

This is based on [backpress 279].

Props pento, nbachiyski, sorich87.

Fixes #15158.



git-svn-id: https://develop.svn.wordpress.org/trunk@34737 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 05:36:15 +00:00
Dion Hulse
3ffcb9548d Press This: Make the regular expressions for matching images easier to read by not requiring escaping.
Fixes #32878


git-svn-id: https://develop.svn.wordpress.org/trunk@34736 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 05:15:05 +00:00
Boone Gorges
ee2c079ade Ensure that comment permalinks reflect pagination.
After [34561], `wp_list_comments()` no longer passed all of a post's comments
to `Walker_Comments`. As a result, calls to `get_comment_link()` occurring
inside the comment loop had insufficient context to determine the proper
'cpage' value to use when generating comment permalinks. This, in turn, caused
comment permalinks to behave erratically.

The current changeset addresses the problem as follows:

* `get_comment_link()` now accepts a 'cpage' parameter. When present, 'cpage' will be used to build the comment permalink - no automatic calculation will take place.
* When called within the main loop, `wp_list_comments()` calculates the proper 'cpage' value for comments in the loop, and passes it down to `get_comment_link()`.
* `cpage` and `comment-page-x` query vars are generally required in comment permalinks (see #34068), but an exception is made when 'default_comment_page=oldest': the bare post permalink will always be the same as `cpage=1`, so `cpage` is excluded in this case.

Props peterwilsoncc for assiduous spreadsheeting.
Fixes #34073.

git-svn-id: https://develop.svn.wordpress.org/trunk@34735 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 05:12:39 +00:00
Scott Taylor
c28bc82d4b Canonical: remove unused code (commented-out) from redirect_canonical().
Props hakre, chriscct7.
Fixes #16934.


git-svn-id: https://develop.svn.wordpress.org/trunk@34734 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 05:08:31 +00:00
Dion Hulse
0e2f9b5019 Updates: Try a more compatible method to detect if a file exists when using the FTP Extension.
This change causes it to list the parent directories files, and assets that the node exists within the returned listing, this is a little more compatible than relying upon the FTP server to correctly filter the returned resultset to the specific file/node being requested.
Fixes #28013


git-svn-id: https://develop.svn.wordpress.org/trunk@34733 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 05:08:07 +00:00
Boone Gorges
d5fdd9084a Correct some WP_Query metadata lazyloading docs.
Props dlh.
Fixes #34047.

git-svn-id: https://develop.svn.wordpress.org/trunk@34732 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 04:00:48 +00:00
Boone Gorges
27eb520f0c s/add_action()/add_filter() in WP_Query metadata lazyloading.
Props dlh.
See #34047.

git-svn-id: https://develop.svn.wordpress.org/trunk@34731 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 04:00:41 +00:00
Boone Gorges
a7dbb948c5 Prevent extra db queries in WP_Comment::get_children().
`WP_Comment_Query::fill_descendants()` queries for a comment tree in a way that
minimizes database overhead, and places the located descendants with their
proper parents. However, it doesn't touch leaf nodes - comments with no
children - so future calls to `get_children()` on those comment objects
result in unnecessary database queries. To prevent this, `fill_descendants()`
now sets a `populated_children` flag on all located `WP_Comment` objects.

See #8071.

git-svn-id: https://develop.svn.wordpress.org/trunk@34730 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 03:57:53 +00:00
Boone Gorges
f14dc03ad6 Simplify pagination logic in comments_template().
[34561] "fixed" the problem of newest-first comments showing fewer than
'per_page' comments on the post permalink when the total number of comments
was not divisible by 'per_page'. See #29462. But this fix caused numerous
other problems. First, comment pages reported by `get_page_of_comment()`
(which expects comment pages to be filled oldest-first) were no longer correct.
Second, and more seriously, the new logic caused comments to be shifted
between pages, making their permalinks non-permanent.

The current changeset reverts the changed behavior. In order to preserve the
performance improvements introduced in [34561], an additional query must be
performed when 'default_comments_page=newest' and 'cpage=0' (ie, you're viewing
the post permalink). A nice side effect of this revert is that we no longer
need the hacks required to determine proper comment pagination, introduced in
[34561].

See #8071. See #34073.

git-svn-id: https://develop.svn.wordpress.org/trunk@34729 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 03:10:13 +00:00
Scott Taylor
63b6bc751d Post List Table: Ensure that edit.php with no query string produces the proper markup and links in the date column header.
Add 2 methods to `WP_List_Table`, `->get_orderby()` and `->get_order()`. Override the methods in `WP_Posts_List_Table`.

`WP_Posts_List_Table` calls `wp_edit_posts_query()` in `->prepare_items()` which is a wrapper for `wp()`. As such, we can obtain `orderby` and `order` via `get_query_var()`, instead of the URL.

Fixes #25493.



git-svn-id: https://develop.svn.wordpress.org/trunk@34728 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 02:09:41 +00:00
Drew Jaynes
ed1240234d Formatting: Rename the $richedit parameter in format_to_edit() to $rich_text.
Previously, it was necessary to explain in a double-negative that `$richedit` being false would prevent `$content` from being passed through `esc_textarea()`. The updated `$rich_edit` name and documentation now better reflects the intent of the parameter.

Fixes #21613.


git-svn-id: https://develop.svn.wordpress.org/trunk@34727 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 02:00:42 +00:00
Helen Hou-Sandi
f737a197c2 Comments: Trash blacklisted comments by default.
If trash is disabled, they wil continue to go into spam like they do now.

props wonderboymusic, solarissmoke, MikeHansenMe.
fixes #7051.


git-svn-id: https://develop.svn.wordpress.org/trunk@34726 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 01:48:14 +00:00
Drew Jaynes
3725408616 Docs: Document declaration of the $submenu_file global in wp-admin/menu-header.php.
See #24531. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34725 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 01:47:07 +00:00
Drew Jaynes
72e5ad9390 Declare the $submenu_file global to avoid a notice generated by passing it as a parameter to the submenu_file hook, introduced in [34722].
Fixes #24531.


git-svn-id: https://develop.svn.wordpress.org/trunk@34724 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 01:22:55 +00:00
Helen Hou-Sandi
11144bd39e Don't show the "Add New" link on post-new.php.
Using the same `$post_new_file` global variable name in `wp-admin/menu.php` in [33723] was unintentional, but we're already unsetting other variables that are in global scope so we can just unset this one as well. Someday the admin menu won't be a big pile of sad and cryptic globals. Maybe.

props johnjamesjacoby, norcross.
fixes #34045.


git-svn-id: https://develop.svn.wordpress.org/trunk@34723 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 00:47:22 +00:00
Sergey Biryukov
be98773ac9 Add 'submenu_file' filter for the file of an admin menu sub-menu item.
This complements the `'parent_file'` filter added in [12712].

Props swissspidy, kraftbj.
Fixes #24531.

git-svn-id: https://develop.svn.wordpress.org/trunk@34722 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 00:22:37 +00:00
Weston Ruter
00f500f135 Customize: Style the nav menu "Add Items" button as disabled when reordering.
Fixes CSS selector to match what is being used for the "Add Widget" button in the customizer.

Props umesh.nevase.
Fixes #34102.


git-svn-id: https://develop.svn.wordpress.org/trunk@34721 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 22:54:59 +00:00
Boone Gorges
8e0b9bae2e Bail out of termmeta functions if schema is not up-to-date.
Termmeta cache priming was throwing database errors on installations that had
not yet gone through the database update routine. To avoid errors in all cases,
the check has been added to all termmeta functions. These checks will be
removed in a future version of WordPress. (Hang on to your hats!)

Fixes #34091.

git-svn-id: https://develop.svn.wordpress.org/trunk@34718 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 04:52:28 +00:00
Drew Jaynes
69db043e3c Docs: There are quite alot of typos in core inline comments.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34717 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 04:12:16 +00:00
Boone Gorges
87fbd30548 Use array hash notation for get_comment_link() $args.
See #34068, #34073.

git-svn-id: https://develop.svn.wordpress.org/trunk@34716 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 04:12:06 +00:00
Drew Jaynes
bd01019c21 Themes: Introduce three new arguments for get_the_post_navigation(), in_same_term, excluded_terms, and taxonomy.
The addition of these new arguments brings `get_the_post_navigation()` into argument parity with `get_previous_post_link()` and `get_next_post_link()`, both of which it wraps, and will allow for more flexibility in configuring the next and previous post links for simultaneous display in themes.

Props ChaseWiseman.
Fixes #32618.


git-svn-id: https://develop.svn.wordpress.org/trunk@34715 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 03:40:52 +00:00
Drew Jaynes
a774dfbb08 Widgets: Introduce a delete_widget action, which fires after a widget has been marked for deletion.
Props afercia for the initial patch.
Fixes #27444.


git-svn-id: https://develop.svn.wordpress.org/trunk@34714 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 03:20:41 +00:00
Drew Jaynes
13aeda2ef7 Docs: Mark a few optional parameters as such in wp-includes/rewrite-functions.php.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34712 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 02:41:49 +00:00
Boone Gorges
283c38c022 Improve lazyloading of comment meta in WP_Query loops.
Lazy-loading logic is moved to a method on `WP_Query`. This makes it possible
for comment feeds to take advantage of metadata lazyloading, in addition to
comments loaded via `comments_template()`.

This new technique parallels the termmeta lazyloading technique introduced in
[34704].

Fixes #34047.

git-svn-id: https://develop.svn.wordpress.org/trunk@34711 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 01:34:54 +00:00
Scott Taylor
686ef2bd79 List Tables: .column-date needs to become wider at smaller screen sizes, bump it from 10% to 14% at the breakpoint to prevent wrapping.
Fixes #32691.


git-svn-id: https://develop.svn.wordpress.org/trunk@34710 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 01:24:33 +00:00
Scott Taylor
876c8611f1 Revert [34083], I was willing to try this out for the greater good. The good was not greater. There is too much baggage associated with this specific change as pertains to BC and expected layout.
See #32691.


git-svn-id: https://develop.svn.wordpress.org/trunk@34709 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 01:18:55 +00:00
Scott Taylor
427f4fe063 Rewrite: allow add_rewrite_rule|WP_Rewrite::add_rule() to accept an associative array for the value of $redirect instead of requiring a query string.
Adds unit tests.

Props scribu, DrewAPicture.
Fixes #16840.


git-svn-id: https://develop.svn.wordpress.org/trunk@34708 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 01:10:03 +00:00
Scott Taylor
27bc50cef8 List Tables: only hide bulk actions when there are no items, don't hide all of the extra table nav.
Fixes #33824.


git-svn-id: https://develop.svn.wordpress.org/trunk@34707 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 00:46:15 +00:00
Drew Jaynes
2b8df0b47a Docs: Add an @see reference for the "use-instead-of" function in the DocBlock for force_ssl_login(), deprecated in [34700].
See #34011. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34706 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 22:45:56 +00:00
Drew Jaynes
0150a52379 Users: Add the default arguments array as a second parameter to the wp_dropdown_users_args filter, introduced in [34692].
Adjust hook doc descriptions accordingly.

See #19867.


git-svn-id: https://develop.svn.wordpress.org/trunk@34705 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 22:38:12 +00:00
Boone Gorges
e75f2c024f Improve lazyloading of term metadata in WP_Query loops.
[34529] introduced lazyloading for the metadata belonging to terms matching
posts in the main `WP_Query`. The current changeset improves this technique
in the following ways:

* Term meta lazyloading is now performed on the results of all `WP_Query` queries, not just the main query.
* Fewer global variable touches and greater encapsulation.
* The logic for looping through posts to identify terms is now only performed once per `WP_Query`.

Props dlh, boonebgorges.
See #34047.

git-svn-id: https://develop.svn.wordpress.org/trunk@34704 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 21:59:44 +00:00
Scott Taylor
e04d0dd623 Customizer: make "Current header" clickable in the same way that "Background Image" is - will open the media modal.
Props umesh.nevase.
Fixes #33586.


git-svn-id: https://develop.svn.wordpress.org/trunk@34702 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 21:39:55 +00:00
Scott Taylor
3d06ffcbbc Network Upgrade: switch <h3> to <h2>.
Props afercia.
Fixes #34082.


git-svn-id: https://develop.svn.wordpress.org/trunk@34701 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 21:27:42 +00:00
John Blackbourn
0058018799 Deprecate force_ssl_login(), which is simply a wrapper for force_ssl_admin() and is not used in core.
Fixes #34011


git-svn-id: https://develop.svn.wordpress.org/trunk@34700 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 21:27:40 +00:00
Boone Gorges
49063d8e14 WP_Query should not ignore an offset of 0.
Props mazurstas.
Fixes #34060.

git-svn-id: https://develop.svn.wordpress.org/trunk@34697 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 19:36:16 +00:00
Boone Gorges
3b7187eade Fix 'exclude_tree' in wp_list_categories().
The 'exclude_tree' parameter must be compatible with 'hierarchical';
previously, 'hierarchical' canceled it out. This changeset also makes it so
that 'exclude_tree' is compatible with 'exclude'. When both are passed, and
'hierarchical' is true, the descendant trees of terms in both parameters will
be excluded from matched terms.

Props tott, webord, MikeHansenMe.
Fixes #12981.

git-svn-id: https://develop.svn.wordpress.org/trunk@34696 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 19:11:12 +00:00
Andrea Fercia
c81fe78b9c Bump H3 headings to H2 on the Network Settings screen for better accessibility.
Fixes #34078.

git-svn-id: https://develop.svn.wordpress.org/trunk@34695 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 18:51:20 +00:00
John Blackbourn
644632bec5 Revert the introduction of validation of the comment author's email address when sanity checking input in wp-comments-post.php (introduced in r34274). This allows a problematic email address to fall through to the correct validation routine and show the "Please enter a valid email address" as expected.
Fixes #23416


git-svn-id: https://develop.svn.wordpress.org/trunk@34693 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 17:26:44 +00:00
Drew Jaynes
077854484d Users: Introduce the wp_dropdown_users_args filter, making it possible to filter the arguments for wp_dropdown_users() before the query is run.
The 'name' argument (or the `WP_Screen` object if in the admin) can be used to help target specific instances of `wp_dropdown_users()` via this hook.

Props norcross.
See #19867.


git-svn-id: https://develop.svn.wordpress.org/trunk@34692 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 15:39:26 +00:00
John Blackbourn
a8f9ae8161 On the Permalink Settings screen, add a link to the Nginx documentation when the current site is running Nginx. This is in lieu of showing actual Nginx configuration like we do for mod_rewrite or IIS.
Fixes #18852


git-svn-id: https://develop.svn.wordpress.org/trunk@34691 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 11:14:23 +00:00
Gary Pendergast
ce14a63214 Permalinks: Add pretty permalinks for unattached attachments.
Previously, unattached attachments would have unsightly `/?attachment_id=1` URLs. As we've moved away from attachments being specifically attached to posts, instead being Media items, this has made the unattached URLs a more common occurrence.

We can breath easy once more, knowing that the world is a little bit safer from the horror of unnecessarily ugly URLs.

Props SergeyBiryukov, wonderboymusic, pento.

Fixes #1914.



git-svn-id: https://develop.svn.wordpress.org/trunk@34690 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 09:41:14 +00:00
DrewAPicture
133b204471 Docs: Move the hook doc to once again directly precede the hook line for the getarchives_where filter following [34686].
See #21596.


git-svn-id: https://develop.svn.wordpress.org/trunk@34689 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 06:38:02 +00:00
Scott Taylor
1ac3ba0828 Allow wp_get_archives() to accept post_type as an arg.
Adds unit test.

Fixes #21596.


git-svn-id: https://develop.svn.wordpress.org/trunk@34686 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 05:10:10 +00:00
Gary Pendergast
070b65dcfc Rewrite: Redirect attachment URLs when their slug changes.
Using the same logic that we use to redirect posts when their slug changes, we can provide the same functionality for attachments. Attachment pages are posts, too.

Props swissspdy.

Fixes #34043.



git-svn-id: https://develop.svn.wordpress.org/trunk@34685 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 04:57:02 +00:00
Scott Taylor
0ab0525691 Edit Media: wrap long filenames in the Publish meta box.
Fixes #34069.


git-svn-id: https://develop.svn.wordpress.org/trunk@34684 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 04:50:08 +00:00
Scott Taylor
999e54c8d3 RSS Widget: add a class, rss-widget-icon, to the RSS icon to allow devs to hide it. Not going to remove to not break visual BC.
Fixes #22010.


git-svn-id: https://develop.svn.wordpress.org/trunk@34683 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 04:31:10 +00:00
Scott Taylor
948ab018d2 XML-RPC: calculate the proper offset for GMT in wp.newPost, mw.newPost, and mw.editPost when post_date is set, wp.editComment when comment_date is set. post|comment_date is assumed to be GMT. This is only true if the timezone string for the site matches GMT.
Adds unit tests for each.

Props smerriman, justdaiv, wonderboymusic.
Fixes #30429.


git-svn-id: https://develop.svn.wordpress.org/trunk@34681 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 04:04:16 +00:00