Commit Graph

28695 Commits

Author SHA1 Message Date
Sergey Biryukov b87b8f2bb3 Introduce has_header_image() to check whether a header image is set.
props GunGeekATX, voldemortensen.
fixes #16268.
Built from https://develop.svn.wordpress.org/trunk@31224


git-svn-id: http://core.svn.wordpress.org/trunk@31205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-17 06:34:23 +00:00
Andrew Ozz 9d3ea188d7 Add support for IE conditional comments for WP_Scripts to match the functionality of WP_Styles, including unit tests. Props filosofo, aaroncampbell, ethitter, georgestephanis, valendesigns. Fixes #16024.
Built from https://develop.svn.wordpress.org/trunk@31223


git-svn-id: http://core.svn.wordpress.org/trunk@31204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-17 01:37:22 +00:00
Andrew Ozz f609d9d89a TinyMCE: add breaking out of blockquotes by pressing Enter twice. Togging blockquote on|off with the button and the shortcut is unchanged. Props avryl, fixes #23110.
Built from https://develop.svn.wordpress.org/trunk@31222


git-svn-id: http://core.svn.wordpress.org/trunk@31203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 23:36:22 +00:00
Scott Taylor 5458a4da21 `wp_set_object_terms()` takes `$taxonomy` as a string. Update `@param`.
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 23:27:25 +00:00
Scott Taylor 02a1f35ac8 Fix some internal types that are passed to functions to avoid changing the acceptable types passed as arguments to those functions:
* In `WP_Importer->is_user_over_quota()`, the default value for the first argument for `upload_is_user_over_quota()` is `true`. Don't bother passing `1`.
* When calling `submit_button()` with no `$name`, pass empty string instead of `false`.
* The default value for the 2nd argument to `get_edit_post_link()` is `'display'`. Because PHP is PHP, passing `true` is the same as passing `'display'` or nothing. Don't bother passing `true`. 
* In `WP_User_Meta_Session_Tokens::drop_sessions()`, pass `0` instead of `false` to `delete_metadata()` as the value for `$object_id`, which expects an int. 

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 22:51:21 +00:00
Scott Taylor eeda68bbda Fix some erroneous `@param` annotations.
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 22:44:25 +00:00
Boone Gorges fffd8c8e2d In `get_edit_term_link()`, default to a valid `$object_type`.
The $object_type param is used to set the 'post_type' query var, which
determines the post type menu that will be expanded when clicking through to
the term edit page. Not all taxonomies are associated with Posts, so it makes
sense to default to a post_type that the taxonomy is actually associated with.

Props DzeryCZ, juliobox.
Fixes #29251.
Built from https://develop.svn.wordpress.org/trunk@31218


git-svn-id: http://core.svn.wordpress.org/trunk@31199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 21:37:23 +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 7c5038feb6 Calling `->chown()` and `->chgrp()` in `WP_Filesystem_ftpsockets` produces no side-effects. Remove the calls. `->chgrp()` is defined in the super class, and does nothing, can be removed from the child class.
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 21:10:23 +00:00
Scott Taylor 6fa7021d62 Calling `->chown()` and `->chgrp()` in `WP_Filesystem_FTPext` produces no side-effects. Remove the calls. `->chgrp()` is defined in the super class, and does nothing, can be removed from the child class.
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 21:07:24 +00:00
Lance Willett f6fd49b357 Twenty Fifteen: keep sub-menus open when visiting sub-menu pages, to show context when navigating a site.
Props jartes, fixes #30722.
Built from https://develop.svn.wordpress.org/trunk@31214


git-svn-id: http://core.svn.wordpress.org/trunk@31195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 19:17:22 +00:00
Scott Taylor b8dd1f9c69 By initializing this array before a loop, Scrutinizer reports 0 (zero) "Coding Style" errors.
There are plenty of other kinds of errors, but this label will be cleared out.

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 19:13:23 +00:00
Scott Taylor bc55996a0b `@param` cleanup:
* `get_metadata()` will return literally anything, needs to be `mixed`
* `wp()` and `WP_Query::__construct()` no longer just take a query string
* Clarify a few others

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 19:03:23 +00:00
Scott Taylor cde4c83091 [31210] broke Supportflow on dotorg, which declares these methods as `protected`. Switch to `protected` for the noop methods. The subclasses can make them more visible using `public`.
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 18:37:24 +00:00
Scott Taylor 3fb283db0a Add 2 noop methods to `WP_List_Table`: `->column_default()` and `->column_cb()`.
`WP_List_Table` is essentially an `abstract` class. Some of its methods throw `die()` warnings if they aren't overridden in a child class.

