Changes between Initial Version and Version 1 of Ticket #59348, comment 2
- Timestamp:
- 09/14/2023 12:33:06 PM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #59348, comment 2
initial v1 5 5 function filter_metadata_registration( $metadata ) { 6 6 if ($metadata['name'] === 'core/post-excerpt') { 7 $metadata['attributes']['excerptLength'] = 40; //ANY NUMBER 7 $metadata['attributes']['excerptLength'] = [ 8 'type' => 'number', 9 'default' => 9999, 10 ]; 8 11 } 9 12 return $metadata; … … 11 14 add_filter( 'block_type_metadata', 'filter_metadata_registration' ); 12 15 }}} 13 14 However, strangely enough, this code makes the "excerptLength" completely disappear from the attributes (when printed out in `render_block_core_post_excerpt` of post-excerpt.php) making the original15 16 {{{17 array (size=2)18 'showMoreOnNewLine' => boolean true19 'excerptLength' => int 5520 }}}21 22 to be23 24 {{{25 array (size=1)26 'showMoreOnNewLine' => boolean true27 }}}28 29 Which is cool for me, because at least I get "unlimited excerpts" but this is either a bug or I'm missing something, so I'm opening a ticket on this too.