Commit Graph

31159 Commits

Author SHA1 Message Date
Drew Jaynes
76f5134023 Docs: Add a file header to wp-includes/class-wp-widget.php, created when the WP_Widget class was moved to its own file in [33746].
It's important for every file in WordPress, regardless of makeup or architecture, to have its own file header, even if the file contains nothing but a class. When parsed, files and classes are mutually exclusive and should be documented with this in mind.

See [33746]. See #33413.


git-svn-id: https://develop.svn.wordpress.org/trunk@33755 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 07:44:59 +00:00
Weston Ruter
9c4f261598 Customizer: Ensure persistence of unchanged active state for controls, sections, and panels.
Props nikeo, westonruter.
Fixes #33428 for trunk.
See also #33494.


git-svn-id: https://develop.svn.wordpress.org/trunk@33754 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 07:25:20 +00:00
Weston Ruter
e32f3cd3e1 Customizer: Prevent JS error during init when nav_menus panel is removed by plugin.
Fixes #33411 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@33753 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 06:42:16 +00:00
Scott Taylor
28217ae6a0 Roles: move classes into their own file. capbilities.php loads the new files, so this is 100% BC if someone is loading capbilities.php directly. New files created using svn cp.
Creates: 
`class-wp-roles.php` 
`class-wp-role.php` 
`class-wp-user.php` 
`capbilities-functions.php` 

`capbilities.php` contains only top-level code. Class files only contains classes. Functions file only contains functions.

See #33413.


git-svn-id: https://develop.svn.wordpress.org/trunk@33752 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 04:57:48 +00:00
Scott Taylor
799f28a918 Rewrite: move WP_Rewrite into its own file. rewrite.php loads the new files, so this is 100% BC if someone is loading rewrite.php directly. New files created using svn cp.
The rewrite functions have all kinds of cross-dependencies (like `WP_Query`), so loading the file by itself would have been bizarre (and still is).

Creates: 
`rewrite-constants.php` 
`rewrite-functions.php` 
`class-wp-rewrite.php` 

`rewrite.php` contains only top-level code. Class file only contains the class. Functions file only contains functions.

See #33413.


git-svn-id: https://develop.svn.wordpress.org/trunk@33751 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 04:41:29 +00:00
Scott Taylor
d61669232c Comments: move WP_Comment_Query into its own file. comment.php loads the new files, so this is 100% BC if someone is loading comment.php directly. New files created using svn cp.
Creates: 
`class-wp-comment-query.php` 
`comment-functions.php` 

`comment.php` contains only top-level code. Class file only contains the class. Functions file only contains functions.

See #33413.


git-svn-id: https://develop.svn.wordpress.org/trunk@33750 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 04:26:29 +00:00
Scott Taylor
7b58399a45 Users: move WP_User_Query into its own file. user.php loads the new files, so this is 100% BC if someone is loading user.php directly (a lot of plugins do). New files created using svn cp.
Creates: 
`class-wp-user-query.php` 
`user-functions.php` 

`user.php` contains only top-level code. Class file only contains the class. Functions file only contains functions.

See #33413.


git-svn-id: https://develop.svn.wordpress.org/trunk@33749 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 04:19:32 +00:00
Scott Taylor
f4ecd11e10 HTTP: move classes into their own files, http.php loads the new files, so this is 100% BC if someone is loading http.php directly. New files created using svn cp.
`class-http.php` requires functions from `http.php`, so loading it by itself wouldn't have worked.

Creates: 
`class-wp-http-cookie.php` 
`class-wp-http-curl.php` 
`class-wp-http-encoding.php` 
`class-wp-http-proxy.php` 
`class-wp-http-streams.php` 
`http-functions.php` 

`WP_Http` remains in `class-http.php`.

`http.php` contains only top-level code. Class files only contain classes. Functions file only contains functions.

See #33413.


git-svn-id: https://develop.svn.wordpress.org/trunk@33748 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 03:55:00 +00:00
Gary Pendergast
2b67add6dd When wp_json_encode() calls json_encode(), the latter will generate warnings if the string contains non-UTF-8 characters. No-one likes warnings, so we need to do something about that.
The good news is, the point of `wp_json_encode()` is to handle those non-UTF-8 characters. It'll totally just fix them up, no problem.

