array( 'name' => esc_html__( 'Call to action', 'mega' ), 'description' => esc_html__( 'Call to action block', 'mega' )), 'universal' => true, 'responsive' => true, 'class_base' => 'ys-cta' ); parent::__construct( __CLASS__, $args ); } public function settings( $form ) { $form->add_control( 'Mega_Control_Text', array( 'label' => esc_html__( 'Title', 'mega' ), 'value' => esc_html__( 'Call to action title goes here', 'mega' ), 'name' => 'cta' )); $form->add_control( 'Mega_Control_WP_Editor', array( 'label' => esc_html__( 'Content', 'mega' ), 'name' => 'text' )); $form->add_control( 'Mega_Control_Text', array( 'label' => esc_html__( 'Button Label', 'mega' ), 'value' => esc_html__( 'Detail', 'mega' ), 'pro' => 1, 'name' => 'button_label' )); $form->add_control( 'Mega_Control_Text', array( 'label' => esc_html__( 'Link', 'mega' ), 'value' => '#', 'name' => 'link' )); } public function hook() { add_action( 'wp_enqueue_scripts', array( $this, 'enqueue' )); add_action( 'wp_footer', array( &$this, 'foot' ), 25 ); } public function enqueue() { wp_enqueue_script( 'mega.jquery.width' ); } public function foot() { ?> mega['settings'] ); echo '
'; echo mega_auto_tag( 'div', array( 'text' => mega_auto_tag( 'h2', array( 'text' => esc_html( $cta ))) . mega_auto_tag( 'div', array( 'text' => wpautop( $text ), 'attr' => array( 'class' => 'text' ))), 'attr' => array( 'class' => 'content column col-md col-44-12 first ' . mega_float() ) )); if ( !empty( $link )) { echo mega_auto_tag( 'div', array( 'text' => mega_auto_tag( 'a', array( 'text' => '' . esc_html( $button_label ) . '', 'attr' => array( 'href' => $link, 'class' => 'button' ), 'bypass' => false )), 'attr' => array( 'class' => 'column col-md col-32-12 ' . mega_float() ) )); } echo '
'; } }