Changeset 57377 for trunk/src/wp-includes/blocks/footnotes.php
- Timestamp:
- 01/29/2024 09:04:18 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/footnotes.php
r56755 r57377 69 69 */ 70 70 function register_block_core_footnotes() { 71 foreach ( array( 'post', 'page' ) as $post_type ) { 72 register_post_meta( 73 $post_type, 74 'footnotes', 75 array( 76 'show_in_rest' => true, 77 'single' => true, 78 'type' => 'string', 79 'revisions_enabled' => true, 80 ) 81 ); 71 $post_types = get_post_types( 72 array( 73 'show_in_rest' => true, 74 'public' => true, 75 ) 76 ); 77 foreach ( $post_types as $post_type ) { 78 // Only register the meta field if the post type supports the editor, custom fields, and revisions. 79 if ( post_type_supports( $post_type, 'editor' ) && post_type_supports( $post_type, 'custom-fields' ) && post_type_supports( $post_type, 'revisions' ) ) { 80 register_post_meta( 81 $post_type, 82 'footnotes', 83 array( 84 'show_in_rest' => true, 85 'single' => true, 86 'type' => 'string', 87 'revisions_enabled' => true, 88 ) 89 ); 90 } 82 91 } 83 92 register_block_type_from_metadata(
Note: See TracChangeset
for help on using the changeset viewer.