woocommerce_downloadable_products_settings

The WooCommerce woocommerce downloadable products settings hook.

Description

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

Parameters (1)

0. $array — Optional. (array) => array( array( 'title' => __( 'Downloadable products', 'woocommerce' ), 'type' => 'title', 'id' => 'digital_download_options', ),array( 'title' => __( 'File download method', 'woocommerce' ), 'desc' => __( 'Forcing downloads will keep URLs hidden, but some servers may serve large files unreliably. If supported, X-Accel-Redirect/ X-Sendfile can be used to serve downloads instead (server requires mod_xsendfile).', 'woocommerce' ), 'id' => 'woocommerce_file_download_method', 'type' => 'select', 'class' => 'wc-enhanced-select', 'css' => 'min-width:300px;', 'default' => 'force', 'desc_tip' => true, 'options' => array( 'force' => __( 'Force downloads', 'woocommerce' ), 'xsendfile' => __( 'X-Accel-Redirect/X-Sendfile', 'woocommerce' ), 'redirect' => __( 'Redirect only', 'woocommerce' ), ), 'autoload' => false, ),array( 'title' => __( 'Access restriction', 'woocommerce' ), 'desc' => __( 'Downloads require login', 'woocommerce' ), 'id' => 'woocommerce_downloads_require_login', 'type' => 'checkbox', 'default' => 'no', 'desc_tip' => __( 'This setting does not apply to guest purchases.', 'woocommerce' ), 'checkboxgroup' => 'start', 'autoload' => false, ),array( 'desc' => __( 'Grant access to downloadable products after payment', 'woocommerce' ), 'id' => 'woocommerce_downloads_grant_access_after_payment', 'type' => 'checkbox', 'default' => 'yes', 'desc_tip' => __( 'Enable this option to grant access to downloads when orders are "processing", rather than "completed".', 'woocommerce' ), 'checkboxgroup' => 'end', 'autoload' => false, ),array( 'type' => 'sectionend', 'id' => 'digital_download_options', ),)
The array.

Usage

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