/**
  * Singleton Instance
  *
  * @since 1.0.0
  *
  * @return WP_Job_Manager_Field_Editor
  */
 static function get_instance()
 {
     if (NULL == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 /**
  * Set job_listing field pages
  *
  *
  * @since 1.1.10
  *
  * @return mixed
  */
 function wpjm_pages()
 {
     $job_singular = WP_Job_Manager_Field_Editor::get_job_post_label();
     $this->field_pages['job_listing'] = array('edit_job_fields' => sprintf(__('%1$s Fields', 'wp-job-manager-field-editor'), $job_singular), 'edit_company_fields' => __('Company Fields', 'wp-job-manager-field-editor'));
     return $this->field_pages['job_listing'];
 }
 /**
  * Initialize Settings Array
  *
  *
  * @since 1.1.9
  *
  */
 function init_settings()
 {
     $job_singular = WP_Job_Manager_Field_Editor::get_job_post_label();
     $this->settings = apply_filters('job_manager_field_editor_settings', array('job' => array($job_singular, array(array('name' => 'jmfe_enable_required_label', 'std' => '0', 'label' => __('Custom Required Label', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Use a custom label for required fields instead of optional fields.', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_required_label', 'label' => __('Required Field Label', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => __('<small>(required)</small>', 'wp-job-manager-field-editor')), array('name' => 'jmfe_enable_optional_label', 'std' => '0', 'label' => __('Custom Optional Label', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Use a custom label for optional fields instead of required fields. (default is optional)', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_optional_label', 'label' => __('Optional Field Label', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => __('<small>(optional)</small>', 'wp-job-manager-field-editor')), array('name' => 'jmfe_enable_job_submit_button', 'std' => '0', 'label' => __('Custom Submit Button', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Use a custom value for the submit button (on initial submit page)', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_job_submit_button', 'label' => __('Submit Button Caption', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => __('Preview &rarr;', 'wp-job-manager-field-editor'), 'desc' => __('The default button is <code>Preview &rarr;</code>, use <code>&amp;rarr;</code> for the arrow', 'wp-job-manager-field-editor')))), 'resume' => array(__('Resume', 'wp-job-manager-field-editor'), array(array('name' => 'jmfe_enable_resume_required_label', 'std' => '0', 'label' => __('Custom Required Label', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Use a custom label for required fields instead of optional fields.', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_resume_required_label', 'label' => __('Required Field Label', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => __('<small>(required)</small>', 'wp-job-manager-field-editor')), array('name' => 'jmfe_enable_resume_optional_label', 'std' => '0', 'label' => __('Custom Optional Label', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Use a custom label for optional fields instead of required fields. (default is optional)', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_resume_optional_label', 'label' => __('Optional Field Label', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => __('<small>(optional)</small>', 'wp-job-manager-field-editor')), array('name' => 'jmfe_enable_resume_submit_button', 'std' => '0', 'label' => __('Custom Submit Button', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Use a custom value for the submit button (on initial submit page)', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_resume_submit_button', 'label' => __('Submit Button Caption', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => __('Preview &rarr;', 'wp-job-manager-field-editor'), 'desc' => __('The default button is <code>Preview &rarr;</code>, use <code>&amp;rarr;</code> for the arrow', 'wp-job-manager-field-editor')))), 'recaptcha' => array(__('reCAPTCHA', 'wp-job-manager-field-editor'), array(array('name' => 'jmfe_recaptcha_site_key', 'label' => __('Site Key', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => '', 'desc' => sprintf(__('Required to use reCAPTCHA, you can get one from <a href="%s" target="_blank">Google</a>.', 'wp-job-manager-field-editor'), 'https://www.google.com/recaptcha/admin#list')), array('name' => 'jmfe_recaptcha_secret_key', 'label' => __('Secret Key', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => '', 'desc' => sprintf(__('Required to use reCAPTCHA, you can get one from <a href="%s" target="_blank">Google</a>.', 'wp-job-manager-field-editor'), 'https://www.google.com/recaptcha/admin#list')), array('name' => 'jmfe_recaptcha_label', 'label' => __('Label', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'std' => __("Are you human?", 'wp-job-manager-field-editor'), 'placeholder' => '', 'desc' => __('This value will be used as the label that shows next to the actual reCAPTCHA', 'wp-job-manager-field-editor')), array('name' => 'jmfe_recaptcha_enable_job', 'std' => '0', 'label' => sprintf(__('%s Submit Page', 'wp-job-manager-field-editor'), $job_singular), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => sprintf(__('If enabled, a reCAPTCHA form will be added to the bottom of the submit %1$s page. See the <a target="_blank" href="%2$s">WP Job Manager Documentation</a> page.', 'wp-job-manager-field-editor'), $job_singular, 'https://wpjobmanager.com/document/tutorial-adding-recaptcha-job-submission-form/'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_recaptcha_enable_resume', 'std' => '0', 'label' => __('Resume Submit Page', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => sprintf(__('If enabled, a reCAPTCHA form will be added to the bottom of the submit resume page. See the <a target="_blank" href="%s">WP Job Manager Documentation</a> page.', 'wp-job-manager-field-editor'), 'https://wpjobmanager.com/document/tutorial-adding-recaptcha-job-submission-form/'), 'type' => 'checkbox', 'attributes' => array()))), 'support' => array(__('Support', 'wp-job-manager-field-editor'), array(array('name' => 'jmfe_support', 'label' => '', 'type' => 'support'))), 'backup' => array(__('Backup', 'wp-job-manager-field-editor'), array(array('name' => 'jmfe_backup', 'caption' => __('Create Backup!', 'wp-job-manager-field-editor'), 'field_class' => 'button-primary', 'action' => 'create_backup', 'label' => __('Generate Backup', 'wp-job-manager-field-editor'), 'desc' => __('Generate and download a backup of all fields.', 'wp-job-manager-field-editor'), 'type' => 'backup'), array('name' => 'jmfe_import', 'caption' => __('Import Backup!', 'wp-job-manager-field-editor'), 'field_class' => 'button button-primary', 'href' => get_admin_url() . 'import.php?import=wordpress', 'label' => __('Import Backup', 'wp-job-manager-field-editor'), 'desc' => __('Import a previously generated backup for custom fields.  This uses the default WordPress import feature, if you do not see a file upload after clicking this button, make sure to import using WordPress importer.', 'wp-job-manager-field-editor'), 'type' => 'link'))), 'debug' => array(__('Debug', 'wp-job-manager-field-editor'), array(array('name' => 'jmfe_enable_bug_reporter', 'std' => '0', 'label' => __('Enable Bug Reporter', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Enable the bug report icon in the top right corner to submit bug reports', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_disable_license_deactivate', 'std' => '0', 'label' => __('License Deactivate', 'wp-job-manager-field-editor'), 'cb_label' => __('Disable', 'wp-job-manager-field-editor'), 'desc' => __('By default when you deactivate this plugin it will also deactivate/unregister your API/License Key.  With this setting checked your license will not be deactivated when you deactivate the plugin.', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_remove_all', 'caption' => __('I understand, remove all data!', 'wp-job-manager-field-editor'), 'field_class' => 'button-primary', 'action' => 'remove_all', 'label' => __('Remove All', 'wp-job-manager-field-editor'), 'desc' => __('This will remove all custom and customized field data!', 'wp-job-manager-field-editor'), 'type' => 'button'), array('name' => 'jmfe_purge_options', 'caption' => __('Purge Options!', 'wp-job-manager-field-editor'), 'field_class' => 'button-primary', 'action' => 'purge_options', 'label' => __('Purge Options', 'wp-job-manager-field-editor'), 'desc' => __('Older versions of this plugin saved option values for fields that do not require them. You can purge those values by clicking this button.', 'wp-job-manager-field-editor'), 'type' => 'button'), array('name' => 'jmfe_field_dump', 'std' => '0', 'label' => __('Field Data', 'wp-job-manager-field-editor'), 'type' => 'debug_dump'))), 'about' => array(__('About', 'wp-job-manager-field-editor'), array(array('name' => 'jmfe_about', 'label' => '', 'type' => 'about')))));
     if (!$this->fields()->wprm_active()) {
         unset($this->settings['resume']);
         unset($this->settings['recaptcha'][1][4]);
     }
 }
Example #4
0
 /**
  * Initialize Settings Array
  *
  *
  * @since 1.1.9
  *
  */
 function init_settings()
 {
     $job_singular = WP_Job_Manager_Field_Editor::get_job_post_label();
     $this->settings = apply_filters('job_manager_field_editor_settings', array('job' => array($job_singular, array(array('name' => 'jmfe_enable_required_label', 'std' => '0', 'label' => __('Custom Required Label', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Use a custom label for required fields instead of optional fields.', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_required_label', 'label' => __('Required Field Label', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => __('<small>(required)</small>', 'wp-job-manager-field-editor')), array('name' => 'jmfe_enable_optional_label', 'std' => '0', 'label' => __('Custom Optional Label', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Use a custom label for optional fields instead of required fields. (default is optional)', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_optional_label', 'label' => __('Optional Field Label', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => __('<small>(optional)</small>', 'wp-job-manager-field-editor')), array('name' => 'jmfe_enable_job_submit_button', 'std' => '0', 'label' => __('Custom Submit Button', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Use a custom value for the submit button (on initial submit page)', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_job_submit_button', 'label' => __('Submit Button Caption', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => __('Preview &rarr;', 'wp-job-manager-field-editor'), 'desc' => __('The default button is <code>Preview &rarr;</code>, use <code>&amp;rarr;</code> for the arrow', 'wp-job-manager-field-editor')))), 'resume' => array(__('Resume', 'wp-job-manager-field-editor'), array(array('name' => 'jmfe_enable_resume_required_label', 'std' => '0', 'label' => __('Custom Required Label', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Use a custom label for required fields instead of optional fields.', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_resume_required_label', 'label' => __('Required Field Label', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => __('<small>(required)</small>', 'wp-job-manager-field-editor')), array('name' => 'jmfe_enable_resume_optional_label', 'std' => '0', 'label' => __('Custom Optional Label', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Use a custom label for optional fields instead of required fields. (default is optional)', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_resume_optional_label', 'label' => __('Optional Field Label', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => __('<small>(optional)</small>', 'wp-job-manager-field-editor')), array('name' => 'jmfe_enable_resume_submit_button', 'std' => '0', 'label' => __('Custom Submit Button', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Use a custom value for the submit button (on initial submit page)', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_resume_submit_button', 'label' => __('Submit Button Caption', 'wp-job-manager-field-editor'), 'type' => 'textbox', 'placeholder' => __('Preview &rarr;', 'wp-job-manager-field-editor'), 'desc' => __('The default button is <code>Preview &rarr;</code>, use <code>&amp;rarr;</code> for the arrow', 'wp-job-manager-field-editor')))), 'support' => array(__('Support', 'wp-job-manager-field-editor'), array(array('name' => 'jmfe_support', 'label' => '', 'type' => 'support'))), 'backup' => array(__('Backup', 'wp-job-manager-field-editor'), array(array('name' => 'jmfe_backup', 'caption' => __('Create Backup!', 'wp-job-manager-field-editor'), 'class' => 'button-primary', 'action' => 'create_backup', 'label' => __('Generate Backup', 'wp-job-manager-field-editor'), 'desc' => __('Generate and download a backup of all fields.', 'wp-job-manager-field-editor'), 'type' => 'backup'), array('name' => 'jmfe_import', 'caption' => __('Import Backup!', 'wp-job-manager-field-editor'), 'class' => 'button button-primary', 'href' => get_admin_url() . 'import.php?import=wordpress', 'label' => __('Import Backup', 'wp-job-manager-field-editor'), 'desc' => __('Import a previously generated backup for custom fields.  This uses the default WordPress import feature, if you do not see a file upload after clicking this button, make sure to import using WordPress importer.', 'wp-job-manager-field-editor'), 'type' => 'link'))), 'debug' => array(__('Debug', 'wp-job-manager-field-editor'), array(array('name' => 'jmfe_enable_bug_reporter', 'std' => '0', 'label' => __('Enable Bug Reporter', 'wp-job-manager-field-editor'), 'cb_label' => __('Enable', 'wp-job-manager-field-editor'), 'desc' => __('Enable the bug report icon in the top right corner to submit bug reports', 'wp-job-manager-field-editor'), 'type' => 'checkbox', 'attributes' => array()), array('name' => 'jmfe_remove_all', 'caption' => __('I understand, remove all data!', 'wp-job-manager-field-editor'), 'class' => 'button-primary', 'action' => 'remove_all', 'label' => __('Remove All', 'wp-job-manager-field-editor'), 'desc' => __('This will remove all custom and customized field data!', 'wp-job-manager-field-editor'), 'type' => 'button'), array('name' => 'jmfe_purge_options', 'caption' => __('Purge Options!', 'wp-job-manager-field-editor'), 'class' => 'button-primary', 'action' => 'purge_options', 'label' => __('Purge Options', 'wp-job-manager-field-editor'), 'desc' => __('Older versions of this plugin saved option values for fields that do not require them. You can purge those values by clicking this button.', 'wp-job-manager-field-editor'), 'type' => 'button'), array('name' => 'jmfe_field_dump', 'std' => '0', 'label' => __('Field Data', 'wp-job-manager-field-editor'), 'type' => 'debug_dump'))), 'about' => array(__('About', 'wp-job-manager-field-editor'), array(array('name' => 'jmfe_about', 'label' => '', 'type' => 'about')))));
     if (!$this->fields()->wprm_active()) {
         unset($this->settings['resume']);
     }
 }