Anyway, we can just ignore those warnings.

Fixes #33524.



git-svn-id: https://develop.svn.wordpress.org/trunk@33747 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 03:25:15 +00:00
Scott Taylor
6c71ee8d84 Widgets: move classes into their own files, widgets.php loads the new files, so this is 100% BC if someone is loading widgets.php directly. New files created using svn cp.
Creates: 
`class-wp-widget.php` 
`class-wp-widget-factory.php` 
`widget-functions.php` 

`widgets.php` contains only top-level code. Class files only contain classes. Functions file only contains functions.

See #33413.


git-svn-id: https://develop.svn.wordpress.org/trunk@33746 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 02:39:50 +00:00
Sergey Biryukov
0654d9ed35 Add oEmbed support for ReverbNation.
props rhubbardreverb.
fixes #33207.

git-svn-id: https://develop.svn.wordpress.org/trunk@33745 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 00:28:11 +00:00
Sergey Biryukov
b935049f24 Add 'wp_verify_nonce_failed' action that fires when nonce verification fails.
props johnbillion, garza, Shelob9.
fixes #24030.

git-svn-id: https://develop.svn.wordpress.org/trunk@33744 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 00:05:11 +00:00
Sergey Biryukov
4bc9b3db6d Fire the check_ajax_referer action on failure as well as success.
See [33017] for `check_admin_referer`.

props egill.
fixes #33342.

git-svn-id: https://develop.svn.wordpress.org/trunk@33743 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 23:24:39 +00:00
Sergey Biryukov
6598033243 Remove rounded corners from "Choose from the most used tags" result in Tags meta box.
props tyxla.
fixes #31560.

git-svn-id: https://develop.svn.wordpress.org/trunk@33742 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 23:13:30 +00:00
Sergey Biryukov
b73b9ed936 Customizer: Use existing decoupled strings in Menu Locations section. See [31941] and [31951].
props egill.
fixes #33416.

git-svn-id: https://develop.svn.wordpress.org/trunk@33741 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 21:52:45 +00:00
Scott Taylor
a0a351a75d Add some more data for Shortcode unit tests.
Props miqrogroove.
Fixes #33455.


git-svn-id: https://develop.svn.wordpress.org/trunk@33740 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 21:50:55 +00:00
Scott Taylor
4a622d21fb Allow these CSS properties in KSES: min-height', 'max-height', 'min-width', 'max-width'
Props MikeHansenMe.
Fixes #31949.


git-svn-id: https://develop.svn.wordpress.org/trunk@33739 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 21:45:42 +00:00
Scott Taylor
c76e3b3273 Pass option name to option and transient filters with dynamic names.
Props Viper007Bond, SergeyBiryukov, MikeHansenMe.
Fixes #28402.


git-svn-id: https://develop.svn.wordpress.org/trunk@33738 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 21:41:53 +00:00
wonderboymusic
20bad276e8 After [33698], wrap the time constants in a DocBlock template.
Props egill.
Fixes #33397.


git-svn-id: https://develop.svn.wordpress.org/trunk@33737 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 21:20:02 +00:00
Scott Taylor
1fb94edb99 In get_home_url(), import the $pagenow global to avoid having to check if it exists before comparing against it.
Props KalenJohnson.
See #33545.


git-svn-id: https://develop.svn.wordpress.org/trunk@33736 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 21:02:14 +00:00
Scott Taylor
ff7fcf5f04 In WP_Users_List_Table::single_row(), $actions is not always set before being used.
See #33491.


git-svn-id: https://develop.svn.wordpress.org/trunk@33735 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 20:37:50 +00:00
Scott Taylor
3b8c5529cb foreach is a statement, not a function.
See #33491.


git-svn-id: https://develop.svn.wordpress.org/trunk@33734 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 20:27:56 +00:00
Scott Taylor
755d109d10 Instead of [33713], allow WP_Posts_List_Table::get_bulk_actions() to check edit_posts AND delete_posts.
Props DeBAAT.
Fixes #29789.


git-svn-id: https://develop.svn.wordpress.org/trunk@33733 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 20:11:27 +00:00
Sergey Biryukov
b59d10ccac Multisite: Add 'invite_user' action that fires immediately after a user is invited to join a site, but before the notification is sent.
props ebinnion, MikeHansenMe, DrewAPicture.
fixes #33008.

