__construct() 공개 메소드

Button name
부터: 0.1.0
public __construct ( string $button_slug, array $js_button_data, array $args = [] )
$button_slug string Button name/slug
$js_button_data array Button arguments passed to Javascript
$args array (optional) Override arguments
 /**
  * Constructor
  *
  * @since 0.1.0
  */
 public function __construct($shortcode = '', $version = '', $atts_defaults = array())
 {
     $this->shortcode = $shortcode;
     $this->atts_defaults = $atts_defaults;
     $this->version = $version;
     if (empty($this->shortcode) || empty($this->version)) {
         wp_die(get_class($this) . ' must have $shortcode and $version properties set and non-empty.');
     }
     parent::__construct($this->shortcode, $this->_js_button_data(), $this->_additional_args());
     remove_action('init', array($this, 'hooks'));
     // Since we're hooking in the Shortcode_Button hooks method later, we need to hook in the
     // ajax callbacks now (or they don't get fired).
     add_action('wp_ajax_scb_parse_shortcode', array('Shortcode_Button', 'ajax_parse_shortcode'));
     add_action('wp_ajax_nopriv_scb_parse_shortcode', array('Shortcode_Button', 'ajax_parse_shortcode'));
 }