Commit Graph

28686 Commits

Author SHA1 Message Date
Gary Pendergast
58d931dfc7 Allow comment_post_ID to be passed to wp_update_comment(), so that a comment can be moved to a different post.
Props tyxla, rachelbaker

Fixes #30946



git-svn-id: https://develop.svn.wordpress.org/trunk@31195 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 02:38:30 +00:00
Scott Taylor
28d654837d After [31192], create a function, wp_styles(), to reduce duplicated code in functions.wp-styles.php. The style functions can reuse wp_scripts_maybe_doing_it_wrong( $function ) internally.
See #20513.


git-svn-id: https://develop.svn.wordpress.org/trunk@31194 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 02:30:08 +00:00
Scott Taylor
e1da69195d In wp_print_scripts(), bail if $handles is false and the $wp_scripts global has not been instantiated.
See [31192], #20513.


git-svn-id: https://develop.svn.wordpress.org/trunk@31193 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 02:27:49 +00:00
Scott Taylor
7ccdc6b470 functions.wp-scripts.php contains a lot of duplicated code. Make 2 new functions: wp_scripts() and wp_scripts_maybe_doing_it_wrong( $function ), to encapsulate the repeated logic.
Props GaryJ, scribu, wonderboymusic.
Fixes #20513.


git-svn-id: https://develop.svn.wordpress.org/trunk@31192 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 02:06:03 +00:00
Scott Taylor
acbf60c9a6 After [31186], remove figcaption from the list of inline elements that are autop'd in Tests_Formatting_Autop::test_that_wpautop_treats_inline_elements_as_inline().
See #29219.


git-svn-id: https://develop.svn.wordpress.org/trunk@31191 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 01:50:47 +00:00
Scott Taylor
bcc7f9e093 In WP_User, ->get_role_caps() and ->update_user_level_from_caps() must be called inside ->add_cap() and ->remove_cap() after updating user meta. ->has_cap() checks are currently failing directly after calling ->add_cap().
Adds unit test.

Props rachelbaker.
Fixes #28374.


git-svn-id: https://develop.svn.wordpress.org/trunk@31190 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 01:48:36 +00:00
Scott Taylor
5412af65d8 Revert [31032], this did not get much love.
See #25277.


git-svn-id: https://develop.svn.wordpress.org/trunk@31189 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 01:10:39 +00:00
Scott Taylor
5acc6bdb58 In PHP 5.0.0, is_a() became deprecated in favour of the instanceof operator. Calling is_a() would result in an E_STRICT warning.
In PHP 5.3.0, `is_a()` is no longer deprecated, and will therefore no longer throw `E_STRICT` warnings.

To avoid warnings in PHP < 5.3.0, convert all `is_a()` calls to `$var instanceof WP_Class` calls.

`instanceof` does not throw any error if the variable being tested is not an object, it simply returns `false`.

Props markoheijnen, wonderboymusic.
Fixes #25672.


git-svn-id: https://develop.svn.wordpress.org/trunk@31188 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 01:05:52 +00:00
Scott Taylor
102fb4ac5c Replace the 3 remaining occurrences of wpspin GIF with spinner.
Props avryl.
Fixes #27482.


git-svn-id: https://develop.svn.wordpress.org/trunk@31187 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 00:32:45 +00:00
Scott Taylor
0c71d0033a Ensure that <figcaption> is not autop'd.
Fixes #29219.


git-svn-id: https://develop.svn.wordpress.org/trunk@31186 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 00:26:36 +00:00
Andrew Ozz
adc9a1d565 TinyMCE: remove the fade in/out when opening/closing native modals to match the rest of our UI. Props afercia, avryl. Fixes #27388.
git-svn-id: https://develop.svn.wordpress.org/trunk@31185 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-15 23:28:39 +00:00
Lance Willett
ff779e2d0e Twenty Fifteen: move js and no-js class name functionality out of header template and into a wp_head hook in functions.php file so that the JavaScript functionality isn't hard-coded into a template file.
Fixes #30770, props chipbennett, valendesigns, and peterwilsoncc.

