Changeset 61689 for trunk/src/wp-includes/post.php
- Timestamp:
- 02/19/2026 10:25:06 AM (3 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/post.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r61649 r61689 657 657 ) 658 658 ); 659 660 if ( get_option( 'enable_real_time_collaboration' ) ) { 661 register_post_type( 662 'wp_sync_storage', 663 array( 664 'labels' => array( 665 'name' => __( 'Sync Updates' ), 666 'singular_name' => __( 'Sync Update' ), 667 ), 668 'public' => false, 669 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 670 'hierarchical' => false, 671 'capabilities' => array( 672 'read' => 'do_not_allow', 673 'read_private_posts' => 'do_not_allow', 674 'create_posts' => 'do_not_allow', 675 'publish_posts' => 'do_not_allow', 676 'edit_posts' => 'do_not_allow', 677 'edit_others_posts' => 'do_not_allow', 678 'edit_published_posts' => 'do_not_allow', 679 'delete_posts' => 'do_not_allow', 680 'delete_others_posts' => 'do_not_allow', 681 'delete_published_posts' => 'do_not_allow', 682 ), 683 'map_meta_cap' => false, 684 'publicly_queryable' => false, 685 'query_var' => false, 686 'rewrite' => false, 687 'show_in_menu' => false, 688 'show_in_rest' => false, 689 'show_ui' => false, 690 'supports' => array( 'custom-fields' ), 691 ) 692 ); 693 } 659 694 660 695 register_post_status( … … 8612 8647 * 8613 8648 * @since 6.3.0 Adds `wp_pattern_sync_status` meta field to the wp_block post type so an unsynced option can be added. 8649 * @since 7.0.0 Adds `_crdt_document` meta field to post types so that CRDT documents can be persisted. 8614 8650 * 8615 8651 * @link https://github.com/WordPress/gutenberg/pull/51144 … … 8631 8667 ) 8632 8668 ); 8633 } 8669 8670 if ( get_option( 'enable_real_time_collaboration' ) ) { 8671 register_meta( 8672 'post', 8673 '_crdt_document', 8674 array( 8675 'auth_callback' => static function ( bool $_allowed, string $_meta_key, int $object_id, int $user_id ): bool { 8676 return user_can( $user_id, 'edit_post', $object_id ); 8677 }, 8678 /* 8679 * Revisions must be disabled because we always want to preserve 8680 * the latest persisted CRDT document, even when a revision is restored. 8681 * This ensures that we can continue to apply updates to a shared document 8682 * and peers can simply merge the restored revision like any other incoming 8683 * update. 8684 * 8685 * If we want to persist CRDT documents alongside revisions in the 8686 * future, we should do so in a separate meta key. 8687 */ 8688 'revisions_enabled' => false, 8689 'show_in_rest' => true, 8690 'single' => true, 8691 'type' => 'string', 8692 ) 8693 ); 8694 } 8695 }
Note: See TracChangeset
for help on using the changeset viewer.