forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editor: update npm packages in trunk for 6.7.1. #1
Open
hemnfor22
wants to merge
71
commits into
hemnfor22:trunk
Choose a base branch
from
WordPress:trunk
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Syncs Editor packages for WordPress 6.7.1 RC1. Includes the following PRs: - WordPress/gutenberg#66945 - WordPress/gutenberg#66889 - WordPress/gutenberg#67139 Reviewed by desrosj. Merges [59437] to trunk. Props mmaattiiaass, ramonopoly, mamaduka, get_dave, poena, ntsekouras, mcsf, jsnajdr, 0mirka00, desrosj, joemcgill, cbravobernal, azaozz, room34, mayanktripathi32, im3dabasia1, jonsurrell. Fixes #62478, #62447. git-svn-id: https://develop.svn.wordpress.org/trunk@59438 602fd350-edb4-49c9-b593-d223f7449a82
Repository owner
locked and limited conversation to collaborators
Nov 20, 2024
This updates the conditions added in [59370] to skip unnecessary pull request comments when Dependabot is the opening contributor to check for the correct `github.actor` value. Follow up to [59380]. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59441 602fd350-edb4-49c9-b593-d223f7449a82
…_styles(). This adds an `! empty()` check for classnames and declarations to avoid calling array_merge() with an empty value. Props mukesh27, ramonopoly, aaronrobertshaw. Fixes #62317. git-svn-id: https://develop.svn.wordpress.org/trunk@59442 602fd350-edb4-49c9-b593-d223f7449a82
…ji fails. This allows the full error message to be shown from the connection attempt instead of a generic error message. Fixes #62382 git-svn-id: https://develop.svn.wordpress.org/trunk@59443 602fd350-edb4-49c9-b593-d223f7449a82
HTML Fragment parsing always happens with a context node, which may impact how a fragment of HTML is parsed. HTML Fragment Processors can be instantiated with a `BODY` context node via `WP_HTML_Processor::create_fragment( $html )`. This changeset adds a static method called `create_fragment_at_current_node( string $html_fragment )`. It can only be called when the processor is paused at a `#tag`, with some additional constraints: - The opening and closing tags must appear in the HTML input (no virtual tokens). - No "self-contained" elements are allowed ( `IFRAME`, `SCRIPT`, `TITLE`, etc.). If successful, the method will return a `WP_HTML_Processor` instance whose context is inherited from the node that the method was called from. Props jonsurrell, bernhard-reiter, gziolo. Fixes #62357. git-svn-id: https://develop.svn.wordpress.org/trunk@59444 602fd350-edb4-49c9-b593-d223f7449a82
Each theme’s `theme.json` schema version should be pinned to the version that was valid at the time it was released. Props im3dabasia1, poena, mukesh27. Fixes #62455. git-svn-id: https://develop.svn.wordpress.org/trunk@59448 602fd350-edb4-49c9-b593-d223f7449a82
Adds a new function, `wp_render_empty_block_template_warning`, that renders a warning for logged-in users when a block template is empty. Reviewed by get_dave, richtabor. Props vcanales, mikachan, peterwilsoncc, richtabor, get_dave, mrfoxtalbot, matveb, arielmaidana, seifradwane, annezazu. Fixes #62053. git-svn-id: https://develop.svn.wordpress.org/trunk@59449 602fd350-edb4-49c9-b593-d223f7449a82
Prevent fragments from being created at tag closers. Follow-up to [59444]. Props jonsurrell, bernhard-reiter. Fixes #62357. git-svn-id: https://develop.svn.wordpress.org/trunk@59450 602fd350-edb4-49c9-b593-d223f7449a82
All JSON files in the theme should be pinned to the appropriate schema version, not just `theme.json`. Follow up to [59448]. Props im3dabasia1, poena. Fixes #62455. git-svn-id: https://develop.svn.wordpress.org/trunk@59451 602fd350-edb4-49c9-b593-d223f7449a82
…ort-*.json` files. This extracts the logic responsible for parsing the `.version-support-*.json` files and returning a list of supported PHP and MySQL versions for a given branch of WordPress into a reusable workflow so that other workflows can make use of the functionality without repeating code. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59452 602fd350-edb4-49c9-b593-d223f7449a82
This addresses two instances where a function that is documented as returning `{someType}|null` doesn't explicitly return `null`. Affected functions: * `array_key_first()` * `WP_REST_Posts_Controller::handle_terms()` Follow-up to [38832], [52038]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59453 602fd350-edb4-49c9-b593-d223f7449a82
…licking on a Category checkbox on the old Edit Post screen. Props ffffelix, desrosj, ironprogrammer, neotrope, narenin, zaoyao, im3dabasia1, cbravobernal, azaozz. Fixes #62504. git-svn-id: https://develop.svn.wordpress.org/trunk@59454 602fd350-edb4-49c9-b593-d223f7449a82
…svg()`. This updates `WP_Theme_JSON::get_svg_filters()` to use `WP_Duotone::get_filter_svg_from_preset()` instead of the `wp_get_duotone_filter_svg()` function, deprecated in WordPress 6.3. Follow-up to [52757], [56101]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59455 602fd350-edb4-49c9-b593-d223f7449a82
…est()`. `$args` is defined in the immediately preceding code block, and only contains non-integer keys, so there is never an `$args[0]` to unset. Follow-up to [44933]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59456 602fd350-edb4-49c9-b593-d223f7449a82
…is a query string. Follow-up to [51648], see #51636. Props antonvlasenko, swissspidy, spacedmonkey. Fixes #57048. git-svn-id: https://develop.svn.wordpress.org/trunk@59457 602fd350-edb4-49c9-b593-d223f7449a82
It is possible to supply a set of default query `args` to `register_taxonomy()` which will be used when querying a list of terms -- for example, `orderby` in order to specify how the resulting list of terms should be sorted. The Terms REST API controller previously respected these default query args only if the request included a post ID. This changeset makes it so that the default args will also be respected if no post ID is provided. Props bernhard-reiter, jsnajdr. Fixes #62500. git-svn-id: https://develop.svn.wordpress.org/trunk@59458 602fd350-edb4-49c9-b593-d223f7449a82
…cookie()`. This resolves an issue where the string `$expired` value is used both in a comparison and addition with integer values. Follow-up to [6387], [28424], [45590]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59459 602fd350-edb4-49c9-b593-d223f7449a82
If sending an auto update email to the site administrator's email address, look up if a user with the same email exists and switch to that user's locale. If not, explicitly switches to the site locale. This is a follow-up to [59128] where this was previously added for other types of emails. Props benniledl, swissspidy. Fixes #62496. git-svn-id: https://develop.svn.wordpress.org/trunk@59460 602fd350-edb4-49c9-b593-d223f7449a82
In #34114, just-in-time (JIT) translation loading was implemented for projects hosted on WordPress.org. This is now expanded to all other plugins/themes. Projects with a custom `Text Domain` and `Domain Path` header no longer need to call `load_plugin_textdomain()` or `load_theme_textdomain()`. This reduces the risk of calling them too late, after some translation calls already happened, and generally makes it easier to properly internationalize a plugin or theme. This moves the `get_plugin_data()` from `wp-admin/includes/plugin.php` to `wp-includes/functions.php` so it's available during the plugin loading process. Props swissspidy. Fixes #62244. git-svn-id: https://develop.svn.wordpress.org/trunk@59461 602fd350-edb4-49c9-b593-d223f7449a82
…g in `ceil()`. This addresses two instances of the (numeric string) return value from `wp_count_terms()` being used directly in `ceil()`, which expects an `int|float`. Affected methods: * `WP_Sitemaps_Taxonomies::get_max_num_pages()` * `wp_nav_menu_item_taxonomy_meta_box()` Reference: [https://www.php.net/manual/en/function.ceil.php PHP Manual: ceil()]. Follow-up to [14248], [14291], [14569], [14943], [48072], [57648]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59462 602fd350-edb4-49c9-b593-d223f7449a82
The HTML Processor State `context_node` is redundant and can be deprecated. The property has been superseded by `WP_HTML_Processor->context_node` since [58304]. Props jonsurrell, gziolo. Fixes #62518. git-svn-id: https://develop.svn.wordpress.org/trunk@59463 602fd350-edb4-49c9-b593-d223f7449a82
Fixes a missing "D" in the character list used by strspn to find tag openers, causing tags starting with D to be skipped by the tag processor in some circumstances. Follow-up to [58613]. Props jonsurrell, santosguillamot, wongjn, cbravobernal. Fixes #62522. git-svn-id: https://develop.svn.wordpress.org/trunk@59464 602fd350-edb4-49c9-b593-d223f7449a82
This addresses two instances of the (numeric string) `gmdate( 'Z' )` being added to an `int` value. Affected functions: * `upgrade_110()` * `WP_Date_Query::validate_date_values()` Follow-up to [942], [29925], [45424]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59465 602fd350-edb4-49c9-b593-d223f7449a82
…nctions.php` file. The file could declare its own `$theme` variable, which would override the one used in the `foreach` loop. To prevent this, call `wp_get_theme()` before loading the file and store the instance in a different variable. Props neo2k23, swissspidy. See #62244. git-svn-id: https://develop.svn.wordpress.org/trunk@59466 602fd350-edb4-49c9-b593-d223f7449a82
This changeset modifies `WP_HTML_Processor::create_fragment( $html, $context )` to use a full processor and `create_fragment_at_node` instead of the other way around. This makes more sense and makes the main factory methods more clear, where the state required for fragments is set up in `create_fragment_at_node` instead of in both `create_fragment` and `create_fragment_at_current_node`. This allows for more HTML contexts to be provided to the basic `create_fragment` where the provided context HTML is appended to `<!DOCTYPE html>`, a full processor is created, the last tag opener is found, and a fragment parser is created at that node via `create_fragment_at_current_node`. The HTML5lib tests are updated accordingly to use this new method to create fragments. Props jonsurrell, dmsnell, bernhard-reiter. Fixes #62584. git-svn-id: https://develop.svn.wordpress.org/trunk@59467 602fd350-edb4-49c9-b593-d223f7449a82
The current implementation of `create_fragment` (and the underlying `create_fragment_at_current_node`) allows passing in a context that might result in a tree that cannot be represented by HTML. For example, a user might use `<p>` as context, and attempt to create a fragment that also consists of a paragraph element, `<p>like this`. This would result in a paragraph node nested inside another -- something that can never result from parsing HTML. To prevent this, this changeset makes `create_fragment_at_current_node` private and limits `create_fragment` to only `<body>` as context, while a comprehensive solution to allow other contexts is being worked on. Follow-up to [59444], [59467]. Props jonsurrell, dmsnell, bernhard-reiter. Fixes #62584. git-svn-id: https://develop.svn.wordpress.org/trunk@59469 602fd350-edb4-49c9-b593-d223f7449a82
The post author and post date did not have space between them and the post content. This brings in 1em of top margin. Of note is that this only is if the first element is a paragraph that the issue was caused. Props abcd95, sabernhardt, desrosj, sainathpoojary, viralsampat. Fixes #62243. git-svn-id: https://develop.svn.wordpress.org/trunk@59470 602fd350-edb4-49c9-b593-d223f7449a82
This addresses several instances of `gmdate( 'w' )` being used directly as an integer, when it's actually a numeric string. The issue is remediated by casting the value to `int` before use. Affected functions: * `get_calendar()` * `get_weekstartend()` Follow-up to [508], [1632]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59471 602fd350-edb4-49c9-b593-d223f7449a82
…nged. Because the installation testing workflow relies on the reusable workflow that reads the JSON support files, it should be run when that file is changed to confirm there are no issues. This is currently only configured for `pull_request` events, but should also be true for `push`. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59485 602fd350-edb4-49c9-b593-d223f7449a82
…` DocBlock. Follow-up to [21680], [49281]. Props nareshbheda. Fixes #62642. git-svn-id: https://develop.svn.wordpress.org/trunk@59486 602fd350-edb4-49c9-b593-d223f7449a82
Partially reverts [59479] and [59461], which previously tried to move some functions from `wp-admin/includes/plugin.php` to `wp-includes/functions.php` so they are available early, so that `get_plugin_data()` can be used. However, other functions from that file are often used by plugins without necessarily checking whether they are available, easily causing fatal errors. Requiring this file directly is a safer approach to avoid such errors. Props peterwilsoncc, dd32, swissspidy, johnbillion. Fixes #62244. git-svn-id: https://develop.svn.wordpress.org/trunk@59488 602fd350-edb4-49c9-b593-d223f7449a82
This fixes an invalid interpolation format error that can be encountered in the `mysql` container’s healthcheck test command. Follow up to [59484]. Props afercia. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59489 602fd350-edb4-49c9-b593-d223f7449a82
The `include` part of the strategy for the PHPUnit testing workflow defines a few testing configurations outside of the matrix. The versions of PHP and MySQL used in these have not been updated for some time. This was mostly due to various incompatibilities that have since been resolved. Props peterwilsoncc, johnbillion. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59490 602fd350-edb4-49c9-b593-d223f7449a82
`trunk` is used interchangeably with `nightly`, so should be an accepted value when determining which version of WordPress is being tested. Follow up to [59452], [59483]. Props johnbillion. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59491 602fd350-edb4-49c9-b593-d223f7449a82
…ironment. While the PHPUnit workflow currently relies on the local Docker environment and provides some safety checks that the environment works as expected, this may not always be true and does not test all of the available commands related to the environment. This introduces a basic workflow for testing the related scripts for the various supported combinations of PHP and database software with the environment to confirm everything is working as expected. Ideally this would also be run on Windows and MacOS to catch platform specific bugs. Unfortunately, Docker is not supported within the GitHub Action runner images, so not all bugs will be caught by this workflow. Props johnbillion, Clorith. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59492 602fd350-edb4-49c9-b593-d223f7449a82
Use height 0 instead of 9999 to avoid unnecessarily using the full size version. Props colinleroy, swissspidy. Fixes #62094. git-svn-id: https://develop.svn.wordpress.org/trunk@59493 602fd350-edb4-49c9-b593-d223f7449a82
Complements existing helper methods such as `WP_Locale::get_month_abbrev()`. Props ankitkumarshah, Tkama, SergeyBiryukov. Fixes #58658. git-svn-id: https://develop.svn.wordpress.org/trunk@59494 602fd350-edb4-49c9-b593-d223f7449a82
Follow-up to [17552]. Props marian1, jigar-bhanushali, martin.krcho, parthvataliya. Fixes #62022. git-svn-id: https://develop.svn.wordpress.org/trunk@59495 602fd350-edb4-49c9-b593-d223f7449a82
Follow-up to [58069]. Props yogeshbhutkar, sainathpoojary, PcTevree, knutsp, siliconforks, stromhalm, shanemuir. Fixes #62551. git-svn-id: https://develop.svn.wordpress.org/trunk@59496 602fd350-edb4-49c9-b593-d223f7449a82
…()`. Follow-up to [10390]. Props deepakrohilla, iflairwebtechnologies, mukesh27, dingguodong, aristath. Fixes #62009. git-svn-id: https://develop.svn.wordpress.org/trunk@59497 602fd350-edb4-49c9-b593-d223f7449a82
…ate.php`. Follow-up to [162], [2685], [4494], [8878], [8961], [55660]. Props aristath, poena, afercia, SergeyBiryukov. See #62279. git-svn-id: https://develop.svn.wordpress.org/trunk@59498 602fd350-edb4-49c9-b593-d223f7449a82
…_JSON::get_stylesheet`. Updates docblocks to account for new use of the `custom-css` string in their `$types` parameters and adds information to deprecation of `wp_get_global_styles_custom_css`. Props justlevine, isabel_brison, ramonopoly. Fixes #62665. git-svn-id: https://develop.svn.wordpress.org/trunk@59499 602fd350-edb4-49c9-b593-d223f7449a82
The HTML specification does not close HTML or BODY tags (pop them off the stack of open elements) when their tag closers are encountered. The HTML processor correctly handled this behavior, however it incorrectly "paused" by returning true from the step functions. Props jonsurrell, dmsnell, gziolo. Fixes #62583. git-svn-id: https://develop.svn.wordpress.org/trunk@59500 602fd350-edb4-49c9-b593-d223f7449a82
…tory property. Follow-up to [48242], [51676]. Props mujuonly, mukesh27. Fixes #62667. git-svn-id: https://develop.svn.wordpress.org/trunk@59501 602fd350-edb4-49c9-b593-d223f7449a82
Fixes the issue when an HTML_Processor bookmark was set at a virtual token (a node in the resulting document that does not correspond to an HTML token present in the input string), seek behavior was unreliable. Props jonsurrell, gziolo. Fixes #62521. git-svn-id: https://develop.svn.wordpress.org/trunk@59502 602fd350-edb4-49c9-b593-d223f7449a82
Follow-up [58713] Props jonsurrell, westonruter, gziolo. Fixes #62674. git-svn-id: https://develop.svn.wordpress.org/trunk@59503 602fd350-edb4-49c9-b593-d223f7449a82
* Inline comments must end in full stops, exclamation marks, or question marks. * There must be exactly one blank line after the file comment. Follow-up to [52081]. Props pitamdey, mukesh27. Fixes #62648. git-svn-id: https://develop.svn.wordpress.org/trunk@59504 602fd350-edb4-49c9-b593-d223f7449a82
…examples. Follow-up to [58579]. Props jonsurrell. See #62281. git-svn-id: https://develop.svn.wordpress.org/trunk@59505 602fd350-edb4-49c9-b593-d223f7449a82
…Zip. The `php_uname()` function can be disabled on some hosts, in which case the call fails. The `PHP_OS_FAMILY` constant indicates the operating system family PHP was built for, and is available as of PHP 7.2.0. Reference: [https://www.php.net/manual/en/reserved.constants.php#constant.php-os-family PHP Manual: Predefined Constants: PHP_OS_FAMILY]. Follow-up to [6779], [57985], [58678], [58684]. Props daymobrew, costdev, desrosj. Fixes #57711. git-svn-id: https://develop.svn.wordpress.org/trunk@59506 602fd350-edb4-49c9-b593-d223f7449a82
…flows. Because reusable workflows could be called from any other repository in a variety of contexts, repository specific `if` conditions should not be present. Instead, this logic should be included in the calling workflows only. Props johnbillion. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59507 602fd350-edb4-49c9-b593-d223f7449a82
The upgrade testing workflow is currently at ~978 jobs spawned from the strategy matrix. While it's great to test all possible combinations, GitHub's UI cannot keep up with tracking that number of jobs, often taking 30-45 minutes to accurately report the outcome even though the jobs themselves all complete in under 5 minutes. This is 2x the total number of concurrent jobs allowed for the entire organization (which creates a backlog and slows everything down even more). This trims down the number of combinations included in the testing matrices to be a bit more thoughtful following the following methodology: - The last two releases of WordPress are tested against all PHP and MySQL LTS version combinations and the most recent innovation release. - The next 6 oldest versions of WordPress are tested against both the oldest and newest releases of PHP currently supported for both PHP 7 & 8 along with the oldest and newest MySQL LTS versions currently supported (no innovation releases). - For the remaining versions of WordPress receiving security updates, they are only included if the database version was different that the previous major release. - The oldest version of WordPress receiving security updates should always be tested against the same full list of combinations as the last two releases. When choosing which MySQL versions to test against: - Only the most recent innovation release should be included in testing. - Even though MySQL >= 5.5.5 is currently supported, there are no 5.5.x Docker containers available that work on modern architectures. - 5.6.x Docker containers are available and work, but 5.6 only accounts for ~2.3% of installs as of 12/6/2024.defaults: - 5.7.x accounts for ~20% of installs, so this is used below instead. With these changes, the total number of jobs is reduced by ~58%. Props johnbillion, mukesh27. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59508 602fd350-edb4-49c9-b593-d223f7449a82
This updates the following `devDependencies`: - `dotenv` from `16.4.5` to `16.4.7` - `dotenv-expand` from `11.0.6` to `12.0.1` - `postcss` from `8.4.47` to `8.4.49` - `qunit` from `2.22.0` to `2.23.1` - `sass` from `1.79.4` to `1.79.6` - `terser-webpack-plugin` from `5.3.10` to `5.3.11` - `uglify-js` from `3.17.4` to `3.19.3` - `uuid` from `9.0.1` to `11.0.3` - `webpack` from `5.90.2` to `5.97.1` Additionally, `npm audit fix` has been run. Follow up to [58585]. See #62220. git-svn-id: https://develop.svn.wordpress.org/trunk@59509 602fd350-edb4-49c9-b593-d223f7449a82
Remove CSS that could occasionally trigger the accordion buttons to be 100% the height of the accordion container. Props dhewercorus, im3dabasia1, sabernhardt, rvoigt, ghinamt, vishy-moghan, frankbiganski, redkite. Fixes #62491. git-svn-id: https://develop.svn.wordpress.org/trunk@59510 602fd350-edb4-49c9-b593-d223f7449a82
Wrap the classic editor 'Skip to Editor' link in a conditional to prevent it from rendering on post types that do not have editor support. Props wildworks, parthvataliya, narenin, sainathpoojary, ankitkumarshah, parthvataliya, im3dabasia1. Fixes #62623. git-svn-id: https://develop.svn.wordpress.org/trunk@59511 602fd350-edb4-49c9-b593-d223f7449a82
Follow-up to [https://mu.trac.wordpress.org/changeset/1538 mu:1538]. Props debarghyabanerjee. See #62283. git-svn-id: https://develop.svn.wordpress.org/trunk@59512 602fd350-edb4-49c9-b593-d223f7449a82
…l checks page. When reinstalling a theme by uploading a ZIP file, the wording used in some strings referred to the "active" theme even though it's not the currrently active theme. This changeset replaces these strings to refer to the "installed" theme, which is more accurate. Follow-up to [52610], [52580]. Props afercia, ankitkumarshah, abcd95, yogeshbhutkar, parthvataliya, sainathpoojary, virgar, gaellebesson, nuryko, guillaumeturpin, maximemeganck, sabrineg. Fixes #62603. See #54831, #54770 git-svn-id: https://develop.svn.wordpress.org/trunk@59513 602fd350-edb4-49c9-b593-d223f7449a82
Fix a bug where a comment reply would be discarded if `esc` was pressed to dismiss the context menu in Safari or Firefox. Checks whether the contextmenu is open and ignores the `esc` key if it is. Props yellowafterlife, yogeshbhutkar, joedolson. Fixes #62346. git-svn-id: https://develop.svn.wordpress.org/trunk@59514 602fd350-edb4-49c9-b593-d223f7449a82
This aims to avoid a fatal error from `count()` when `preg_split()` fails on large input. Includes: * Optimizing the regular expression used to split the input by tags to avoid unlimited backtracking for better performance. * Adjusting the function logic for better readability. Follow-up to [340], [4380], [26191]. Props podpirate, nathkrill, rajinsharwar, dmsnell, bjorsch, q0rban, audrasjb, rupw, Ov3rfly, jorbin, nhrrob, chaion07, mcqueen22, azaozz, narenin, roybellingan, SergeyBiryukov. See #51019. git-svn-id: https://develop.svn.wordpress.org/trunk@59515 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Syncs Editor packages for WordPress 6.7.1 RC1. Includes the following PRs:
FormFileUpload
: Prevent HEIC and HEIF files from always being uploaded on Safari WordPress/gutenberg#67139Reviewed by desrosj.
Merges [59437] to trunk.
Props mmaattiiaass, ramonopoly, mamaduka, get_dave, poena, ntsekouras, mcsf, jsnajdr, 0mirka00, desrosj, joemcgill, cbravobernal, azaozz, room34, mayanktripathi32, im3dabasia1, jonsurrell. Fixes #62478, #62447.
git-svn-id: https://develop.svn.wordpress.org/trunk@59438 602fd350-edb4-49c9-b593-d223f7449a82
If you need code to programmatically create categories and associate them with posts in WordPress, you can use the following snippets. These will help you add categories within your WordPress post editor or even through custom functions.
1. Add a Category Programmatically
You can add a category using the
wp_insert_term()
function. Here’s an example of how to create a category from your theme'sfunctions.php
file or a custom plugin:2. Assign Category to a Post Programmatically
If you want to assign this newly created category to a specific post programmatically, you can use the following code:
In this case, whenever a post is saved, it will automatically get the category "My Custom Category" assigned to it.
Make sure to replace
'My Custom Category'
with the name of the category you want to assign to the posts.3. Create a Custom Category for Each Post Automatically
If you'd like a new category to be created automatically whenever a post is published (for example, based on the post title or a custom field), you can customize the following:
4. Display Category Dropdown in Post Editor (If Not Visible)
If you want to display a category dropdown programmatically when it's not visible in the post editor, use this code snippet:
Where to Place the Code:
functions.php
File: If you're using a custom theme, you can place the code in your theme'sfunctions.php
file.By using these snippets, you can automate category creation and assignment, or ensure that categories appear in your WordPress editor even if they don't by default.
Trac ticket: https://core.trac.wordpress.org/ticket/40954
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.