git-svn-id: https://develop.svn.wordpress.org/trunk@31184 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-15 23:09:07 +00:00
Lance Willett
f09026e439 Twenty Fifteen: remove unused CSS rules for wp_page_menu since are not used in the theme. And a bit of CSS cleanup.
Props iamtakashi, fixes #30957.

git-svn-id: https://develop.svn.wordpress.org/trunk@31183 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-15 23:04:28 +00:00
Lance Willett
541ec337cf Twenty Fifteen: remove border on post navigation when post thumbnail is available.
Props jartes, fixes #30918.

git-svn-id: https://develop.svn.wordpress.org/trunk@31182 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-15 23:02:24 +00:00
Helen Hou-Sandi
8ab449ae35 List tables: Use CSS :nth-child() selectors for zebra striping.
Note that this does not fix issues related to comment quick edit. Internal linking also continues to use the `.alternate` class for now. IE8 and below gracefully degrade by not having zebra striping.

There is some hoop jumping with adding an extra table row to maintain zebra striping during quick edit. Documenting that here for future reference; it is also in the inline documentation.

fixes #30981 and #26060. see #25060.


git-svn-id: https://develop.svn.wordpress.org/trunk@31181 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-14 22:13:03 +00:00
Andrew Ozz
84c0411bcc TinyMCE: select the iframe element by id. Needed as some browser extensions insert extra elements in the page. Props avryl, see #30785.
git-svn-id: https://develop.svn.wordpress.org/trunk@31180 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-14 21:32:23 +00:00
Boone Gorges
4b6957c852 Support array values in WP_Date_Query::validate_date_values().
Introduced in [29925], `validate_date_values()` throws `_doing_it_wrong()`
notices when values passed as part of a `WP_Date_Query` do not reflect actual
dates. However, the validation did not account properly for the case where an
array of multiple values is passed, as when doing IN or BETWEEN queries.

Props dlh.
Fixes #31001 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@31179 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-14 16:50:09 +00:00
Jeremy Felt
1a930c5d43 Don't overcheck the expected return from get_blog_details() in get_blogaddress_by_id()
If `get_blog_details()` is returning something that is not our expected object or `false`, then a notice would already be thrown there.

Also adds proper return docs to `get_blog_details()`.

Props SergeyBiryukov.

Fixes #30566


git-svn-id: https://develop.svn.wordpress.org/trunk@31178 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-14 05:32:19 +00:00
Sergey Biryukov
02d9bcbb7c Revert [31173] and target only taxonomy and link manager tables in keyboard focus code.
props afercia.
fixes #30980.

git-svn-id: https://develop.svn.wordpress.org/trunk@31177 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-13 14:00:15 +00:00
Sergey Biryukov
74bb197a4a Customizer: Use deep-link for Widgets in toolbar on front-end.
props caseypatrickdriscoll.
fixes #30971.

git-svn-id: https://develop.svn.wordpress.org/trunk@31176 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-13 07:44:57 +00:00
Sergey Biryukov
4b498e9201 Twenty Fifteen: Add print section to the table of contents in the stylesheet.
props iamtakashi.
fixes #30993.

git-svn-id: https://develop.svn.wordpress.org/trunk@31175 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-13 07:20:51 +00:00
Sergey Biryukov
b61f6f3a60 Scope attachment selectors in media views to avoid interfering with attachment pages on front-end.
props valendesigns.
fixes #30878.

git-svn-id: https://develop.svn.wordpress.org/trunk@31174 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-13 07:15:24 +00:00
Sergey Biryukov
cfa5aa457d Reveal row actions on focus on taxonomy screens.
props afercia.
fixes #30980.

git-svn-id: https://develop.svn.wordpress.org/trunk@31173 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-13 07:01:49 +00:00
Sergey Biryukov
819a53be46 Add 'user_id' to the list of fields wp_update_comment() can update.
props jphase.
fixes #30307.

git-svn-id: https://develop.svn.wordpress.org/trunk@31172 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-13 06:47:33 +00:00
Sergey Biryukov
a744bb9a5f Add 'comment_type' to the list of fields wp_update_comment() can update.
props desaiuditd.
fixes #30627.

