rwmb_normalize_meta_box Filter not present in code but is present in docs

Support General rwmb_normalize_meta_box Filter not present in code but is present in docsResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14652
    Content PilotContent Pilot
    Participant

    I want to filter the title of the metabox.

    I found this filter, rwmb_normalize_meta_box_id_meta_box, in the documentation but cannot find it within the source code even when I search for rwmb_normalize.

    https://docs.metabox.io/filters/#rwmb_normalize_meta_box_id_meta_box

    Is this filter still available or is the documentation out of date?

    How can I filter the title of a metabox?

    Like this?

    add_filter("rwmb_normalize_{$metabox_id}_meta_box", 'prefix_change_meta_box_title' ), 10, 1 );
    function prefix_change_meta_box_title( $meta_box ) {
        $meta_box['title'] = esc_html__( 'New title', 'text-domain' );
        return $meta_box;
    }
    
    #14662
    Anh TranAnh Tran
    Keymaster

    Hi Clayton,

    Sorry, the docs was not updated. This filter was rarely used and was removed from the plugin. To change the meta box title, please use this code:

    add_action( 'init', function() {
        $meta_box = rwmb_get_registry( 'meta_box' )->get( 'your_meta_box_id' );
        $meta_box->meta_box['title'] = 'New title';
    }, 99 );
    #14678
    Content PilotContent Pilot
    Participant

    Thanks Ahn!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.