git-svn-id: https://develop.svn.wordpress.org/trunk@33732 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 17:47:26 +00:00
Drew Jaynes
40ce8c68fe Docs: The type for the $t_time parameter in the post_date_column_time filter docs should be string, not array.
Props jjeaton
Fixes #33540.


git-svn-id: https://develop.svn.wordpress.org/trunk@33731 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 17:14:28 +00:00
Drew Jaynes
e853c467fd Docs: Document the default comment data arguments for wp_new_comment().
Props rachelbaker, DrewAPicture
Fixes #32369.


git-svn-id: https://develop.svn.wordpress.org/trunk@33730 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 17:02:51 +00:00
Scott Taylor
e1b1541932 Media:
When inserting an image into a post, the values in `wp.media.controller.Library` should not default to linking the image when no user settings are present.

The default display setting value for `link` is now `none`. User settings persist and will override or confirm this value based on user actions.

Props liljimmi, janhenckens, eherman24, wonderboymusic.
Fixes #31467.


git-svn-id: https://develop.svn.wordpress.org/trunk@33729 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 12:12:59 +00:00
Andrew Ozz
a9b27cbc07 TinyMCE: ensure the wordpress plugin is loaded before calling _createToolbar().
Props hauvong, azaozz. Fixes #33393.

git-svn-id: https://develop.svn.wordpress.org/trunk@33728 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 04:37:27 +00:00
Dion Hulse
3b525395cc Term Splitting: Switch to a faster cron unschedule process to benefit sites with thousands of affected jobs. Fix the cron hook name in the failsafe rescheduler.
Props Otto42, dd32, peterwilsoncc
See #33423


git-svn-id: https://develop.svn.wordpress.org/trunk@33727 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 04:31:52 +00:00
Gary Pendergast
8b0cfb52ca Build Tools: Update grunt-contrib-uglify to 0.9.2.
Fixes #33533.



git-svn-id: https://develop.svn.wordpress.org/trunk@33726 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 03:27:23 +00:00
Drew Jaynes
bc9e25d053 Docs: Clarify the return description for wp_create_user() to illustrate that a WP_Error object will be returned on failure.
Props jmayhak
Fixes #33321.


git-svn-id: https://develop.svn.wordpress.org/trunk@33725 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-24 22:22:33 +00:00
Boone Gorges
32cd95e1c1 In WP_Query::parse_tax_query(), allow 'cat' and 'tag' querystrings to be formatted as arrays.
See [33095] #32454 for a previous fix related to custom taxonomies.

Props Veraxus.
Fixes #33532.

git-svn-id: https://develop.svn.wordpress.org/trunk@33724 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-24 21:21:49 +00:00
Scott Taylor
5f3879e37c With a few modifications in wp-admin/menu.php, we can eliminate the extra logic for Post and Page menu registration. Instead, they can just declare menu_position on post type registration.
Props scribu, wonderboymusic.
Fixes #16865.


git-svn-id: https://develop.svn.wordpress.org/trunk@33723 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-24 21:18:20 +00:00
Scott Taylor
dc577d6072 WP_Query: add changelog for the title param after [33706]
Props dimadin.
Fixes #33074.


git-svn-id: https://develop.svn.wordpress.org/trunk@33722 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-24 20:09:25 +00:00
Drew Jaynes
7b7cd91984 Docs: Improve pared formatting of the oEmbed providers tables by removing the unrecognized first and last rows in the hook docs for the oembed_providers filter.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@33720 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-24 04:37:40 +00:00
Gary Pendergast
845d31baf9 oEmbed: Remove blip.tv as an oEmbed provider, the service has been shut down.
Vale, blip.tv.

Fixes #33522.

Props rabmalin.



git-svn-id: https://develop.svn.wordpress.org/trunk@33719 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-24 04:11:13 +00:00
Gary Pendergast
bf3d36e0b6 WPDB: get_table_from_query() didn't find table names with hyphens in them.
Props dustinbolton for the fix.

Fixes #33470.