git-svn-id: https://develop.svn.wordpress.org/trunk@31171 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-13 06:41:19 +00:00
Drew Jaynes (DrewAPicture)
9b0cf1bd5b Ensure we're using the correct @ignore phpDocumentor tag to mark elements that should be skipped when parsing.
Up to this point, various core elements' DocBlocks incorrectly included an `@internal` tag as a means for skipping the parsing process. When paired with a description (inline or otherwise), `@internal` is a valid tag meant to provide internal-only context, but not necessarily to skip parsing the entire element.

See #30987.


git-svn-id: https://develop.svn.wordpress.org/trunk@31170 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-13 00:50:32 +00:00
Drew Jaynes (DrewAPicture)
1f9ee350fc Remove an erroneous @internal tag from the DocBlock for get_children().
Use of the `@internal` tag caused the reference article for this function to be skipped during the parsing process.

Fixes #30987 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@31169 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-13 00:07:39 +00:00
Scott Taylor
865185903b There are some random add_action() and add_filter() calls littered around some files in wp-includes/. These should be moved to wp-includes/default-filters.php with the rest of the registered hooks. It seems like this was the best practice for awhile and then we randomly stopped. This file loads way before any of the includes, so the hooks will be registered for any request that loads WordPress, even SHORTINIT - a lot of the hooks registered won't run anyways (that's already the case).
See #30947.


git-svn-id: https://develop.svn.wordpress.org/trunk@31168 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 16:39:39 +00:00
Scott Taylor
47ba5e6c2e WP_Themes_List_Table accesses $_pagination_args from the parent class. Switch $_pagination_args to protected in WP_List_Table.
See #30891.


git-svn-id: https://develop.svn.wordpress.org/trunk@31167 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 16:25:30 +00:00
Scott Taylor
47a74bb21f Add a private field to WP_Terms_List_Table, $level.
See #30891.


git-svn-id: https://develop.svn.wordpress.org/trunk@31166 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 16:22:38 +00:00
Scott Taylor
b3f726efc4 Add a private field to WP_Posts_List_Table, $is_trash.
See #30891.


git-svn-id: https://develop.svn.wordpress.org/trunk@31165 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 16:21:08 +00:00
Scott Taylor
e5672bd8c5 Add a private field to WP_Plugin_Install_List_Table, $error.
See #30891.


git-svn-id: https://develop.svn.wordpress.org/trunk@31164 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 16:18:52 +00:00
Scott Taylor
02eaef3ae0 In lieu of refactoring, add a private field to WP_MS_Themes_List_Table, $has_items. Ideally, this class would overload ->has_items() and not set a private field.
See #30891.


git-svn-id: https://develop.svn.wordpress.org/trunk@31163 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 16:16:16 +00:00
Scott Taylor
f0c4ab3e69 Add 2 private fields to WP_Media_List_Table, $detached and $is_trash.
See #30891.


git-svn-id: https://develop.svn.wordpress.org/trunk@31162 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 16:07:41 +00:00
Scott Taylor
243d50d2f7 After [31146], properly declare $user_can as a private field in WP_Comments_List_Table.
See #30891.


git-svn-id: https://develop.svn.wordpress.org/trunk@31161 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 16:01:53 +00:00
Dion Hulse
32b020bf05 More concise documentation for wp_install_maybe_enable_pretty_permalinks()
See #6481. Props ericlewis.


git-svn-id: https://develop.svn.wordpress.org/trunk@31160 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 04:32:35 +00:00
Dion Hulse
0aaa2f0f32 The new wp_install_maybe_enable_pretty_permalinks() function doesn't need to be pluggable.
See #6481. Props nacin, valendesigns


git-svn-id: https://develop.svn.wordpress.org/trunk@31159 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 04:30:01 +00:00
Jeremy Felt
0eb9f7e414 Use a less complex approach for enforcing path slashes in update_blog_details()
Ensure leading and traling slashes are in place and don't touch anything in the middle. Validating with `array_filter()` would have missed a possible valid falsy path - `/my-path/0/`.

Props nacin.

Fixes #18117.