These noop methods wouldn't be `abstract`, because they are not required in subclasses. However, `WP_List_Table` can call these methods in its own method, `->single_row_columns()`, whether a subclass defined them or not.

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 17:42:22 +00:00
Scott Taylor 895794f74d In `WP_Filesystem_Base` subclasses that set `$wp_base`, remove this dead code.
Unused since [8009] - "Make WP_Filesystem work with new directory constants"

There is currently no declared field and no `@property` annotation.

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 17:23:22 +00:00
Scott Taylor b29a20b90a `WP_Filesystem_Base` should declare `$errors` and `$options` as fields for use by subclasses.
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 17:10:43 +00:00
Boone Gorges 35f3f7bf63 Bail out of hierarchy loops in `_get_term_children()`.
This prevents infinite loops that lead to PHP nesting limit fatal errors.

Props boonebgorges, sgrant.
Fixes #24461.
Built from https://develop.svn.wordpress.org/trunk@31207


git-svn-id: http://core.svn.wordpress.org/trunk@31188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 17:10:22 +00:00
Boone Gorges 991bfdebc1 Bail out of hierarchy loops in `_pad_term_counts()`.
Taxonomy hierarchy loops should not occur naturally, but when they do, the
logic of `_pad_term_counts()` could result in infinite loops, leading to
timeouts. We avoid this by breaking when a loop is detected.

Fixes #20635.
Built from https://develop.svn.wordpress.org/trunk@31206


git-svn-id: http://core.svn.wordpress.org/trunk@31187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 16:46:23 +00:00
Scott Taylor 86f29795a4 Add `<s>` to `$allowedtags` in KSES.
From https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s :
"The <strike> element, alter ego of the <s> element is obsolete and should not be used on Web sites any more."

`<strike>` shall remain for BC, but `<s>` should not be stripped from the author (et al) role's HTML input.

Props paulschreiber.
Fixes #30954.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 16:07:23 +00:00
Scott Taylor 5f9a800110 In `comment_form()`, add the HTML5 `required` attribute next to `aria-required` in fields that utilize it.
Props MMN-o.
Fixes #24732.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 15:56:23 +00:00
Boone Gorges fb691a449b In `paginate_links()`, don't override custom format arguments when setting up default 'add_args'.
Since 4.1 [29780], the default value of the 'add_args' argument in
`paginate_links()` has been determined by parsing the current URL. This change
had the side effect of overriding custom values of 'format' that changed the
pagination query var, with the result that plugins using `paginate_links()`
with a custom format generated the incorrect links unless explicitly
declaring 'add_args=false' to prevent the default values from overriding. We
fix this behavior by parsing URL query vars into the 'add_args' array only
after the explicit function params have been parsed, and by skipping the
current page's pagination query var when doing this parsing (to avoid the
override).

Props obenland.
Fixes #30831 for trunk.
Built from https://develop.svn.wordpress.org/trunk@31203


git-svn-id: http://core.svn.wordpress.org/trunk@31184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 15:49:25 +00:00
Scott Taylor 3f8d8cec00 Add `@ignore` to `_wp_scripts_maybe_doing_it_wrong()`.
Props DrewAPicture for the thought leadership.
See #20513.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 05:38:21 +00:00
Scott Taylor 60c285aa22 In `wp_ajax_parse_media_shortcode()`, don't require a global `$post` for all passed shortcodes.
`embed` is the only shortcode that requires a post ID. This will allow MCE views to work for `playlist`, `audio`, and `video` outside of the Edit Post screen.

See #30835.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 05:19:22 +00:00
Scott Taylor 7f8b548df1 In HTML5, the `action` attribute is no longer required. Remove this attribute when empty.
The admin HTML is served with the HTML5 doctype.

"The action and formaction content attributes, if specified, must have a value that is a valid non-empty URL potentially surrounded by spaces." 
http://www.w3.org/html/wg/drafts/html/master/forms.html#attr-fs-action

Props voldemortensen.
Fixes #30126.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 04:16:24 +00:00
Gary Pendergast d0c327443c When a hyphen `-` or double hyphen `--` was at the start or the end of a string, it wasn't texturized correctly.
Fixes #31030


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


