array( 'name' => esc_html__( 'Contact Info', 'mega' ), 'description' => esc_html__( 'Contact Info Block', 'mega' )), 'universal' => true, 'pro' => true, 'class_base' => 'ys-contact-info' ); parent::__construct( __CLASS__, $args ); } public function settings( $form ) { $form->add_control( 'Mega_Control_Text', array( 'label' => esc_html__( 'Title', 'mega' ), 'value' => esc_html_x( 'Contact', 'Contact Info', 'mega' ), 'name' => 'title' )); $form->add_control( 'Mega_Control_WP_Editor', array( 'label' => esc_html__( 'Text', 'mega' ), 'value' => esc_html__( 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.', 'mega' ), 'name' => 'text' )); $form->add_control( 'Mega_Control_Checklist', array( 'label' => esc_html__( 'Info Type', 'mega' ), 'value' => array( 'address' => 1, 'phone' => 1, 'email' => 1 ), 'name' => 'types', 'choices' => array( 'address' => esc_html__( 'Address', 'mega' ), 'phone' => esc_html__( 'Phone', 'mega' ), 'email' => esc_html__( 'Email', 'mega' ) ) )); $form->add_control( 'Mega_Control_Text', array( 'label' => esc_html__( 'Address Label', 'mega' ), 'pro' => 1, 'value' => esc_html__( 'Address:', 'mega' ), 'name' => 'address' )); $form->add_control( 'Mega_Control_Text', array( 'label' => esc_html__( 'Address', 'mega' ), 'value' => esc_html__( '1535 Broadway, New York', 'mega' ), 'name' => 'address_value' )); $form->add_control( 'Mega_Control_Text', array( 'label' => esc_html__( 'Phone Label', 'mega' ), 'pro' => 1, 'value' => esc_html__( 'Phone:', 'mega' ), 'name' => 'phone' )); $form->add_control( 'Mega_Control_Text', array( 'label' => esc_html__( 'Phone', 'mega' ), 'value' => esc_html__( '1-888-456-7890', 'mega' ), 'name' => 'phone_value' )); $form->add_control( 'Mega_Control_Text', array( 'label' => esc_html__( 'Email Label', 'mega' ), 'pro' => 1, 'value' => esc_html__( 'Email:', 'mega' ), 'name' => 'email' )); $form->add_control( 'Mega_Control_Email', array( 'label' => esc_html__( 'Email', 'mega' ), 'value' => 'support@example.com', 'name' => 'email_value' )); } public function block() { extract( $this->mega['settings'] ); $email_value = '' . esc_html( $email_value ) . ''; echo wpautop( $text ); echo ''; } }