git-svn-id: https://develop.svn.wordpress.org/trunk@31158 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 04:20:47 +00:00
Jeremy Felt
d759c0ef23 Check for existence of data from get_blogaddress_by_id() before returning a URL
* Prevent a notice when an invalid ID is used with `get_blogaddres_by_id()`.
* Return a falsy empty string rather than the previous "http://".
* Add unit tests for `get_blogaddress_by_id()`.

Props nerrad.

Fixes #30566.


git-svn-id: https://develop.svn.wordpress.org/trunk@31157 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 02:23:43 +00:00
Jeremy Felt
331262b544 Update home and siteurl after path slashes are validated in update_blog_details()
When editing a site, if `home` and `siteurl` are checked to be updated along with a site's domain and path, they should receive the results of any modifications in `update_blog_details()` rather than trusting the POST data.

Previously, it was possible to save a value without a leading slash on the path, causing an invalid URL to be stored.

Props earnjam.

Fixes #30417.


git-svn-id: https://develop.svn.wordpress.org/trunk@31156 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 01:56:04 +00:00
Jeremy Felt
f9e9287875 Enforce leading and trailing slashes on paths updated with update_blog_details()
In multisite, core expects the stored value for a site's path to have leading and trailing slashes. When these slashes are missing, it becomes impossible to visit the site.

This enforces proper `/path/` creation in `update_blog_details()`, most likely used when updating an existing site through `site-info.php`.

Props earnjam, simonwheatley.

Fixes #18117. Fixes #23865.


git-svn-id: https://develop.svn.wordpress.org/trunk@31155 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 01:42:46 +00:00
Gary Pendergast
0b993ffe35 If get_avatar_data() is passed an empty value for the default avatar, we should be using the site's avatar_default option instead.
See #21195


git-svn-id: https://develop.svn.wordpress.org/trunk@31154 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 00:22:12 +00:00
Gary Pendergast
69f8b26d89 In get_avatar_data(), there's no need to return false if we couldn't find an avatar, as Gravatar can handle being given an empty email hash. This allows the default avatar to show when no email address is given.
See #21195



git-svn-id: https://develop.svn.wordpress.org/trunk@31153 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 00:19:34 +00:00
Gary Pendergast
d0fab598e7 In get_avatar(), revert the <img> tag attributes to using single quotes, instead of double quotes. This behaviour was changed in [31107], but caused problems for code that attempted to parse the <img> tag.
See #21195



git-svn-id: https://develop.svn.wordpress.org/trunk@31152 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 00:02:31 +00:00
Scott Taylor
156a673660 In WP_Query, only call magic method internals again whitelists of properties and methods, $compat_fields and $compat_methods. Remove __unset() since __set() is not implemented.
See #30891.


git-svn-id: https://develop.svn.wordpress.org/trunk@31151 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-11 22:40:53 +00:00
Scott Taylor
1178e8a6e1 In WP_Comment_Query, only allow __call() to run against ->get_search_sql().
See #30891.


git-svn-id: https://develop.svn.wordpress.org/trunk@31150 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-11 22:32:44 +00:00
Scott Taylor
f6d7c5e52f In wp_xmlrpc_server, only allow __call() to run against ->_multisite_getUsersBlogs().
See #30891.


git-svn-id: https://develop.svn.wordpress.org/trunk@31149 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-11 22:30:26 +00:00
Scott Taylor
cd3fde69bb In WP_oEmbed, only allow __call() to run against a whitelist of methods, $compat_methods.
See #30891.


git-svn-id: https://develop.svn.wordpress.org/trunk@31148 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-11 22:26:55 +00:00
Scott Taylor
5b6858eff8 In WP_Roles, only allow __call() to run against ->_init().
See #30891.


git-svn-id: https://develop.svn.wordpress.org/trunk@31147 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-11 22:23:00 +00:00
Scott Taylor
274253629f In WP_List_Table, only call magic method internals again whitelists of properties and methods, $compat_fields and $compat_methods.
See #30891.


git-svn-id: https://develop.svn.wordpress.org/trunk@31146 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-11 22:19:58 +00:00