woocommerce_<id>_settings

Get settings array.

Description

(array) apply_filters( 'woocommerce_<id>_settings', (array) $var ); 

Returns (array)

Parameters (1)

0. $var — Optional. (array) => array(array( 'title' => __( 'Account pages', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'These pages need to be set so that WooCommerce knows where to send users to access account related functionality.', 'woocommerce' ), 'id' => 'account_page_options' ),array( 'title' => __( 'My account page', 'woocommerce' ), 'desc' => sprintf( __( 'Page contents: [%s]', 'woocommerce' ), apply_filters( 'woocommerce_my_account_shortcode_tag', 'woocommerce_my_account' ) ), 'id' => 'woocommerce_myaccount_page_id', 'type' => 'single_select_page', 'default' => '', 'class' => 'wc-enhanced-select', 'css' => 'min-width:300px;', 'desc_tip' => true, ),array( 'type' => 'sectionend', 'id' => 'account_page_options' ),array( 'title' => '', 'type' => 'title', 'id' => 'account_registration_options' ),array( 'title' => __( 'Customer registration', 'woocommerce' ), 'desc' => __( 'Enable customer registration on the "Checkout" page.', 'woocommerce' ), 'id' => 'woocommerce_enable_signup_and_login_from_checkout', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start', 'autoload' => false, ),array( 'desc' => __( 'Enable customer registration on the "My account" page.', 'woocommerce' ), 'id' => 'woocommerce_enable_myaccount_registration', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', 'autoload' => false, ),array( 'title' => __( 'Login', 'woocommerce' ), 'desc' => __( 'Display returning customer login reminder on the "Checkout" page.', 'woocommerce' ), 'id' => 'woocommerce_enable_checkout_login_reminder', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start', 'autoload' => false, ),array( 'title' => __( 'Account creation', 'woocommerce' ), 'desc' => __( 'Automatically generate username from customer email.', 'woocommerce' ), 'id' => 'woocommerce_registration_generate_username', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start', 'autoload' => false, ),array( 'desc' => __( 'Automatically generate customer password', 'woocommerce' ), 'id' => 'woocommerce_registration_generate_password', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', 'autoload' => false, ),array( 'type' => 'sectionend', 'id' => 'account_registration_options' ),array( 'title' => __( 'My account endpoints', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'Endpoints are appended to your page URLs to handle specific actions on the accounts pages. They should be unique and can be left blank to disable the endpoint.', 'woocommerce' ), 'id' => 'account_endpoint_options' ),array( 'title' => __( 'Orders', 'woocommerce' ), 'desc' => __( 'Endpoint for the "My account → Orders" page.', 'woocommerce' ), 'id' => 'woocommerce_myaccount_orders_endpoint', 'type' => 'text', 'default' => 'orders', 'desc_tip' => true, ),array( 'title' => __( 'View order', 'woocommerce' ), 'desc' => __( 'Endpoint for the "My account → View order" page.', 'woocommerce' ), 'id' => 'woocommerce_myaccount_view_order_endpoint', 'type' => 'text', 'default' => 'view-order', 'desc_tip' => true, ),array( 'title' => __( 'Downloads', 'woocommerce' ), 'desc' => __( 'Endpoint for the "My account → Downloads" page.', 'woocommerce' ), 'id' => 'woocommerce_myaccount_downloads_endpoint', 'type' => 'text', 'default' => 'downloads', 'desc_tip' => true, ),array( 'title' => __( 'Edit account', 'woocommerce' ), 'desc' => __( 'Endpoint for the "My account → Edit account" page.', 'woocommerce' ), 'id' => 'woocommerce_myaccount_edit_account_endpoint', 'type' => 'text', 'default' => 'edit-account', 'desc_tip' => true, ),array( 'title' => __( 'Addresses', 'woocommerce' ), 'desc' => __( 'Endpoint for the "My account → Addresses" page.', 'woocommerce' ), 'id' => 'woocommerce_myaccount_edit_address_endpoint', 'type' => 'text', 'default' => 'edit-address', 'desc_tip' => true, ),array( 'title' => __( 'Payment methods', 'woocommerce' ), 'desc' => __( 'Endpoint for the "My account → Payment methods" page.', 'woocommerce' ), 'id' => 'woocommerce_myaccount_payment_methods_endpoint', 'type' => 'text', 'default' => 'payment-methods', 'desc_tip' => true, ),array( 'title' => __( 'Lost password', 'woocommerce' ), 'desc' => __( 'Endpoint for the "My account → Lost password" page.', 'woocommerce' ), 'id' => 'woocommerce_myaccount_lost_password_endpoint', 'type' => 'text', 'default' => 'lost-password', 'desc_tip' => true, ),array( 'title' => __( 'Logout', 'woocommerce' ), 'desc' => __( 'Endpoint for the triggering logout. You can add this to your menus via a custom link: yoursite.com/?customer-logout=true', 'woocommerce' ), 'id' => 'woocommerce_logout_endpoint', 'type' => 'text', 'default' => 'customer-logout', 'desc_tip' => true, ),array( 'type' => 'sectionend', 'id' => 'account_endpoint_options' ),)
The array.

Usage

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

Defined (1)

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

/includes/admin/settings/class-wc-settings-accounts.php  
  1. $settings = apply_filters( 'woocommerce_' . $this->id . '_settings', array(