Commit Graph

27691 Commits

Author SHA1 Message Date
Boone Gorges 00f7ae376a Better "inclusive" support for string values in WP_Date_Query.
The 'inclusive' parameter for WP_Date_Query determines whether non-precise
dates for 'before' and 'after' will be rounded up or down. Previously, this was
supported only when 'before' and 'after' were arrays; string-formatted dates
were run through strtotime(), which rounded them all down (inclusive in the
case of after, non-inclusive in the case of before). Now, we attempt to parse
formats that look like MySQL-formatted date strings, and apply inclusive logic
to them if we recognize them successfully.

Fixes #29908.
string values. Array values support the 'inclusive

git-svn-id: https://develop.svn.wordpress.org/trunk@29936 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-17 02:27:44 +00:00
Boone Gorges aee4647da0 Comment/post author in/not_in for `WP_Comment_Query`.
Props nofearinc, chriscct7.
Fixes #29885.

git-svn-id: https://develop.svn.wordpress.org/trunk@29935 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-17 01:57:18 +00:00
Boone Gorges 64bc8466db Support date_query by user_registered in WP_User_Query.
Props ChriCo, nacin.
Fixes #27283.

git-svn-id: https://develop.svn.wordpress.org/trunk@29934 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-17 01:36:36 +00:00
Boone Gorges 42646e67b3 Use table aliases for columns in SQL generated by WP_Date_Query.
The use of non-aliased column names (eg 'post_date' instead of 'wp_posts.post_date')
in WP_Date_Query causes SQL notices and other failures when queries involve
table joins, such as date_query combined with tax_query or meta_query. This
changeset modifies WP_Date_Query::validate_column() to add the table alias when
it can be detected from the column name (ie, in the case of core columns).

A side effect of this change is that it is now possible to use WP_Date_Query
to build WHERE clauses across multiple tables, though there is currently no
core support for the automatic generation of the necessary JOIN clauses. See

Props ew_holmes, wonderboymusic, neoxx, Viper007Bond, boonebgorges.
Fixes #25775.

git-svn-id: https://develop.svn.wordpress.org/trunk@29933 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-17 01:19:03 +00:00
Boone Gorges 8692199bb5 Add expectedIncorrectUsage flags for unit tests that generate invalid dates.
Since [29925], passing an invalid date to WP_Date_Query will generate a
_doing_it_wrong() notice. The current changeset adds the
`@expectedIncorrectUsage` flag to those existing unit tests that generate
invalid dates, such as those that test canonical redirect and is_404()
conditionals.

Fixes #25834.

git-svn-id: https://develop.svn.wordpress.org/trunk@29932 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-17 00:40:06 +00:00
Boone Gorges 44bb383371 Remove invalid `continue` calls from WP_Tax_Query::get_sql_for_clause().
This was leftover code from the previous implementation, which used a `foreach()`
loop. See [29901].

Props nofearinc.
See #29738, #29718.

git-svn-id: https://develop.svn.wordpress.org/trunk@29931 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 22:06:46 +00:00
Ian Stewart 136436e9f1 Twenty Fifteen: readable comment details in the dark colour scheme.
Props NikV, fixes #29970.



git-svn-id: https://develop.svn.wordpress.org/trunk@29930 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 22:00:23 +00:00
Andrew Ozz 8348a50194 Editor-expand:
- Better calculation for the caret position when auto-scrolling while typing.
- Fix auto-scrolling for non-WebKit browsers when the caret is above the top of the editor.
Fixes #29954

git-svn-id: https://develop.svn.wordpress.org/trunk@29929 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 21:31:00 +00:00
Ian Stewart f3bcbc8ada Twenty Fifteen: document the site-branding class in header.php.
Props NikV, fixes #29961.



git-svn-id: https://develop.svn.wordpress.org/trunk@29928 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 20:51:11 +00:00
Ian Stewart 722005655c Twenty Fifteen: make sure we don't see borders through transparent linked images.
Props iamtakashi, fixes #29963.



git-svn-id: https://develop.svn.wordpress.org/trunk@29927 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 20:47:35 +00:00
Ian Stewart 019998e325 Twenty Fifteen: Removes flashing of background behind fixed position elements when scrolling in mobile and desktop Safari.
Props iamtakashi, fixes #29973 and #29987.


git-svn-id: https://develop.svn.wordpress.org/trunk@29926 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 20:34:10 +00:00
Boone Gorges a3da10deb0 Throw notices when invalid date values are passed to WP_Date_Query.
`_doing_it_wrong()` notices are now generated when passing out-of-range values
(`month=13`) or invalid dates (`2014-02-29`).

