Make WordPress Core


Ignore:
Timestamp:
10/19/2026 10:56:43 AM (3 days ago)
Author:
fabiankaegy
Message:

Editor: Add author support to the wp_block post type.

The REST API now returns each pattern's author, so the block inserter and the Site Editor's Patterns screen can filter patterns by author. Patterns already store post_author and their capabilities already check it.

Sets delete_with_user to false, so deleting a user keeps their patterns, as they may be used across the site.

Also renames the Site Editor's "My patterns" view to "Site patterns", since it lists every user-created pattern, not only the current user's.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/14269.
Synced from ​https://github.com/WordPress/gutenberg/pull/84680.

Props fabiankaegy, wildworks, talldanwp, jameskoster, mamaduka, fcoveram.
Fixes #66307.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r64402 r64499  
    359359                                'revisions',
    360360                                'custom-fields',
     361                                'author',
    361362                        ),
     363                        // Keep patterns when their author is deleted, as they may be used across the site.
     364                        'delete_with_user'      => false,
    362365                )
    363366        );
Note: See TracChangeset for help on using the changeset viewer.