[wp-trac] [WordPress Trac] #64156: add_post_type_support() does not merge sub-properties for the same feature
WordPress Trac
noreply at wordpress.org
Tue Feb 10 15:58:29 UTC 2026
#64156: add_post_type_support() does not merge sub-properties for the same feature
--------------------------------------------------+---------------------
Reporter: fabiankaegy | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 7.0
Component: Posts, Post Types | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests 2nd-opinion | Focuses:
--------------------------------------------------+---------------------
Comment (by ozgursar):
== Patch Testing Report
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/10426
=== Environment
- WordPress: 7.0-alpha-61215-src
- PHP: 8.2.29
- Server: nginx/1.29.4
- Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
- Browser: Chrome 144.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None activated
- Plugins:
* Code Snippets 3.9.5
* Test Reports 1.2.1
=== Steps taken
1. Add the plugin below via Code Snippets or `functions.php` to display
the results of `add_post_type_support` with or without patch
2. View the Dashboard and note the results in the `Merge Bug Test`widget
3. ✅ Patch is solving the problem
=== Expected result
- After applying the patch both properties are properly merged into the
array.
=== Screenshots/Screencast with results
Before:
[[Image(https://i.imgur.com/QxQW7aJ.png)]]
After:
[[Image(https://i.imgur.com/Ealz9hi.png)]]
=== Support Content
Code snippet for the dashboard widget created with the help of `Claude.ai`
{{{
add_action('wp_dashboard_setup', 'test_post_type_support_bug');
function test_post_type_support_bug() {
wp_add_dashboard_widget(
'post_type_support_test',
'add_post_type_support() Merge Bug Test',
'display_post_type_support_test'
);
}
function display_post_type_support_test() {
// Clear any existing support first
remove_post_type_support('page', 'editor');
// First call - add 'default-mode' property
add_post_type_support('page', 'editor', array(
'default-mode' => 'template-locked',
));
$result1 = get_all_post_type_supports('page')['editor'];
// Second call - add 'block-comments' property
add_post_type_support('page', 'editor', array(
'block-comments' => true,
));
$result2 = get_all_post_type_supports('page')['editor'];
echo '<div style="font-family: monospace;">';
echo '<h4>After first call:</h4>';
echo '<pre style="background: #f0f0f0; padding: 10px;">';
print_r($result1);
echo '</pre>';
echo '<h4>After second call:</h4>';
echo '<pre style="background: #ffe6e6; padding: 10px;">';
print_r($result2);
echo '</pre>';
echo '<h4>Expected both properties:</h4>';
echo '<pre style="background: #e6f3ff; padding: 10px;">';
echo "Array\n(\n [0] => Array\n (\n [default-
mode] => template-locked\n [block-comments] => 1\n
)\n)\n";
echo '</pre>';
echo '</div>';
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64156#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list