yourprefix_before_row_if_2

Conditionally displays a message if the $post_id is 2.

Description

yourprefix_before_row_if_2( (array) $field_args, (CMB2_Field) $field ); 

Parameters (2)

0. $field_args (array)
Array of field parameters
1. $field (CMB2_Field)
Object $field Field object

Usage

  1. if ( !function_exists( 'yourprefix_before_row_if_2' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'cmb2/example-functions.php'; 
  3.  
  4. // Array of field parameters 
  5. $field_args = array(); 
  6.  
  7. // object $field Field object 
  8. $field = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = yourprefix_before_row_if_2($field_args, $field); 
  12.  

Defined (1)

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

/example-functions.php  
  1. function yourprefix_before_row_if_2( $field_args, $field ) { 
  2. if ( 2 == $field->object_id ) { 
  3. echo '<p>Testing <b>"before_row"</b> parameter (on $post_id 2)</p>'; 
  4. } else { 
  5. echo '<p>Testing <b>"before_row"</b> parameter (<b>NOT</b> on $post_id 2)</p>';