I don’t know, why this topic is already resolved, but there is no answer to @greatblakes’s question.
I came to the following solution:
Because we’re in OOP, means inside a php class, the class needs to be addressed too, if we want to access the function. So we put the function into the “register_block_type” like this:
register_block_type('nebula/latest-posts',[
'render_callback' => [$this, 'nebula_get_latest_post']
]
At least this way worked for me to get the front end output defined in the function (here “nebula_get_latest_post”).
-
This reply was modified 7 years, 4 months ago by ditshej.