id = 'sharedaddy'; $this->method_title = __( 'ShareDaddy', 'woocommerce' ); $this->method_description = __( 'ShareDaddy is a sharing plugin bundled with JetPack.', 'woocommerce' ); // Load the settings. $this->init_form_fields(); $this->init_settings(); // Actions add_action( 'woocommerce_update_options_integration_sharedaddy', array( $this, 'process_admin_options' ) ); // Share widget add_action( 'woocommerce_share', array( $this, 'sharedaddy_code' ) ); } /** * Initialise Settings Form Fields * * @access public * @return void */ function init_form_fields() { $this->form_fields = array( 'enabled' => array( 'title' => __( 'Output ShareDaddy button?', 'woocommerce' ), 'description' => __( 'Enable this option to show the ShareDaddy button on the product page.', 'woocommerce' ), 'type' => 'checkbox', 'default' => get_option('woocommerce_sharedaddy') ? get_option('woocommerce_sharedaddy') : 'no' ) ); } /** * Output share code. * * @access public * @return void */ function sharedaddy_code() { global $post; if ( $this->enabled == 'yes' && function_exists('sharing_display') ) { ?>