Commit Graph

28916 Commits

Author SHA1 Message Date
Sergey Biryukov 4c4de36c5c Customizer: Fix form tag replacement in WP_Customize_Widgets::get_widget_control() after [31200].
see #30126.

git-svn-id: https://develop.svn.wordpress.org/trunk@31226 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-17 13:10:27 +00:00
Sergey Biryukov 6e206c2973 Use the site's local time to create the first post during installation.
props extendwings.
fixes #29296.

git-svn-id: https://develop.svn.wordpress.org/trunk@31225 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-17 10:06:42 +00:00
Sergey Biryukov e7bf16b423 Introduce has_header_image() to check whether a header image is set.
props GunGeekATX, voldemortensen.
fixes #16268.

git-svn-id: https://develop.svn.wordpress.org/trunk@31224 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-17 06:33:42 +00:00
Andrew Ozz f18854e866 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.
git-svn-id: https://develop.svn.wordpress.org/trunk@31223 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-17 01:36:55 +00:00
Andrew Ozz 5378b4e000 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.
git-svn-id: https://develop.svn.wordpress.org/trunk@31222 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 23:35:24 +00:00
Scott Taylor cd2d6d27d9 `wp_set_object_terms()` takes `$taxonomy` as a string. Update `@param`.
See #30799.


git-svn-id: https://develop.svn.wordpress.org/trunk@31221 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 23:26:38 +00:00
Scott Taylor 357fa4131a 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31220 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 22:50:20 +00:00
Scott Taylor 1d3b42d226 Fix some erroneous `@param` annotations.
See #30799.


git-svn-id: https://develop.svn.wordpress.org/trunk@31219 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 22:43:13 +00:00
Boone Gorges 5b7baae907 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@31218 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 21:36:12 +00:00
Scott Taylor 5deee71273 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31217 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 21:18:52 +00:00
Scott Taylor 2ed007c023 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31216 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 21:09:18 +00:00
Scott Taylor 9a16e6230b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31215 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 21:06:29 +00:00
Lance Willett 19b4a0053a Twenty Fifteen: keep sub-menus open when visiting sub-menu pages, to show context when navigating a site.
Props jartes, fixes #30722.

git-svn-id: https://develop.svn.wordpress.org/trunk@31214 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 19:16:56 +00:00
Scott Taylor d29abb1d24 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31213 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 19:12:15 +00:00
Scott Taylor 5743898e1e `@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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31212 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 19:02:26 +00:00
Scott Taylor 835dbe7baf [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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31211 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 18:36:46 +00:00
Scott Taylor e3ac341f24 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31210 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 17:41:50 +00:00
Scott Taylor 07d899740e 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31209 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 17:22:07 +00:00
Scott Taylor b0c6a64fbd `WP_Filesystem_Base` should declare `$errors` and `$options` as fields for use by subclasses.
See #30799.


git-svn-id: https://develop.svn.wordpress.org/trunk@31208 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 17:09:35 +00:00
Boone Gorges 60f2983b2e 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@31207 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 17:09:11 +00:00
Boone Gorges 8ae64f6384 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@31206 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 16:45:21 +00:00
Scott Taylor 18dbceee8c 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31205 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 16:06:47 +00:00
Scott Taylor db1ace58ca In `comment_form()`, add the HTML5 `required` attribute next to `aria-required` in fields that utilize it.
Props MMN-o.
Fixes #24732.


git-svn-id: https://develop.svn.wordpress.org/trunk@31204 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 15:55:50 +00:00
Boone Gorges af146fef8c 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@31203 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 15:48:24 +00:00
Scott Taylor 7c707c6633 Add `@ignore` to `_wp_scripts_maybe_doing_it_wrong()`.
Props DrewAPicture for the thought leadership.
See #20513.


git-svn-id: https://develop.svn.wordpress.org/trunk@31202 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 05:37:06 +00:00
Scott Taylor 8ebe917c6b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31201 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 05:18:17 +00:00
Scott Taylor 83b6fad852 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31200 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 04:15:52 +00:00
Gary Pendergast c8c8b66bae When a hyphen `-` or double hyphen `--` was at the start or the end of a string, it wasn't texturized correctly.
Fixes #31030



git-svn-id: https://develop.svn.wordpress.org/trunk@31199 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 03:54:00 +00:00
Helen Hou-Sandi d266ecd5b2 Media: Prevent filter selects from jiggling when the spinner shows.
props valendesigns.
fixes #30725 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@31197 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 02:59:59 +00:00
Scott Taylor c6ba804b33 Make `_wp_scripts_maybe_doing_it_wrong( $function )` "private".
Props obenland for the thought leadership.
See #20513.


git-svn-id: https://develop.svn.wordpress.org/trunk@31196 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 02:41:07 +00:00
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