git-svn-id: http://core.svn.wordpress.org/trunk@31180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 03:54:24 +00:00
Helen Hou-Sandí 798439c273 Media: Prevent filter selects from jiggling when the spinner shows.
props valendesigns.
fixes #30725 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 03:00:23 +00:00
Scott Taylor e760ecfb13 Make `_wp_scripts_maybe_doing_it_wrong( $function )` "private".
Props obenland for the thought leadership.
See #20513.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 02:42:22 +00:00
Gary Pendergast b74f13511a 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


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


git-svn-id: http://core.svn.wordpress.org/trunk@31176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 02:39:23 +00:00
Scott Taylor 9ee49b130c 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 02:31:23 +00:00
Scott Taylor 2849a791b4 In `wp_print_scripts()`, bail if `$handles` is `false` and the `$wp_scripts` global has not been instantiated.
See [31192], #20513.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 02:28:22 +00:00
Scott Taylor 74a8d68bbf `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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 02:07:22 +00:00
Scott Taylor 378d66f038 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 01:51:24 +00:00
Scott Taylor 6f8e01adf2 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 01:49:25 +00:00
Scott Taylor cf6adef68f Revert [31032], this did not get much love.
See #25277.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 01:11:23 +00:00
Scott Taylor fe6b5983df 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 01:06:24 +00:00
Scott Taylor 6704875855 Replace the 3 remaining occurrences of `wpspin` GIF with `spinner`.
Props avryl.
Fixes #27482.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 00:33:22 +00:00
Scott Taylor 6b84df3bbd Ensure that `<figcaption>` is not autop'd.
Fixes #29219.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 00:27:21 +00:00
Andrew Ozz 3e529d6753 TinyMCE: remove the fade in/out when opening/closing native modals to match the rest of our UI. Props afercia, avryl. Fixes #27388.
Built from https://develop.svn.wordpress.org/trunk@31185


git-svn-id: http://core.svn.wordpress.org/trunk@31166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-15 23:29:21 +00:00
Lance Willett 7be12f7d8d 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.
Built from https://develop.svn.wordpress.org/trunk@31184


git-svn-id: http://core.svn.wordpress.org/trunk@31165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-15 23:10:22 +00:00
Lance Willett 4d00172987 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.
Built from https://develop.svn.wordpress.org/trunk@31183


git-svn-id: http://core.svn.wordpress.org/trunk@31164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-15 23:05:22 +00:00
Lance Willett 6960d5ce12 Twenty Fifteen: remove border on post navigation when post thumbnail is available.
Props jartes, fixes #30918.
Built from https://develop.svn.wordpress.org/trunk@31182


git-svn-id: http://core.svn.wordpress.org/trunk@31163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-15 23:03:26 +00:00
Helen Hou-Sandí 62a197d6bf 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-14 22:14:22 +00:00
Andrew Ozz a7dcd2d736 TinyMCE: select the iframe element by id. Needed as some browser extensions insert extra elements in the page. Props avryl, see #30785.
Built from https://develop.svn.wordpress.org/trunk@31180


git-svn-id: http://core.svn.wordpress.org/trunk@31161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-14 21:33:25 +00:00
Boone Gorges 3f033dc73d 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.
Built from https://develop.svn.wordpress.org/trunk@31179


git-svn-id: http://core.svn.wordpress.org/trunk@31160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-14 16:51:24 +00:00
Jeremy Felt 8d55b418ec 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@31159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-14 05:33:25 +00:00
Sergey Biryukov 19e51601ab Revert [31173] and target only taxonomy and link manager tables in keyboard focus code.
props afercia.
fixes #30980.
Built from https://develop.svn.wordpress.org/trunk@31177


git-svn-id: http://core.svn.wordpress.org/trunk@31158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-13 14:01:22 +00:00
Sergey Biryukov c3c35cf645 Customizer: Use deep-link for Widgets in toolbar on front-end.
props caseypatrickdriscoll.
fixes #30971.
Built from https://develop.svn.wordpress.org/trunk@31176


git-svn-id: http://core.svn.wordpress.org/trunk@31157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-13 07:45:22 +00:00
Sergey Biryukov b2b4233b7b Twenty Fifteen: Add print section to the table of contents in the stylesheet.
props iamtakashi.
fixes #30993.
Built from https://develop.svn.wordpress.org/trunk@31175


git-svn-id: http://core.svn.wordpress.org/trunk@31156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-13 07:21:21 +00:00
Sergey Biryukov 68c50a9e1b Scope attachment selectors in media views to avoid interfering with attachment pages on front-end.
props valendesigns.
fixes #30878.
Built from https://develop.svn.wordpress.org/trunk@31174


git-svn-id: http://core.svn.wordpress.org/trunk@31155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-13 07:16:23 +00:00