Hi,
I'm trying to get the custom fields under the post type I have created through Metabox.
Here is the scenario -
I created a post type called accordion and created content within it.
Created some custom fields under that post type named as title, content etc.
Now I created a block of custom fields(select field) that I will display under the page editor as a block and I selected the post type filter within it. The select field has all the posts of that post type as a list.
Now I called a render callback php function, so that function I have write in functions.php. I'm trying to get the selected item(post that is selected in the select field) post id in the rendered function but not able to get it.
Please help me on this.
Code in functions.php-
----------------------------------------
function display_block($attributes, $is_preview = false, $post_id = null){
var_dump($attributes);
var_dump($post_id); //I need to get the selected item post id here
$postid = $attributes['name'];
echo 'inside here';
}
-----------------------------------------------
Screenshot of the block field-
https://tinyurl.com/2dl2od3z
Screenshot of the block in page -
https://tinyurl.com/26tsf3cy
Screenshot of the post type content -
https://tinyurl.com/2al84jdj
Thank you