Includes unit tests.

Props ChriCo.
Fixes #25834.

git-svn-id: https://develop.svn.wordpress.org/trunk@29925 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 20:11:13 +00:00
Dominik Schilling (ocean90) 3d6d32d9e6 Themes: Make it possible to delete broken themes.
props ideag, obenland.
fixes #28165.

git-svn-id: https://develop.svn.wordpress.org/trunk@29924 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 19:45:26 +00:00
Boone Gorges a3e0c08f2f Introduce nested query support to WP_Date_Query.
This enhancement makes it possible to filter post, comment, and other queries
by date in ways that are arbitrarily complex, using mixed AND and OR relations.

Includes unit tests for the new syntax. In a few places, the existing unit
tests were slightly too strict (such as when checking the exact syntax of a SQL
string); these existing tests have been narrowed.

Props boonebgorges.
Fixes #29822.

git-svn-id: https://develop.svn.wordpress.org/trunk@29923 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 19:33:24 +00:00
Ian Stewart c845692fb4 Twenty Fifteen: indented nested lists in comments.
Props pauldewouters, iamtakashi, fixes #29981.



git-svn-id: https://develop.svn.wordpress.org/trunk@29922 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 19:31:09 +00:00
Ian Stewart ed5e22d2f7 Twenty Fifteen: correct margin for pagination.
Props kwight; fixes #29964.



git-svn-id: https://develop.svn.wordpress.org/trunk@29921 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 19:15:33 +00:00
Dominik Schilling (ocean90) f3eb0eacc6 Update jQuery UI to 1.11.2.
Changelog: http://jqueryui.com/changelog/1.11.2/

see #29833.

git-svn-id: https://develop.svn.wordpress.org/trunk@29920 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 19:01:44 +00:00
Ian Stewart 935bc467b5 Twenty Fifteen: add print styles.
Props iamtakashi, closes #29967



git-svn-id: https://develop.svn.wordpress.org/trunk@29919 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 19:01:18 +00:00
Ian Stewart 4eb5c81721 Twenty Fifteen: correct font fallback for Noto Serif in editor styles; Props Manoz69; Fixes #29984
git-svn-id: https://develop.svn.wordpress.org/trunk@29918 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 18:39:06 +00:00
Scott Taylor bd70f47d46 In `wp.Uploader`, when `uploader:ready` is triggered, set `ready` to `true` on the instance. This allows media workflows to check for an existing uploaded instance when opening.
Without this check, workflows might wait for `uploader:ready`, which could already have been fired. This would result in an unresponsive editor dropzone.

Fixes #29689.


git-svn-id: https://develop.svn.wordpress.org/trunk@29917 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 05:53:15 +00:00
Jeremy Felt f0b35fe7d5 Split and organize multisite unit tests
* Move `ms.php` to `multisite.php`
* Create `multisite.php` under directories `option/` and `user/` to better match existing structure.
* Create a `multisite/` directory containing `bootstrap.php`, `site.php`, and `network.php` for very multisite specific testing.
* Add unit test groups ms-site, ms-user, ms-option, ms-network, and ms-bootstrap.

Fixes #29896


git-svn-id: https://develop.svn.wordpress.org/trunk@29916 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 05:06:22 +00:00
Scott Taylor 0d58d32462 Cache `get_term_by()` calls:
* Add a helper function, `wp_get_last_changed()`, to retrieve a last-modified timestamp by cache group
* When caching a term, also make cache entries for slug and name via `slug:{$term_id}` and `name:{$term_id}` keys in the `$taxonomy:$last_changed` bucket that reference the term_id
* In `clean_term_cache()` and `update_term_cache()`, respect `$_wp_suspend_cache_invalidation`
* Original term cache entries maintain BC

Adds unit tests.

Props wonderboymusic, tollmanz, boonebgorges.
Fixes #21760.


git-svn-id: https://develop.svn.wordpress.org/trunk@29915 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 04:44:13 +00:00
Scott Taylor 076c7e8902 Add a 6th (!) attribute to `wp_get_attachment_link()` to allow `aria-describedby` to be added to gallery output.
Props joedolson, DrewAPicture, rianrietveld.
Fixes #27402.


git-svn-id: https://develop.svn.wordpress.org/trunk@29914 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 04:27:07 +00:00
Scott Taylor 248fc182b8 Fix `Tests_Paginate_Links` tests by properly setting up / tearing down permalink structure.
Props jorbin.
Fixes #29636.


