Commit Graph

30184 Commits

Author SHA1 Message Date
Dominik Schilling (ocean90)
0f9c75f614 Nav Menus: Update wp_setup_nav_menu_item() to stop overriding empty properties from supplied $menu_item.
Update docs for `WP_Post` constructor to indicate that `WP_Post|object` can be the supplied param, as opposed to just `WP_Post`.

props westonruter.
fixes #32632.

git-svn-id: https://develop.svn.wordpress.org/trunk@32762 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-14 10:52:35 +00:00
Jeremy Felt
2cdea6f446 Remove a now unused switch_to_blog() and restore_current_blog() in site-info.php
Now that we decide when to automatically update `home` and `siteurl`, we no longer need to switch to the site while displaying the form output.

See #32503.


git-svn-id: https://develop.svn.wordpress.org/trunk@32761 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-14 08:22:34 +00:00
Jeremy Felt
4b0eaacd84 Remove the "Update siteurl and home as well" checkbox when editing a site
Rather than provide a checkbox to update the `siteurl` and `home` options, we can make an educated decision based on the current state. If the home and/or siteurl domain and path match the existing domain and path of the site, then we update with the new information.

Also, while scheme is not stored in `wp_blogs` along with a site, the scheme of the `home` and `siteurl` options can now be modified via the Site URL setting in `site-info.php` when the `home` and/or `siteurl` options match the existing domain.

Props @hugobaeta, @earnjam, @jeremyfelt.
Fixes #32503, see #22383.


git-svn-id: https://develop.svn.wordpress.org/trunk@32760 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-14 07:51:30 +00:00
Jeremy Felt
250aaa16e8 Capture domain and path when editing sites on a subdomain network
When a network is configured as subdomain, allow for the input of arbitrary domain and path combinations when editing a site rather than just the domain.

This takes a step or two toward #32503.

Props @scribu, @ericlewis, @jeremyfelt.
See #22383.


git-svn-id: https://develop.svn.wordpress.org/trunk@32759 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-14 07:08:30 +00:00
Jeremy Felt
a0ef4e9ed6 Improve code readability in site-info.php
In advance of some other work here, clean up some braces and spaces.

See #22383.


git-svn-id: https://develop.svn.wordpress.org/trunk@32758 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-14 05:00:27 +00:00
Scott Taylor
857197f14d In WP_MS_Users_List_Table::display_rows():
* Move the giant `switch` statement into methods
* Call `->single_row_columns()`, which we now override - there is a small amount of logic that requires overriding, otherwise it is largely the same as the parent method

See #29881.


git-svn-id: https://develop.svn.wordpress.org/trunk@32757 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 17:10:49 +00:00
Scott Taylor
dea07077fa In WP_MS_Themes_List_Table::display_rows():
* Move the giant `switch` statement into methods
* Call `->single_row_columns()`, which we now override

See #29881.


git-svn-id: https://develop.svn.wordpress.org/trunk@32756 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 16:53:06 +00:00
Scott Taylor
ae8bd2bcd3 In WP_MS_Sites_List_Table::display_rows():
* Move the giant `switch` statement into methods
* Call `->single_row_columns()`, which we now override - it could inherit from `WP_List_Table` if we can find a way to handle the `id` column. When that happens, we can ditch this method.

See #29881.


git-svn-id: https://develop.svn.wordpress.org/trunk@32755 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 16:23:01 +00:00
Scott Taylor
31d50764c3 In WP_Media_List_Table::display_rows():
* Move the giant `switch` statement into methods
* Call `-single_row_columns()`, which it inherits from `WP_List_Table`

See #29881.


git-svn-id: https://develop.svn.wordpress.org/trunk@32754 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 15:56:13 +00:00
Scott Taylor
c32f856cf3 In WP_Links_List_Table::display_rows():
* Move the giant `switch` statement into methods
* Call `-single_row_columns()`, which it inherits from `WP_List_Table`

See #29881.


git-svn-id: https://develop.svn.wordpress.org/trunk@32753 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 15:32:57 +00:00
Scott Taylor
6c6638c163 In WP_Posts_List_Table, move the <th> markup out of ->column_cb().
See #29881, [32740].


