wpseo_metabox_entries_<tab>

Filter the WPSEO metabox form field definitions for a tab {tab} can be 'general', 'advanced' or 'social'.

Description

(array) apply_filters( 'wpseo_metabox_entries_<tab>', (array) $field_defs, (string) $post_type ); 

Returns (array)

Parameters (2)

0. $field_defs (array)
Metabox form definitions.
1. $post_type (string)
Post type of the post the metabox is for, defaults to post..

Usage

To run the hook, copy the example below.
  1. $field_defs = apply_filters( 'wpseo_metabox_entries_{$tab}', $field_defs, $post_type ); 
  2.  
  3. if ( !empty( $field_defs ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wpseo_metabox_entries_<tab> callback 
  2. function filter_wpseo_metabox_entries_tab( $field_defs, $post_type ) { 
  3. // make filter magic happen here... 
  4. return $field_defs
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "wpseo_metabox_entries_{$tab}", 'filter_wpseo_metabox_entries_tab', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "wpseo_metabox_entries_{$tab}", 'filter_wpseo_metabox_entries_tab', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/inc/class-wpseo-meta.php  
  1. return apply_filters( 'wpseo_metabox_entries_' . $tab, $field_defs, $post_type );