git-svn-id: https://develop.svn.wordpress.org/trunk@29913 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 04:22:16 +00:00
Boone Gorges e36cac6794 Check that search value is scalar before parsing.
Prevents PHP notices when non-scalar values are passed.

Includes unit tests.

Props tivnet.
Fixes #29736.

git-svn-id: https://develop.svn.wordpress.org/trunk@29912 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 03:31:27 +00:00
Andrew Ozz 136bba8cfd Twenty Fifteen, editor-style.css: revert the font-size back to 19px and margin back to 83px, merge the two body selectors (don't seem needed), remove redundant rtl rules and fix body.rtl selector. See #29799
git-svn-id: https://develop.svn.wordpress.org/trunk@29911 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-16 00:26:20 +00:00
Andrew Ozz 350439b05f Twenty Fifteen: no `rem` in editor-style.css for now, see #29799
git-svn-id: https://develop.svn.wordpress.org/trunk@29910 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 22:47:38 +00:00
Andrew Ozz 44e3ddfe7d Twenty Fifteen: make font-size/line-height in editor-style.css the same as in style.css. Remove margins from the editor body, interferes with autoresize in some browsers and is overriden in the default styles. See #29799
git-svn-id: https://develop.svn.wordpress.org/trunk@29909 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 22:36:27 +00:00
Dominik Schilling (ocean90) 5d7e30e7d9 Comments: Don't print an empty HTML markup when `comment_reply_link()` returns no link.
props obenland.
fixes #29895.

git-svn-id: https://develop.svn.wordpress.org/trunk@29908 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 21:55:31 +00:00
Dominik Schilling (ocean90) e6d26285cc Customizer: Don't trigger a change event if two unchanged object values are equal, second pass.
Make Underscore.js a dependency for `customize-base` and use `_.isEqual()` to compare the values.
(Underscore.js was already enqueued via wp-util.js for Widgets.)

props westonruter.
fixes #26061.

git-svn-id: https://develop.svn.wordpress.org/trunk@29907 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 18:25:43 +00:00
Boone Gorges d4239b67da Fix test_build_mysql_datetime_datetime_non_array().
The expected value was being incorrectly built.

git-svn-id: https://develop.svn.wordpress.org/trunk@29906 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 17:52:05 +00:00
Dominik Schilling (ocean90) 83b0f3f681 Customizer: Only POST dirty settings to preview to improve performance.
props westonruter.
fixes #29983.

git-svn-id: https://develop.svn.wordpress.org/trunk@29905 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 17:49:36 +00:00
Dominik Schilling (ocean90) 5829ccba9b Theme install: Remove unused strings.
fixes #29488.

git-svn-id: https://develop.svn.wordpress.org/trunk@29904 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 17:21:43 +00:00
Dominik Schilling (ocean90) ab128698ad Customizer: Change instances of "Theme Customizer" to just "Customizer", as the Customizer isn't necessarily theme-specific.
Also capitalize "Customizer".
See also https://make.wordpress.org/core/2014/07/08/customizer-improvements-in-4-0/.

props studionashvegas, tareq1988.
fixes #29947.

git-svn-id: https://develop.svn.wordpress.org/trunk@29903 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 17:20:34 +00:00
Boone Gorges 56c82e534f Avoid redundant table joins in WP_Tax_Query.
IN clauses that are connected by OR require only a single table join. To avoid
extraneous joins, keep track of generated table aliases, and let sibling
clauses piggy-back on those aliases when possible.

Introduces WP_Tax_Query::sanitize_relation() to reduce some repeated code.

Adds unit tests to verify the JOIN consolidation, and integration tests for
cases where JOINS are being combined.

Props boonebgorges, otto42, jakub.tyrcha.
Fixes #18105.

git-svn-id: https://develop.svn.wordpress.org/trunk@29902 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 16:39:19 +00:00
Boone Gorges c995866623 Support nested tax query syntax in redirect_canonical().
The proper place to look for a list of queried terms is in the flat
queried_terms array, not in tax_query->queries.

See #29738.

git-svn-id: https://develop.svn.wordpress.org/trunk@29901 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 15:42:45 +00:00
Sergey Biryukov cd19612e1f Twenty Fifteen: Update some more bundled theme references after [29895].
see #29799.

git-svn-id: https://develop.svn.wordpress.org/trunk@29900 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 14:34:44 +00:00
Sergey Biryukov 862c82c18f Add line breaks at the end of network setup rules to avoid unintended merging with a subsequent line.
props socki03.
fixes #29945.

git-svn-id: https://develop.svn.wordpress.org/trunk@29899 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 14:12:13 +00:00
Andrew Ozz 801ce09508 Admin menu:
- Fix pinning after resizing the window.
- Merge the two DOM ready callbacks in common.js
- Fix the submenus position adjustment on focus.
See #29806

git-svn-id: https://develop.svn.wordpress.org/trunk@29898 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 06:04:15 +00:00
Andrew Ozz 2b93139fc9 Twenty Fifteen: clean up skip-link-focus-fix.js, see #29799
git-svn-id: https://develop.svn.wordpress.org/trunk@29897 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 05:48:05 +00:00
Boone Gorges 2796b6969f Support 'EXISTS' and 'NOT EXISTS' in `WP_Tax_Query`.
These new values for the 'operator' parameter make it possible to filter items
that have no term from a given taxonomy, or any term from a given taxonomy.

Includes unit tests.

Fixes #29181.

git-svn-id: https://develop.svn.wordpress.org/trunk@29896 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 00:53:22 +00:00
Andrew Nacin 209a4c6a86 Set Twenty Fifteen as the new default theme. see #29799.
git-svn-id: https://develop.svn.wordpress.org/trunk@29895 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-14 19:57:13 +00:00
Andrew Nacin 3640f40a12 Fix theme support unit test added in [27220].
The test assumed that the active theme either had no menu locations, or a subset of 'primary' and 'secondary'. see #26900.


git-svn-id: https://develop.svn.wordpress.org/trunk@29894 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-14 19:54:03 +00:00
Andrew Nacin 9966625f84 Twenty Fifteen: JSHint fixes.
* Define global variables set by wp_localize_script().
 * Remove currently unused $ variable.
 * Use dot notation when appropriate.
 * Update Gruntfile.js to ignore the html5 shiv.
see #29799.


git-svn-id: https://develop.svn.wordpress.org/trunk@29893 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-14 19:47:11 +00:00
Ian Stewart af4fdd7f81 Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.

Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799



git-svn-id: https://develop.svn.wordpress.org/trunk@29892 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-14 19:27:23 +00:00
Boone Gorges 6d94c2e30d Introduce support for nested queries in WP_Tax_Query.
Previously, tax query arguments could be joined by a single AND or OR relation.
Now, these queries can be arbitrarily nested, allowing clauses to be linked
together with multiple relations.

In a few places, WP_Query runs through a list of clauses in a tax_query in order
to set certain query vars for backward compatibility. The necessary changes have
been made to WP_Query to support this feature with the new complex structure of
tax_query. Unit tests are included for these backward compatibility fixes.

Unit tests for the new nesting syntax are included.

Props boonebgorges.
Fixes #29718. See #29738.

git-svn-id: https://develop.svn.wordpress.org/trunk@29891 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-14 04:02:41 +00:00
Boone Gorges 40dc982a30 Use only LEFT JOINs when a meta_query contains a NOT EXISTS clause.
Mixing LEFT and INNER JOIN in these cases results in posts with no metadata
being improperly excluded from results.

Props johnrom.
Fixes #29062.

git-svn-id: https://develop.svn.wordpress.org/trunk@29890 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-14 02:16:28 +00:00
Andrew Ozz e7d3a9a26c Quicktags: fix strict check for `instance['0']`, props afercia, fixes #29767
git-svn-id: https://develop.svn.wordpress.org/trunk@29889 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-14 01:25:32 +00:00
Boone Gorges 1fcb79f008 Use assertEqualSets() for a few taxonomy-related tests.
assertEquals() was causing problems in environments where the tests take more
than one second to run, thereby causing results to be returned in the incorrect
order.

git-svn-id: https://develop.svn.wordpress.org/trunk@29888 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-14 00:18:28 +00:00
Boone Gorges 0b05366c6f Introduce support for nested queries in WP_Meta_Query.
Previously, meta query arguments could be joined by a single AND or OR relation.
Now, these queries can be arbitrarily nested, allowing clauses to be linked
together with multiple relations.

Adds unit tests for the new nesting syntax. Modifies a few existing unit tests
that were overly specific for the old SQL syntax. Backward compatibility with
existing syntax is fully maintained.

Props boonebgorges, DrewAPicture.
See #29642.

git-svn-id: https://develop.svn.wordpress.org/trunk@29887 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-13 22:02:18 +00:00