wchau_settings_fields

The WooCommerce Hear About Us wchau settings fields hook.

Description

apply_filters( 'wchau_settings_fields', (array) $var ); 

Parameters (1)

0. $var — Optional. (array) => array(array( 'title' => __( 'Label', 'woocommerce-hear-about-us' ), 'desc' => __( 'Customize the "where did you hear about us" label.', 'woocommerce-hear-about-us' ), 'id' => 'wchau_label', 'type' => 'text', 'default' => __( 'Where did you hear about us?', 'woocommerce-hear-about-us' ), 'desc_tip' => true, ),array( 'title' => __( 'Label for "other"', 'woocommerce-hear-about-us' ), 'desc' => __( 'Customize the "other" label.', 'woocommerce-hear-about-us' ), 'id' => 'wchau_label_other', 'type' => 'text', 'default' => __( 'Other', 'woocommerce-hear-about-us' ), 'desc_tip' => true, ), array( 'title' => __( 'Possible answers', 'woocommerce-hear-about-us' ), 'desc' => __( 'List all of the possible answers, one answer per line.', 'woocommerce-hear-about-us' ), 'id' => 'wchau_options', 'type' => 'textarea', 'default' => implode( PHP_EOL, array( 'Google', 'Facebook', 'Twitter', 'A friend', 'Other' ) ), 'desc_tip' => true, ) )
The array.

Usage

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

Defined (1)

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

/includes/admin/wchau-admin-setting-fields.php  
  1. $fields = apply_filters( 'wchau_settings_fields', array(