<option_name>_settings_fields

The WooCommerce Compare Products LITE option name settings fields hook.

Description

apply_filters( '<option_name>_settings_fields', (array) $array ); 

Parameters (1)

0. $array — Optional. (array) => array( array( 'name' => __( 'Plugin Framework Global Settings', 'woocommerce-compare-products' ), 'id' => 'plugin_framework_global_box', 'type' => 'heading', 'first_open'=> true, 'is_box' => true, ), array( 'name' => __( 'Customize Admin Setting Box Display', 'woocommerce-compare-products' ), 'desc' => __( 'By default each admin panel will open with all Setting Boxes in the CLOSED position.', 'woocommerce-compare-products' ), 'type' => 'heading', ), array( 'type' => 'onoff_toggle_box', ), array( 'name' => __( 'Google Fonts', 'woocommerce-compare-products' ), 'desc' => __( 'By Default Google Fonts are pulled from a static JSON file in this plugin. This file is updated but does not have the latest font releases from Google.', 'woocommerce-compare-products' ), 'type' => 'heading', ), array( 'type' => 'google_api_key', ), array( 'name' => __( 'House Keeping', 'woocommerce-compare-products' ), 'type' => 'heading', ), array( 'name' => __( 'Clean up on Deletion', 'woocommerce-compare-products' ), 'desc' => __( 'On deletion (not deactivate) the plugin will completely remove all tables and data it created, leaving no trace it was ever here.', 'woocommerce-compare-products' ), 'id' => 'woo_compare_product_lite_clean_on_deletion', 'type' => 'onoff_checkbox', 'default' => 1, 'separate_option' => true, 'free_version' => true, 'checked_value' => 1, 'unchecked_value' => 0, 'checked_label' => __( 'ON', 'woocommerce-compare-products' ), 'unchecked_label' => __( 'OFF', 'woocommerce-compare-products' ), ),array( 'name' => __( 'Getting Started', 'woocommerce-compare-products' ), 'id' => 'compare_getting_started_box', 'type' => 'heading', 'is_box' => true, ), array( 'name' => __( 'Quick Start', 'woocommerce-compare-products' ), 'desc' => __( 'Here is a 9 step guide for a fast start', 'woocommerce-compare-products' ) . '
  • 1. ' . __( "Go to WC Compare > Settings & Style menu and checked that Compare Feature is switched ON for Product Page and Product Card. Note the compare button / Hyperlink will not show on any product until the feature is activated on that product.", 'woocommerce-compare-products' ) . '
  • 2. ' . __( "Go to your widgets menu and add the Woo Compare Widget to the widget areas where you want it to show.", 'woocommerce-compare-products' ) . '
  • 3. ' . __( "Go to the WC Compare > Category and Feature menu.", 'woocommerce-compare-products' ) . '
  • 4. ' . __( "Edit the Features that you see in the Un-Assigned Features Box. If there is nothing in that box then either add some Product Attributes or click the [ Add New ] button that is to the right of the Categories & Features title at the top of the page.", 'woocommerce-compare-products' ) . '
  • 5. ' . __( "Once you have assigned at least 1 Compare Feature to a Compare category it is then available for adding the compare feature to products.", 'woocommerce-compare-products' ) . '
  • 6. ' . __( "Go to your products menu and select a product and edit it.", 'woocommerce-compare-products' ) . '
  • 7. ' . __( "Go the 'Compare Feature Fields' and Activate the compare Feature. If it is a Variable Product you also activate and set the compare feature for each variation.", 'woocommerce-compare-products' ) . '
  • 8. ' . __( "Update the product and view it in a browser - Congratulations you have just created your first product with the compare feature.", 'woocommerce-compare-products' ) . '
  • 9. ' . __( "Go to the Settings & Style Menu and use the dynamic settings boxes and their options to edit the way compare shows on the front end.", 'woocommerce-compare-products' ) . '
', 'type' => 'heading', ), array( 'name' => __( 'How Comparison Works', 'woocommerce-compare-products' ), 'desc' => __( 'Comparison Data Sets', 'woocommerce-compare-products' ) . '
  • * ' . __( "To create meaningful features and specification data that can be compared on products by customers, that data must be created.", 'woocommerce-compare-products' ) . '
  • * ' . __( "That specific data once created is then assigned to specific products so users can view a table of data that applies to that product and thus creates a meaningful comparison of features and specs.", 'woocommerce-compare-products' ) . '
  • * ' . __( "A data set comprises a Compare Category with Compare features and that features data.", 'woocommerce-compare-products' ) . '
', 'type' => 'heading', ), array( 'name' => __( 'Creating Comparison Data Sets', 'woocommerce-compare-products' ), 'desc' => __( 'On first install of WooCommerce Compare Products Free version', 'woocommerce-compare-products' ) . '
  • 1. ' . __( "All existing Product > Categories are created as Compare Categories.", 'woocommerce-compare-products' ) . '
  • 2. ' . __( "All existing Product > Attributes are created as Compare Features.", 'woocommerce-compare-products' ) . '
  • 3. ' . __( "All existing Product > Attributes > Terms are created as the Compare Features Input Data.", 'woocommerce-compare-products' ) . '
  • 4. ' . __( "Go to the WC Compare > Category & Feature Menu to view those.", 'woocommerce-compare-products' ) . '
', 'type' => 'heading', ), array( 'name' => __( 'Things to know', 'woocommerce-compare-products' ), 'desc' => __( 'Once installed WooCommerce Compare Products will', 'woocommerce-compare-products' ) . '
  • 1. ' . __( "Each time a new Product Category is created it is auto created as a Compare Category.", 'woocommerce-compare-products' ) . '
  • 2. ' . __( "Each time a new Product Attribute is created it is auto created as a Compare Feature.", 'woocommerce-compare-products' ) . '
  • 3. ' . __( "Compare Categories and Compare Features can be created on the WC Category & Feature menu independent of your Product Categories and Product Attributes.", 'woocommerce-compare-products' ) . '
  • 4. ' . __( "Compare Categories and Compare Features created on the WC Category & Feature menu are NOT created as Product Categories or Product Attributes.", 'woocommerce-compare-products' ) . '
  • 5. ' . __( "Deleting a Product Category, Product Attribute DOES NOT delete the corresponding Compare Category / Compare Feature and vice versa.", 'woocommerce-compare-products' ) . '
  • 6. ' . __( "When a Product > Attribute is created, Terms are created for it after the Attribute is created. The Attribute is auto created as a Un-Assigned Compare Feature - BUT any terms created are NOT auto created as the Compare Feature input data. That must be done by editing the Compare Attribute on the WC Category and Feature Menu.", 'woocommerce-compare-products' ) . '
  • 7. ' . __( "Compare Products Premium works differently in that the compare feature is fully intergrated into Product Categories, Attributes and their Terms and does not have the 2 as separate data like the Free version has.", 'woocommerce-compare-products' ) . '
  • 8. ' . __( "When upgrading to the Premium version no data created on the Free version is lost.", 'woocommerce-compare-products' ) . '
', 'type' => 'heading', ),)
The array.

Usage

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

Defined (1)

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

/admin/settings/global-settings.php  
  1. $this->form_fields = apply_filters( $this->option_name . '_settings_fields', array(