Page Load Actions - rogerlos/cmb2-metatabs-options GitHub Wiki

Starting with version 1.1.0, CMO allows you to inject an array of load-yourpagehook actions via $args['load'].


$args['load'] = array(
    array(
        'action'   => (string)   'load-[hook]',
        'callback' => (callable) 'my_function',
        'priority' => (int)      10,
        'args'     => (int)      1,
    )
);

CMO will replace the [hook] token with the page hook.

CMO will not add any action which does not contain the string -[hook] as part of the action value. (This is token (hah!) security, but better than nothing. Words to watch the world burn by. You can comment out line 368 of the PHP class file to completely disable this functionality.)