Forum Replies Created
Viewing 7 posts - 1 through 7 (of 7 total)
-
AuthorPosts
-
October 11, 2023 at 9:35 PM in reply to: โ Error: Template not found: #tmpl-rwmb-media-button #43504
[email protected]
ParticipantFixed, but why not push an update?
[email protected]
Participantmb_get_block_field()was not working.
But I had to replace post.ID with post_id[email protected]
ParticipantMy site is crashing, if I use the function
mb_get_block_field().
I am in the field "Render code":

[email protected]
ParticipantThank you Long.
I have added now "mb_admin_column_load" to the if, but it is still crashing if I deactivate AIO.
Is it not easier to check it the two plugins are active?
How can I do that?if ( function_exists( 'rwmb_meta' ) OR function_exists( 'mb_admin_column_load' ) ) { add_action( 'admin_init', 'prefix_add_custom_columns', 20 ); } function prefix_add_custom_columns() { class Prefix_Custom_Admin_Columns extends \MBAC\Post { public function columns( $columns ) { $columns = parent::columns( $columns ); $position = 'before'; $target = 'title'; $this->add( $columns, 'featured_image', 'Image', $position, $target ); // Add more if you want return $columns; } public function show( $column, $post_id ) { switch ( $column ) { case 'featured_image': the_post_thumbnail( [60, 60] ); break; // More columns } } } new Prefix_Custom_Admin_Columns( 'post', array() ); new Prefix_Custom_Admin_Columns( 'page', array() ); new Prefix_Custom_Admin_Columns( 'review', array() ); }[email protected]
ParticipantHello Long,
sorry I am not a programmer. I don't know how to use this correctly.My site is still crashing after using this
add_action( 'admin_init', 'prefix_add_custom_columns', 20 ); function prefix_add_custom_columns() { if ( ! function_exists( 'rwmb_meta' ) ) { function rwmb_meta( $key, $args = [], $object_id = null ) { return null; } } class Prefix_Custom_Admin_Columns extends \MBAC\Post { public function columns( $columns ) { $columns = parent::columns( $columns ); $position = 'before'; $target = 'title'; $this->add( $columns, 'featured_image', 'Image', $position, $target ); // Add more if you want return $columns; } public function show( $column, $post_id ) { switch ( $column ) { case 'featured_image': the_post_thumbnail( [60, 60] ); break; // More columns } } } new Prefix_Custom_Admin_Columns( 'post', array() ); new Prefix_Custom_Admin_Columns( 'page', array() ); new Prefix_Custom_Admin_Columns( 'review', array() ); }Can you please correct it for me?
Jochen[email protected]
ParticipantDavid, your code is working great for me.
Thanks
Jochen[email protected]
ParticipantThank you.
So I need a new template file?
I have to look into it... -
AuthorPosts
Viewing 7 posts - 1 through 7 (of 7 total)