override rwmb_field_meta priority

Support General override rwmb_field_meta priority

  • This topic has 1 reply, 2 voices, and was last updated 1 year ago by PeterPeter.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #45024
    Nicholas CoxNicholas Cox
    Participant

    Hi

    I could not find it in the docs but what priority level does the metabox filters default to? as im trying to override this soo was curious if its possible.

    I tried to set the below filter priority to 15...
    add_filter( 'rwmb_field_meta', [ $this, 'metaboxfiltertest' ], 15, 3);

    and then set the following filter to 10 but the below filterruns after the filter above? even though its set to 10.

    add_filter('render_block', [ $this, 'renderblocktest' ], 10, 2);

    thanks

    Nick

    #45035
    PeterPeter
    Moderator

    Hello Nick,

    They are different filter hooks rwmb_field_meta and render_block so the priority doesn't mean in this case. The priority only works when you add two callback functions to a filter hook. For example:

    add_filter( 'rwmb_field_meta', [ $this, 'metaboxfiltertest' ], 15, 3);

    add_filter( 'rwmb_field_meta', [ $this, 'cusomfiltertest' ], 10, 3);

    Please follow the documentation https://developer.wordpress.org/reference/functions/add_filter/

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