Since WordPress 2.7, where multiple posts have identical post_date values (e.g., when bulk publishing drafts), the next/previous post navigation skips posts or behaves unpredictably. This is because the WHERE clause uses strict inequality (`>` or `<`) which excludes posts with the same date.
To ensure deterministic ordering, this commit modifies the WHERE clause to include ID-based fallback for posts with identical dates.
Props ramonopoly, westonruter, andrewserong.
Fixes #8107.
Built from https://develop.svn.wordpress.org/trunk@61066
git-svn-id: http://core.svn.wordpress.org/trunk@60402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit casts the object returned by `prepare_item_for_database()` to an array. Without doing so, `wp_slash()` returns the object unchanged, meaning string values within the object wouldn't be properly escaped for database insertion.
Follow-up to [64035]
Props ramonopoly, westonruter, mukesh27, justlevine.
Fixes #64149.
Built from https://develop.svn.wordpress.org/trunk@61065
git-svn-id: http://core.svn.wordpress.org/trunk@60401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Without this patch we would introduce the Abilities API without any core abilities being registered.
This patch includes the following initial abilities:
- core/get-bloginfo - Retrieve individual site information fields (name, description, url, wpurl, admin_email, charset, language, version).
- core/get-current-user-info - Get current authenticated user data (id, display_name, user_nicename, user_login, roles, locale).
- core/get-environment-type - Get WordPress environment type (production, staging, development, local).
Developed in #10411.
Follow-up [64098].
Props gziolo, jorgefilipecosta, mukesh27, isotropic, jorbin, justlevine, jason_the_adams.
Fixes#64146.
Built from https://develop.svn.wordpress.org/trunk@61063
git-svn-id: http://core.svn.wordpress.org/trunk@60399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The addition of the `$post` argument (which defaults to the global post) brings `get_the_modified_author()` in line with other similar functions, including `get_the_modified_date()` and `get_the_modified_time()`.
Props Cornwell, jdahir0789, dhruvang21, Presskopp, mindctrl, samirmalpande, audrasjb, johnbillion, SergeyBiryukov, desrosj, costdev, mukesh27, westonruter.
Fixes#64104, #55978.
Built from https://develop.svn.wordpress.org/trunk@61057
git-svn-id: http://core.svn.wordpress.org/trunk@60393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
While Yoda conditions are mostly relevant for variables and not required if neither side is a variable, this commit aims to make the order more consistent throughout the file.
Follow-up to [1636], [4990], [6974], [10322], [10769], [11048], [42770], [47219], [56325].
Props subrataemfluence, sabernhardt, ishikaatxecurify, callumbw95, peterwilsoncc, SergeyBiryukov.
Fixes#46846.
Built from https://develop.svn.wordpress.org/trunk@61053
git-svn-id: http://core.svn.wordpress.org/trunk@60389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `details` element supports the exclusive accordion behavior among multiple `details` elements by setting a common `name` attribute. The ability to set the `name` attribute in the Details block was added in of Gutenberg 20.2. However, when a user without `unfiltered_html` attempts to save the post, the `name` attribute gets erroneously stripped out. This prevents that.
See [https://github.com/WordPress/gutenberg/issues/56969 Details block: Exclusive accordions].
Follow-up to [14406], [59775].
Props soean.
See #12835, #62887.
Fixes#64127.
Built from https://develop.svn.wordpress.org/trunk@61051
git-svn-id: http://core.svn.wordpress.org/trunk@60387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Despite having worked reliably for a few years (first configured in [52241]), the branches and pull requests created by Dependabot are now being deleted and closed after every Git mirror event since early 2024. Since this happens after every commit, the bot is essentially useless in this repository.
This removes the configuration file to avoid unnecessarily creating pull requests and consuming GitHub Actions resources when they will just be closed shortly after.
If the root cause for this change in behavior is discovered and addressed, then re-adding a `dependabot.yml` file can be considered. For now, you’re just somebody that I used to know.
Props johnbillion, dd32, swissspidy.
Fixes#64140.
Built from https://develop.svn.wordpress.org/trunk@61049
git-svn-id: http://core.svn.wordpress.org/trunk@60385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This change brings the `include` parameter of `WP_Term_Query` up-to-speed with the `include` and `__in` parameters of other `_Query` classes, so that sending a value of `[0]` will not unintentionally perform an unbound query that returns all Terms.
It also introduces 3 new unit tests (for the Post, Term, and User query classes) to compare this behavior between them and ensure they remain consistent going forward.
Props audrasjb, hareesh-pillai, hellofromTonya, johnjamesjacoby, mukesh27.
Fixes#47719.
Built from https://develop.svn.wordpress.org/trunk@61048
git-svn-id: http://core.svn.wordpress.org/trunk@60384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Without this patch REST API would require a weird empty `?input` field for optional input given how the current controller works with input schema when it defines the expected shape. This patch normalizes the input for the ability, applying the default value from the input schema when needed.
Developed in https://github.com/WordPress/wordpress-develop/pull/10395.
Follow-up [61032], [61045].
Props gziolo, jorgefilipecosta, mukesh27.
Fixes#64139.
Built from https://develop.svn.wordpress.org/trunk@61047
git-svn-id: http://core.svn.wordpress.org/trunk@60383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Re-adds support for text input elements to theme.json originally included in [61023] that was accidently removed in a subsequent commit.
This change also include the updated docblock for `@since 6.9.0`.
Follow-up to [61023], [61031].
Props leemon, wildworks, ella, scruffian, cbravobernal, desrosj, davidbaumwald.
Fixes#63878.
Built from https://develop.svn.wordpress.org/trunk@61046
git-svn-id: http://core.svn.wordpress.org/trunk@60382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Introduces a new REST API endpoint at `wp-abilities/v1/categories` to expose
ability categories through the WordPress REST API.
The new `WP_REST_Abilities_V1_Categories_Controller` provides:
- GET `/wp-abilities/v1/categories` - Lists all ability categories with pagination
- GET `/wp-abilities/v1/categories/{slug}` - Retrieves a single category by slug
Both endpoints require the `read` capability and return category data including
slug, label, description, and metadata. The collection endpoint supports pagination
with `page` and `per_page` parameters (default: 50, max: 100).
Developed in https://github.com/WordPress/wordpress-develop/pull/10380.
Follow-up [61032].
Props gziolo, jason_the_adams, timothyblynjacobs.
Fixes#64098.
Built from https://develop.svn.wordpress.org/trunk@61045
git-svn-id: http://core.svn.wordpress.org/trunk@60381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `generate_cache_key()` method in `WP_Query` referenced an undefined variable `$q`. The method only has two parameters: `$args` and `$sql`. The variable `$q` is not defined anywhere in this method scope. This patch replaces the undefined `$q` variable with the correct `$args` parameter.
Follow-up to [59442]
Props ramonopoly, westonruter
Fixes #64135.
Built from https://develop.svn.wordpress.org/trunk@61043
git-svn-id: http://core.svn.wordpress.org/trunk@60379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Update the `svn:ignore` property for newly introduced assets in the `src/wp-includes/blocks` directory.
The code run for this commit was:
{{{
cd src/wp-includes/blocks
svn propset svn:ignore '*.js.map
*.js
*.css' . --recursive
}}}
Follow up to [61012].
See #64117.
Built from https://develop.svn.wordpress.org/trunk@61042
git-svn-id: http://core.svn.wordpress.org/trunk@60378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The change from public to protected broke tests for extenders and this also broke `WP_User::to_array()`.
Reverts [60915].
Props davidbaumwald, ellatrix, timothyblynjacobs, welcher, spacedmonkey, bradshawtm, peterwilsoncc, jorbin.
See #58001.
Built from https://develop.svn.wordpress.org/trunk@61037
git-svn-id: http://core.svn.wordpress.org/trunk@60373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When a user is logged in, only the default comment textarea is shown by
the core `comment_form()` implementation, but custom fields supplied via the
`fields` argument are omitted. This mismatch means plugin- and theme-added fields
aren't visible to logged-in users, though they are visible to guests.
This change fixes this by moving the loop over `$args['fields']` inside
`comment_form()`, so that extra fields are rendered, regardless of login status.
Props maorb, valendesigns, CarlSteffen, swissspidy, rachelbaker, kushsharma, abcd95, iamadisingh, oglekler, welcher.
Fixes#16576.
Built from https://develop.svn.wordpress.org/trunk@61034
git-svn-id: http://core.svn.wordpress.org/trunk@60370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds support for the select element in theme.json so that theme builders and extenders can be style select elements consistently.
We are targeting the select HTML element rather than adding a CSS class, as we do for other elements that theme.json supports. This commit adds no extra styling unless a theme opts in to use this and the specificity of any generated CSS with the element is 0.
See original Gutenberg PR: https://github.com/WordPress/gutenberg/pull/70379.
Example usage:
{{{
"elements": {
"select": {
"color": {
"text": "red",
"background": "blue"
}
}
}
}}}
Props onemaggie, joen, get_dave, wildworks, ocean90, mikachan, poena, SirLouen, tusharbharti, yashjawale, abcd95.
Fixes#63555. See #63878.
Built from https://develop.svn.wordpress.org/trunk@61031
git-svn-id: http://core.svn.wordpress.org/trunk@60367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[60990] introduced a new action, `press_this_init`. While the code changes adding the hook are straightforward, the actual use cases are not yet clear.
Reverting the change allows for more discussion to clarify what is actually supported through the addition of this new action.
Props jorbin.
See #53076.
Built from https://develop.svn.wordpress.org/trunk@61030
git-svn-id: http://core.svn.wordpress.org/trunk@60366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Adds the `active_templates` setting, which is an object holding the template slug as a key and template post ID as the value.
* To maintain backwards compatibility, any `wp_template` (post type) not created through the new API will be activated.
* `get_block_template` and `get_block_templates` have been adjusted to check `active_templates`. These functions should never return inactive templates, just like before, to maintain backwards compatibility.
* The pre-existing `/templates` endpoint and sub-endpoints remain and work exactly as before.
* A new endpoint `/wp_template` has been added, but this is just a regular posts controller (`WP_REST_Posts_Controller`). We do register an additional `theme` field and expose the `is_wp_suggestion` meta.
* Another new endpoint `/wp_registered_template` has been added, which is read-only and lists the registered templates from themes and plugin (un-edited, without activations applied).
These changes are to be iterated on.
See https://github.com/WordPress/wordpress-develop/pull/8063.
Props ellatrix, shailu25, ntsekouras.
Fixes#62755.
Built from https://develop.svn.wordpress.org/trunk@61029
git-svn-id: http://core.svn.wordpress.org/trunk@60365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds elements support to text based form inputs so a theme can style consistently how forms should look like regardless of the plugins/blocks installed.
Props onemaggie, mukesh27, sabernhardt, scruffian, get_dave, ocean90, mikachan, wildworks.
Fixes#63878.
Built from https://develop.svn.wordpress.org/trunk@61024
git-svn-id: http://core.svn.wordpress.org/trunk@60360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds support for text input elements to theme.json so that theme builders and extenders can be style text input elements consistently.
Text input elements are `textarea`, and `input` with type `email`, `number`, `password`, `search`, `text`, `tel` and `url`. We are targeting the HTML elements directly rather than adding a CSS class, as we do for other elements that theme.json supports. This commit adds no extra styling unless a theme opts in to use this and the specificity of any generated CSS with the element is 0.
See original Gutenberg PR: https://github.com/WordPress/gutenberg/pull/70378.
Example usage:
{{{
"elements": {
"textInput": {
"border": {
"radius": "0",
"style": "solid",
"width": "1px",
"color": "red"
},
"color": {
"text": "var(--wp--preset--color--theme-2)"
},
"typography": {
"fontFamily": "var(--wp--preset--font-family--inter)"
}
}
}
}}}
Reviewed by mukesh27, scruffian.
Merges [9600] to the 6.9 branch.
Props onemaggie, mukesh27, sabernhardt, joen, get_dave, wildworks, ocean90, mikachan, poena.
Fixes#63878. See #63555.
Built from https://develop.svn.wordpress.org/trunk@61023
git-svn-id: http://core.svn.wordpress.org/trunk@60359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Uses the `wp_script_attributes` filter to add a `data-wp-router-options` directive with a `loadOnClientNavigation: true` property for all the interactive blocks that are compatible with client-side navigation to let the Interactivity API router determine which modules it can safely load during client-side navigation.
Props luisherranz, westonruter.
Fixes#64122.
Built from https://develop.svn.wordpress.org/trunk@61019
git-svn-id: http://core.svn.wordpress.org/trunk@60355 1a063a9b-81f0-0310-95a4-ce76da25c4cd