yit_cptu_fields

The YITH WooCommerce Compare yit cptu fields hook.

Description

apply_filters( 'yit_cptu_fields', (callback) $layouts ); 

Parameters (1)

0. $layouts — Optional. (callback) => array( 'type' => array( 'label' => __( 'Type', 'yith-plugin-fw' ), 'desc' => sprintf( __( 'Layout for this %s' , 'yith-plugin-fw' ), strtolower( $this->_labels['singular'] ) ), 'type' => 'select', 'options' => isset( $layouts ) ? $layouts : array(), 'std' => '' ),'rewrite' => array( 'label' => __( 'Rewrite', 'yith-plugin-fw' ), 'desc' => __( 'Univocal identification name in the URL for each product (slug from post if empty)', 'yith-plugin-fw' ), 'type' => 'text', 'std' => '' ),'label_singular' => array( 'label' => __( 'Label in Singular', 'yith-plugin-fw' ), 'desc' => __( 'Set a label in singular (title of portfolio if empty)', 'yith-plugin-fw' ), 'type' => 'text', 'std' => '' ),'label_plural' => array( 'label' => __( 'Label in Plural', 'yith-plugin-fw' ), 'desc' => __( 'Set a label in plural (title of portfolio if empty)', 'yith-plugin-fw' ), 'type' => 'text', 'std' => '' ),'taxonomy' => array( 'label' => __( 'Taxonomy', 'yith-plugin-fw' ), 'desc' => __( 'If you want to use categories in the portfolio, set a name for taxonomy. Name should be a slug (must not contain capital letters nor spaces) and must not be more than 32 characters long (database structure restriction).', 'yith-plugin-fw' ), 'type' => 'text', 'std' => '' ),'taxonomy_rewrite' => array( 'label' => __( 'Taxonomy Rewrite', 'yith-plugin-fw' ), 'desc' => __( 'Set univocal name for each category page URL.', 'yith-plugin-fw' ), 'type' => 'text', 'std' => '' ),'single_layout' => array( 'label' => __( 'Single layout', 'yith-plugin-fw' ), 'desc' => __( 'Layout for single page of this portfolio', 'yith-plugin-fw' ), 'type' => 'select', 'options' => $single_layouts, 'std' => '' ), )
The array.

Usage

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

Defined (1)

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

/plugin-fw/lib/yit-cpt-unlimited.php  
  1. 'fields' => apply_filters( 'yit_cptu_fields', array(