woocommerce_product_settings

Get settings array.

Description

(array) apply_filters( 'woocommerce_product_settings', (array) $array ); 

Returns (array)

Parameters (1)

0. $array — Optional. (array) => array(array( 'title' => __( 'Shop & product pages', 'woocommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'catalog_options', ),array( 'title' => __( 'Shop page', 'woocommerce' ), 'desc' => '
' . sprintf( __( 'The base page can also be used in your product permalinks.', 'woocommerce' ), admin_url( 'options-permalink.php' ) ), 'id' => 'woocommerce_shop_page_id', 'type' => 'single_select_page', 'default' => '', 'class' => 'wc-enhanced-select-nostd', 'css' => 'min-width:300px;', 'desc_tip' => __( 'This sets the base page of your shop - this is where your product archive will be.', 'woocommerce' ), ),array( 'title' => __( 'Shop page display', 'woocommerce' ), 'desc' => __( 'This controls what is shown on the product archive.', 'woocommerce' ), 'id' => 'woocommerce_shop_page_display', 'class' => 'wc-enhanced-select', 'css' => 'min-width:300px;', 'default' => '', 'type' => 'select', 'options' => array( '' => __( 'Show products', 'woocommerce' ), 'subcategories' => __( 'Show categories', 'woocommerce' ), 'both' => __( 'Show categories & products', 'woocommerce' ), ), 'desc_tip' => true, ),array( 'title' => __( 'Default category display', 'woocommerce' ), 'desc' => __( 'This controls what is shown on category archives.', 'woocommerce' ), 'id' => 'woocommerce_category_archive_display', 'class' => 'wc-enhanced-select', 'css' => 'min-width:300px;', 'default' => '', 'type' => 'select', 'options' => array( '' => __( 'Show products', 'woocommerce' ), 'subcategories' => __( 'Show subcategories', 'woocommerce' ), 'both' => __( 'Show subcategories & products', 'woocommerce' ), ), 'desc_tip' => true, ),array( 'title' => __( 'Default product sorting', 'woocommerce' ), 'desc' => __( 'This controls the default sort order of the catalog.', 'woocommerce' ), 'id' => 'woocommerce_default_catalog_orderby', 'class' => 'wc-enhanced-select', 'css' => 'min-width:300px;', 'default' => 'menu_order', 'type' => 'select', 'options' => apply_filters( 'woocommerce_default_catalog_orderby_options', array( 'menu_order' => __( 'Default sorting (custom ordering + name)', 'woocommerce' ), 'popularity' => __( 'Popularity (sales)', 'woocommerce' ), 'rating' => __( 'Average rating', 'woocommerce' ), 'date' => __( 'Sort by most recent', 'woocommerce' ), 'price' => __( 'Sort by price (asc)', 'woocommerce' ), 'price-desc' => __( 'Sort by price (desc)', 'woocommerce' ), ) ), 'desc_tip' => true, ),array( 'title' => __( 'Add to cart behaviour', 'woocommerce' ), 'desc' => __( 'Redirect to the cart page after successful addition', 'woocommerce' ), 'id' => 'woocommerce_cart_redirect_after_add', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'start', ),array( 'desc' => __( 'Enable AJAX add to cart buttons on archives', 'woocommerce' ), 'id' => 'woocommerce_enable_ajax_add_to_cart', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'end', ),array( 'type' => 'sectionend', 'id' => 'catalog_options', ),array( 'title' => __( 'Product images', 'woocommerce' ), 'type' => 'title', 'desc' => sprintf( __( 'These settings affect the display and dimensions of images in your catalog - the display on the front-end will still be affected by CSS styles. After changing these settings you may need to regenerate your thumbnails.', 'woocommerce' ), 'https://wordpress.org/plugins/regenerate-thumbnails/' ), 'id' => 'image_options', ),array( 'title' => __( 'Catalog images', 'woocommerce' ), 'desc' => __( 'This size is usually used in product listings. (W x H)', 'woocommerce' ), 'id' => 'shop_catalog_image_size', 'css' => '', 'type' => 'image_width', 'default' => array( 'width' => '300', 'height' => '300', 'crop' => 1, ), 'desc_tip' => true, ),array( 'title' => __( 'Single product image', 'woocommerce' ), 'desc' => __( 'This is the size used by the main image on the product page. (W x H)', 'woocommerce' ), 'id' => 'shop_single_image_size', 'css' => '', 'type' => 'image_width', 'default' => array( 'width' => '600', 'height' => '600', 'crop' => 1, ), 'desc_tip' => true, ),array( 'title' => __( 'Product thumbnails', 'woocommerce' ), 'desc' => __( 'This size is usually used for the gallery of images on the product page. (W x H)', 'woocommerce' ), 'id' => 'shop_thumbnail_image_size', 'css' => '', 'type' => 'image_width', 'default' => array( 'width' => '180', 'height' => '180', 'crop' => 1, ), 'desc_tip' => true, ),array( 'type' => 'sectionend', 'id' => 'image_options', ),)
The array.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'woocommerce_product_settings', $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 woocommerce_product_settings callback 
  2. function filter_woocommerce_product_settings( $array ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_product_settings', 'filter_woocommerce_product_settings', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_product_settings', 'filter_woocommerce_product_settings', 10, 1 ); 

Defined (1)

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

/includes/admin/settings/class-wc-settings-products.php  
  1. $settings = apply_filters( 'woocommerce_product_settings', array(