git-svn-id: https://develop.svn.wordpress.org/trunk@33718 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-24 00:18:49 +00:00
Drew Jaynes
83476bb77f Docs: Add a description and example to the hook docs for the navigation_markup_template filter, introduced in [33714].
Since the value of the filter is passed through `sprintf()` it's important to note that any filtered output needs to contain the expected specifiers.

See #31315.


git-svn-id: https://develop.svn.wordpress.org/trunk@33717 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-23 18:07:41 +00:00
Drew Jaynes
3969554606 Docs: Better clarify that the $post_type parameter for the get_usernumposts filter and count_user_posts() can accept either a single post type or array of post types.
Props tyxla
See #33481. Fixes #33520.


git-svn-id: https://develop.svn.wordpress.org/trunk@33716 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-23 17:45:51 +00:00
Drew Jaynes
797b6c4d7c Docs: Add better documentation for all accepted values for the fields argument in get_terms().
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@33715 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-23 17:39:07 +00:00
Scott Taylor
d8ba4fde1b Add a filter to _navigation_markup: 'navigation_markup_template'
Props joedolson, mordauk.
Fixes #31315.


git-svn-id: https://develop.svn.wordpress.org/trunk@33714 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-23 16:33:25 +00:00
Scott Taylor
9596ae0993 Posts List Table:
Don't show bulk actions if the user can't edit posts.

Props DrewAPicture.
Fixes #29789.


git-svn-id: https://develop.svn.wordpress.org/trunk@33713 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-23 16:27:44 +00:00
Drew Jaynes
dfa9da5356 Docs: Fix a minor alignment issue in the DocBlock for get_pagenum_link().
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@33712 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-23 07:18:19 +00:00
Boone Gorges
b01b3be23e In wp_delete_term(), the $deleted_term object passed to filters should be generated before term relationships are deleted.
This allows the `count` property to reflect the pre-delete state of affairs,
rather than always being 0.

Props nicholas_io.
Fixes #33485.

git-svn-id: https://develop.svn.wordpress.org/trunk@33711 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-22 19:42:30 +00:00
Boone Gorges
6c3449b710 Pass the $public_only value to 'get_usernumposts' filter.
[32523] introduced the `$public_only` parameter to `count_user_posts()`. That
changeset was supposed to pass `$public_only` to the 'get_usernumposts' filter
at the end of the function, but only the documentation was modified, not the
filter itself.

This changeset also fixes an incorrect variable name in the docblock for
the same filter.

Props swisspidy, tmatsuur.
Fixes #33481 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@33710 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-22 18:58:18 +00:00
Scott Taylor
a679368d8b Add some JS Docs for Customizer.
Props ericlewis.
See #33503.


git-svn-id: https://develop.svn.wordpress.org/trunk@33709 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-22 17:23:37 +00:00
Scott Taylor
7e894153a4 In wp_insert_user(), add a filter: insert_user_meta, to filter a user's meta values and keys before the user is created or updated.
Props tharsheblows, chriscct7, DrewAPicture.
Fixes #31549.


git-svn-id: https://develop.svn.wordpress.org/trunk@33708 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-22 17:11:42 +00:00
Scott Taylor
36a9be2af5 In wp_sanitize_redirect(), don't eat @ characters. According to RFC 3986, "@" is a perfectly valid character in a URL path or query string.
Adds unit test.

Props markjaquith.
Fixes #18818.


git-svn-id: https://develop.svn.wordpress.org/trunk@33707 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-22 17:04:17 +00:00
Scott Taylor
dc48f3d795 Query:
Add a query var, `title`, that allows you to query posts by `post_title`. To accomplish this now, you have to do something like:

{{{
$tacos = get_posts( [
  'post_type' => 'taco',
  's' => $name,
  'exact' => true,
  'sentence' => true,
  'post_status' => 'publish',
  'fields' => 'ids',
  'posts_per_page' => 1
] );
}}}

Adds unit tests.

Fixes #33074.


git-svn-id: https://develop.svn.wordpress.org/trunk@33706 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-22 16:58:21 +00:00
Scott Taylor
a70e0183e5 Ensure that attachment_url_to_postid() matches cross-scheme when front-end and back-end schemes are different.
Adds unit test.

Props welcher.
Fixes #33109.


git-svn-id: https://develop.svn.wordpress.org/trunk@33705 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-22 16:38:09 +00:00