/** * Add metabox to newsletter custom post * * Add metabox to the custom post * * @return void * @since 1.0 * @author Antonio La Rocca <*****@*****.**> */ public function add_metabox() { // register integration type if (is_dir($this->plugin_path . '/integration-type/') && ($dir_handle = opendir($this->plugin_path . '/integration-type/'))) { while (($file = readdir($dir_handle)) !== false) { if (!is_dir($file) && !in_array($file, array('.', '..', '.svn'))) { include_once $this->plugin_path . '/integration-type/' . $file; $class_name = "YIT_Newsletter_" . basename($file, ".php"); new $class_name(); } } closedir($dir_handle); } $integration_types = array('custom' => __('Custom Form', 'yit')); // let custom integration to appear in integration type select field $integration_types = apply_filters('yit-newsletter-integration-type', $integration_types); $args = array('label' => __('Form specification', 'yit'), 'pages' => $this->newsletter_post_type, 'context' => 'normal', 'priority' => 'default', 'tabs' => array('settings' => array('label' => __('Form specification', 'yit'), 'fields' => array('integration' => array('label' => __('Form integration preset', 'yit'), 'desc' => __('Select what kind of newsletter service you want to use, or set a custom form.', 'yit'), 'type' => 'select', 'options' => $integration_types, 'std' => 'mailchimp'), 'action' => array('label' => __('Form action', 'yit'), 'desc' => __('The attribute "action" of the form.', 'yit'), 'type' => 'text', 'std' => '', 'deps' => array('ids' => '_integration', 'values' => 'custom')), 'method' => array('label' => __('Request Method', 'yit'), 'desc' => __('The attribute "method" of the form.', 'yit'), 'type' => 'select', 'options' => array('post' => __('POST', 'yit'), 'get' => __('GET', 'yit')), 'std' => 'post', 'deps' => array('ids' => '_integration', 'values' => 'custom')), 'email-label' => array('label' => __('Email field label', 'yit'), 'desc' => __('The label for "email" field', 'yit'), 'type' => 'text', 'std' => 'Email', 'deps' => array('ids' => '_integration', 'values' => 'custom')), 'email-name' => array('label' => __('Email field "name" attribute', 'yit'), 'desc' => __('The attribute "name" of the email address field.', 'yit'), 'type' => 'text', 'std' => '', 'deps' => array('ids' => '_integration', 'values' => 'custom')), 'submit-label' => array('label' => __('Submit button label', 'yit'), 'desc' => __('This field is not always used. Depends on the style of the form.', 'yit'), 'type' => 'text', 'std' => 'Add Me', 'deps' => array('ids' => '_integration', 'values' => 'custom')), 'hidden-fields' => array('label' => __('Hidden fields', 'yit'), 'desc' => __('Type here all hidden fields names and values in serializate way. Example: name1=value1&name2=value2.', 'yit'), 'type' => 'text', 'std' => '', 'deps' => array('ids' => '_integration', 'values' => 'custom')))))); // let custom integration type to register their metabox $args['tabs']['settings']['fields'] = apply_filters('yit-newsletter-metabox', $args['tabs']['settings']['fields']); $metabox = new YIT_Metabox('yit-newsletter-form-info'); $metabox->init($args); }
/** * Add metabox to testimonial custom post * * Add metabox to the custom post * * @return void * @since 1.0 * @author Emanuela Castorina <*****@*****.**> */ public function add_metabox() { $args = array('label' => __('Other Logos Info', 'yit'), 'pages' => $this->logo_post_type, 'context' => 'normal', 'priority' => 'default', 'tabs' => array('settings' => array('label' => __('Site URL', 'yit'), 'fields' => array('logo_site' => array('label' => __('Link', 'yit'), 'desc' => __('Insert the link for Logo.', 'yit'), 'type' => 'text', 'std' => ''))))); $metabox = new YIT_Metabox('yit-logos-info'); $metabox->init($args); }
/** * Add metabox to contact form custom post * * Add metabox to the custom post * * @return void * @since 1.0 * @author Francesco Licandro <*****@*****.**> */ public function add_metabox() { $args = array('label' => __('Form Settings', 'yit'), 'pages' => $this->contact_form_post_type, 'context' => 'normal', 'priority' => 'default', 'tabs' => array('configuration' => array('label' => __('Contact Form Configuration', 'yit'), 'fields' => array('receiver' => array('label' => __('Receiver(s)', 'yit'), 'desc' => 'Define the emails used (separeted by comma) to receive emails.', 'type' => 'text', 'std' => '*****@*****.**'), 'sender_mail' => array('label' => __('Sender Email', 'yit'), 'desc' => 'Define from what email send the message.', 'type' => 'text', 'std' => '*****@*****.**'), 'sender_name' => array('label' => __('Sender Name', 'yit'), 'desc' => 'Define the name of email that send the message.', 'type' => 'text', 'std' => 'Admin'), 'subject' => array('label' => __('Subject', 'yit'), 'desc' => 'Define the subject of the email sent to you.', 'type' => 'text', 'std' => ''), 'body' => array('label' => __('Body', 'yit'), 'desc' => 'Define the body of the email sent to you.', 'type' => 'textarea', 'std' => '%message% <small><i>This email is been sent by %name% (email. %email%).</i></small>'), 'title_position' => array('label' => __('Position of the field title', 'yit'), 'desc' => 'Select the position of the field title', 'type' => 'select', 'options' => array('placeholder' => __('Placeholder', 'yit'), 'label' => __('Label', 'yit'), 'both' => __('Both', 'yit')), 'std' => 'placeholder'), 'submit_label' => array('label' => __('Submit Button Label', 'yit'), 'desc' => 'Define the label of submit button.', 'type' => 'text', 'std' => 'Send Message'), 'submit_alignment' => array('label' => __('Submit Button Alignment', 'yit'), 'desc' => 'Set the alignment of submit button.', 'type' => 'select', 'options' => array('alignleft' => 'left', 'aligncenter' => 'center', 'alignright' => 'right')), 'submit_style' => array('label' => __('Submit Button Style', 'yit'), 'desc' => 'Set the style of submit button.', 'type' => 'select', 'options' => apply_filters('yit_contact_form_buttons_style', array('flat' => 'Flat', 'alternative' => 'Alternative'))), 'do_ajax' => array('label' => __('Ajax Activate', 'yit'), 'desc' => '', 'type' => 'checkbox', 'std' => 'yes'), 'success_sending' => array('label' => __('Success Message', 'yit'), 'desc' => 'Define the message when email send correctly.', 'type' => 'text', 'std' => 'Email send correctly!'), 'error_sending' => array('label' => __('Error Message', 'yit'), 'desc' => 'Define the message when there is an error on send of email.', 'type' => 'text', 'std' => 'An error has been encountered. Please try again.'), 'captcha' => array('label' => __('reCaptcha System', 'yit'), 'desc' => 'Check if you want to use reCaptcha system.', 'type' => 'checkbox', 'std' => ''), 'nocaptcha_recaptcha' => array('label' => __('Use No CAPTCHA reCAPTCHA System', 'yit'), 'desc' => 'Check if you want to use the new No CAPTCHA reCAPTCHA System or leave the old reCAPTCHA system.', 'type' => 'checkbox', 'deps' => array('ids' => '_captcha', 'values' => 'yes')), 'private_key' => array('label' => __('Private API Key', 'yit'), 'desc' => 'Insert the private api key of reCaptcha', 'type' => 'text', 'std' => '', 'deps' => array('ids' => '_captcha', 'values' => 'yes')), 'public_key' => array('label' => __('Public API Key', 'yit'), 'desc' => 'Insert the public api key of reCaptcha', 'type' => 'text', 'std' => '', 'deps' => array('ids' => '_captcha', 'values' => 'yes')))), 'edit' => array('label' => __('Add\\Edit Form', 'yit'), 'fields' => array('items' => array('type' => 'contactform', 'std' => array()))))); $metabox = new YIT_Metabox('yit-contact-form-info'); $metabox->init($args); }
/** * Main instance of plugin * * @param $id * * @return \YIT_Metabox * @since 1.0 * @author Emanuela Castorina <*****@*****.**> */ function YIT_Metabox($id) { return YIT_Metabox::instance($id); }
/** * Add metabox to contact form custom post * * Add metabox to the custom post * * @return void * @since 1.0 * @author Francesco Licandro <*****@*****.**> */ public function add_metabox() { // Sohw this advice just when i'm in inserting mode if (!isset($_GET["post"])) { $args = array('label' => __('Publish the features tab to configure it.', 'yit'), 'pages' => $this->feature_tab_post_type, 'context' => 'normal', 'priority' => 'default'); $metabox = new YIT_Metabox('yit-features-tab-form-info'); $metabox->init($args); } }