git-svn-id: https://develop.svn.wordpress.org/trunk@32752 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 15:13:47 +00:00
Scott Taylor
0eb50f80b9 In wp_ajax_hidden_columns(), don't explode() on an empty string.
In `columns.hidden()`, which lives in `common.js`, don't return items with no `id`.

This was resulting in options like `manageedit-postcolumnshidden` containing a serialized array with random empty items.

Props afercia, wonderboymusic.
Fixes #32466.


git-svn-id: https://develop.svn.wordpress.org/trunk@32751 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 14:59:40 +00:00
Dominik Schilling (ocean90)
5202111c6a Toolbar: Remove a duplicate CSS selector.
props deconf.
fixes #32634.

git-svn-id: https://develop.svn.wordpress.org/trunk@32750 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 14:53:59 +00:00
Scott Taylor
9629b5413d In WP_Posts_List_Table::column_title(), use is_post_type_hierarchical() instead of $this->hierarchical_display in the logic to determine whether the_excerpt() should be called.
Fixes #32187.


git-svn-id: https://develop.svn.wordpress.org/trunk@32749 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 14:41:15 +00:00
Dominik Schilling (ocean90)
1e9781a945 Nav menus: Apply the wp_get_nav_menu_items filter also on an empty list of menu items.
props westonruter.
fixes #32631.

git-svn-id: https://develop.svn.wordpress.org/trunk@32748 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 14:37:25 +00:00
Scott Taylor
93e01e68b5 Add an abort class method to the Promise instance returned by wp.ajax.send().
Props westonruter.
Fixes #32628.


git-svn-id: https://develop.svn.wordpress.org/trunk@32747 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 14:29:42 +00:00
Dominik Schilling (ocean90)
2ac1bec5ca Nav menu: Introduce a has_nav_menu filter in has_nav_menu() to filter whether a nav menu is assigned to a specified location.
props westonruter.
fixes #32630.

git-svn-id: https://develop.svn.wordpress.org/trunk@32746 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 14:14:42 +00:00
Dominik Schilling (ocean90)
8502ee5f86 Nav menu: Allow the sortable items selector in wpNavMenu to be overridden.
props adamsilverstein.
fixes #32633.

git-svn-id: https://develop.svn.wordpress.org/trunk@32745 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-13 14:02:41 +00:00
Weston Ruter
0c7358cffc Customizer: Allow sections and panels to be exported to JS.
Also fix param docs for `customize_dynamic_setting_class` filter, and use `require_once` for `class-wp-customize-manager.php` in bootstrap function `_wp_customize_include()`.

See #30737, #32576.


git-svn-id: https://develop.svn.wordpress.org/trunk@32744 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 22:53:39 +00:00
Weston Ruter
4092c5a37e Fix regressions from [32649] wrt Customizer expanded and active state changes for sections.
The `args.completeCallback` was not always called when `onChangeExpanded()` was called. And when a section became inactive (`active` state goes to `false`) and it was currently `expanded`, the Customizer panel would then becomes blank as the section was hidden; it needed to `collapse()` the section first before hiding the element.

See #31336.



git-svn-id: https://develop.svn.wordpress.org/trunk@32743 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 22:27:51 +00:00
Scott Taylor
52cfab850f After [32740], in WP_Posts_List_Table::single_row() - $lock_holder is checked but unused, so the call to get_userdata() is unnecessary.
See #29881.


git-svn-id: https://develop.svn.wordpress.org/trunk@32742 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 20:47:46 +00:00
Scott Taylor
7fbeffec20 After [32740], correct doc block typo.
See #29881.


git-svn-id: https://develop.svn.wordpress.org/trunk@32741 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 20:28:22 +00:00
Scott Taylor
1de436b466 Override ->single_row_columns() in WP_Posts_List_Table.
Break apart the giant `switch` statement in `->single_row()` into `column_{$column_name}` methods.
To maintain the `->single_row_columns( $item )` interface, add a property, `$current_level`, to allow access to `$level`.

This list table class is now easier to subclass.

Props joehoyle, wonderboymusic.
See #29881.


