Open bobbingwide opened 3 years ago
In the Site editor (beta) the post_id
attribute is not passed to the server
so the post date, post modified date and post author field values can't be populated.
For the Author block the prefix is displayed, but for post date and post modified we get block rendered as empty
.
This is styled with min-height: 200px
, so looks wrong.
In the block editor the post_id
query parameter is passed. eg. Block editor for post 1269
context=edit&attributes%5Bfields%5D=post_date&attributes%5Blabels%5D=&post_id=1269&_locale=user
What should we do about this?
Simplest thing is to detect a null string being returned in oik_blocks_fields_results()
and replace it with the selected field name.
if( $html === null ) {
$html = $fields;
}
In order to support the
metadates.html
template in FSE themes such as Written I want to replace existing shortcodes with blocks. I found that the quickest way to implement the solution was to extend the Fields block with a co-requisite improvement to the oik-fields plugin upon which the block is dependent.See https://github.com/bobbingwide/sb-field-block/issues/5
Requirement
post_date
,post_modified_date
andauthor_name
using a block or blocks.Solution
oik-block/fields
block to add 3 new options to thefieldsOptions
author_name
.