wc_autoship_settings (filter)

Add custom settings to be displayed with Autoship Settings.

Example

<?php

/**
* @param array $autoship_settings
* @return array
*/
function wc_autoship_settings_example( $autoship_settings ) {
  // Add a custom setting 
  $my_setting = array(
    'name'     => __( 'my_custom_setting', 'my-plugin' ),
    'desc'     => __( 'Description of setting', 'my-plugin' ),
    'desc_tip' => false,
    'type'     => 'checkbox',
    'id'       => 'my_plugin_setting_id'
  );
  array_push( $autoship_settings, $my_setting );
  return $autoship_settings;
}
add_filter( 'wc_autoship_settings', 'wc_autoship_settings_example', 10, 1 );

Still need help? Contact Us Contact Us