git-svn-id: https://develop.svn.wordpress.org/trunk@32740 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 20:17:59 +00:00
Scott Taylor
87f0a73bdc In WP_Terms_List_Table::display_rows_or_placeholder():
* `get_terms()` can return `WP_Error`, so its return value should be checked before traversing.
* The 2nd call to `get_terms()` can be removed, it is redundant #OPTIMIZATION

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32739 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 18:54:56 +00:00
Scott Taylor
8463ad6f29 In WP_Posts_List_Table::single_row():
* `get_the_terms()` can return `WP_Error`, so its return value should be checked before traversing.
* Correct the `@param` doc blocks

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32738 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 18:49:18 +00:00
Scott Taylor
cae366cad0 In WP_Media_List_Table::display_rows(), get_the_terms() can return WP_Error, so its return value should be checked before traversing.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32737 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 18:44:50 +00:00
Scott Taylor
ca123a2054 In WP_Comments_List_Table::column_comment(), $post and $the_comment_status are unused, as is the $comment_status global.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32736 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 18:38:26 +00:00
Scott Taylor
9bb0d08c14 Fix some malformed doc blocks in Custom_Image_Header.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32735 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 18:34:49 +00:00
Scott Taylor
6b48cb1205 Fix some malformed doc blocks in Custom_Background.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32734 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 18:24:10 +00:00
Scott Taylor
9c42e158bc $status shouldn't be loosely compared to true in wp_xmlrpc_server::wp_deleteComment().
`$initial` shouldn't be loosely compared to `true` in `get_calendar()`.
`current_user_can()` shouldn't be loosely compared to `false` in `kses_init()`
`$get_all` shouldn't be loosely compared to `true` in `get_blog_details()`.
`is_array()` and `in_array()` shouldn't be loosely compared in `wpmu_validate_user_signup()`.
`$result` should by strictly compared in `check_ajax_referer()`.
`wp_verify_nonce()` should by strictly compared in `_show_post_preview()`.
`is_user_logged_in()` should not be loosly compared against `false` in `wp-signup.php`.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32733 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 17:47:16 +00:00
Scott Taylor
6c8e2e1ab0 WP_Customize_Setting::is_current_blog_previewed() should only return false, not false or void. The one invocation of the method only loosely checks the return value.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32732 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 17:28:46 +00:00
Scott Taylor
611261c223 Add the proper access modifier to _init_caps() in WP_User. Add __call() for BC.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32731 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 17:25:28 +00:00
Scott Taylor
3f29a2101d Don't loosely compare functions that return bool against a literal bool.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32730 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 17:18:38 +00:00
Scott Taylor
40c54bc238 page_template should be annotated as @property, not @property-read in WP_Post. The property is set on an instance in wp_insert_post()
Props morganestes.
Fixes #32515.


git-svn-id: https://develop.svn.wordpress.org/trunk@32729 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 17:00:59 +00:00
Scott Taylor
c7c55f20b5 After [32596] and [32597], ensure that wp_scripts|styles() is called to ensure an instance is created of WP_Scripts|Styles() before calling ->do_items().
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32728 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 16:53:17 +00:00
Boone Gorges
dba2b6a9c0 Introduce class argument to wp_dropdown_pages().
This new argument allows devs to specify the 'class' attribute of the select
element.

Props ramiy, voldemortensen.
Fixes #30082.

git-svn-id: https://develop.svn.wordpress.org/trunk@32727 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 13:04:04 +00:00
Dion Hulse
671218ac1d SSH2 Upgrade transport: Use ssh2_sftp_realpath() instead of shell commands to determine the current directory on the remote server. This should allow it to be used on chrooted SSH sessions.
See #32345


git-svn-id: https://develop.svn.wordpress.org/trunk@32726 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-12 06:30:58 +00:00
Konstantin Obenland
995753d1d0 Improve non-visual feedback for list table items without terms.
Props karpstrucking, afercia.
Fixes #32150.



git-svn-id: https://develop.svn.wordpress.org/trunk@32725 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-11 09:27:13 +00:00
Helen Hou-Sandi
c2ed5b170d List tables: Use a class instead of inline styles for hidden columns.
fixes #32608.


git-svn-id: https://develop.svn.wordpress.org/trunk@32724 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-10 19:46:39 +00:00
Helen Hou-Sandi
c296d882a8 List tables:
Since the primary column is not going to be alterable for plugins and MS themes, we don't need to check in on it.

see #25408.


git-svn-id: https://develop.svn.wordpress.org/trunk@32723 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-10 19:30:22 +00:00
Helen Hou-Sandi
1a0773a4b4 List tables: Better primary column back-compat.
Why are people manually setting `$_column_headers` other than because somebody else told them to? Maybe time will tell.

props kovshenin.
see #25408.


git-svn-id: https://develop.svn.wordpress.org/trunk@32722 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-10 14:58:42 +00:00
Helen Hou-Sandi
615ab22fea List tables: Consolidate <td> output for posts.
see #25408.


git-svn-id: https://develop.svn.wordpress.org/trunk@32721 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-10 14:00:55 +00:00
Konstantin Obenland
e66948cf50 More semantic markup for the post formats metabox.
Screen readers will now introduce the group of radio buttons.
Also brings the meta box to parity with Press This.

Props joedolson, afercia.
Fixes #26160.



git-svn-id: https://develop.svn.wordpress.org/trunk@32720 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-10 09:08:10 +00:00
Jeremy Felt
fc2ba19214 Additional improvement to sites list table display
* Build `$blogname` identically when creating action link messaging.
* Remove the trailing slash from URLs for a better UI.

See #32434.


git-svn-id: https://develop.svn.wordpress.org/trunk@32719 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-10 07:27:09 +00:00
Jeremy Felt
9170edb2b2 Improve information displayed in a network's sites list table
* Better support for arbitrary domain/path combinations by displaying the URL in the primary column rather than Path or Domain.
* Show a cached count of total users per site as a more useful data point rather than the first 5 users.
* Clear that cached count of users for a site when a user is added to the site via `add_user_to_blog()`.

Props @ocean90.
Fixes #32434.


git-svn-id: https://develop.svn.wordpress.org/trunk@32718 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-10 06:49:38 +00:00
Helen Hou-Sandi
74a6899d0d List tables:
* Avoid notices in custom list tables that manually set `$_column_headers`. Any plugins using this for a specific purpose should update.
* Restore a special class name in the users list table.

props georgestephanis, stephdau.
see #25408.


git-svn-id: https://develop.svn.wordpress.org/trunk@32717 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-10 01:45:11 +00:00
Konstantin Obenland
c7a40c6847 When inline editing a post, reset password field to be editable by default.
The Quick Edit form is cloned and then populated with post-specific data. If the 
previous post was private, the password field would continue to be disabled for
the next post.

Props afercia.
Fixes #32259.



git-svn-id: https://develop.svn.wordpress.org/trunk@32716 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-09 22:01:06 +00:00
Aaron Jorbin
b095afe2db Remove Truthy check from DO_NOT_UPGRADE_GLOBAL_TABLES
Some, but not all, of the checks for DO_NOT_UPGRADE_GLOBAL_TABLES just check if it is defined, so checking for truthiness could cause the issue to not be fully fixed.

In the words of Colonel Jessep: You can't handle the truth!

Introduced in [32714]

Fixes #32011



git-svn-id: https://develop.svn.wordpress.org/trunk@32715 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-09 21:59:51 +00:00
Aaron Jorbin
09340de73e Add error if a user attempts to install WordPress with DO_NOT_UPGRADE_GLOBAL_TABLES defined
The install process runs through migrations to global tables, therefore we cannot install WordPress with this constant defined. This error message prevents a false success screen from being seen.

Fixes #32011.
Props Oxymoron.



git-svn-id: https://develop.svn.wordpress.org/trunk@32714 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-09 17:58:18 +00:00
Boone Gorges
c04185a1f2 Avoid returning duplicate matches when using a meta query in WP_User_Query.
A meta_query containing an `OR` relation can result in the same record matching
multiple clauses, leading to duplicate results. The previous prevention against
duplicates [18178] #17582 became unreliable in 4.1 when `WP_Meta_Query`
introduced support for nested clauses. The current changeset adds a new method
`WP_Meta_Query::has_or_relation()` for checking whether an `OR` relation
appears anywhere in the query, and uses the new method in `WP_User_Query` to
enforce distinct results as necessary.

Props maxxsnake.
Fixes #32592.

git-svn-id: https://develop.svn.wordpress.org/trunk@32713 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-09 17:41:35 +00:00