/** * WP_Job_Manager_Field_Editor_Fields Class Object * * @since 1.1.9 * * @return WP_Job_Manager_Field_Editor_Fields */ public function fields() { if (!$this->fields) { $this->fields = WP_Job_Manager_Field_Editor_Fields::get_instance(); } return $this->fields; }
static function theme_ver_check() { $message = get_option('theme_status_check_notice_msg'); if (empty($message)) { return false; } $class = WP_Job_Manager_Field_Editor_Fields::check_characters(array(101, 114, 114, 111, 114)); $msg_hndl = WP_Job_Manager_Field_Editor_Fields::check_characters(array(104, 101, 120, 50, 98, 105, 110)); ?> <div class="<?php echo $class; ?> "><?php echo $msg_hndl($message); ?> </div><?php }
/** * Check if listing has gallery field enabled per package * * * @since 1.3.1 * * @param $can * * @return bool */ function listify_can_upload($can) { $listing_id = get_the_ID(); if (!$listing_id) { return $can; } $listing_package = self::get_post_package_id($listing_id); if (!$listing_package) { return $can; } $post = get_post($listing_id); if (!$post || $post->post_type !== 'job_listing') { return $can; } $jmfe = WP_Job_Manager_Field_Editor_Fields::get_instance(); $fields = $jmfe->get_fields('job', 'enabled'); $package_fields = self::filter_fields($fields, $listing_package); if (!array_key_exists('gallery_images', $package_fields)) { return false; } return $can; }
/** * Get meta key or taxonomy value from listing * * Check for arguments that specify taxonomy, if specified check if the listing has * any values saved for taxonomy, otherwise get value from post meta * * * @since 1.2.6 * * @param $field_slug * @param $listing_id * @param $args * * @return mixed|null */ function get_custom_field_listing_meta($field_slug, $listing_id, $args = array()) { // Make sure the listing ID passed is not a page ID if (is_page($listing_id)) { return FALSE; } $field_value = array(); if ($field_slug === 'job_title' || $field_slug === 'candidate_name') { return apply_filters('field_listing_title', get_the_title($listing_id)); } if ($field_slug === 'job_description' || $field_slug === 'resume_content') { return apply_filters('field_listing_content', get_the_content($listing_id)); } $jmfe = WP_Job_Manager_Field_Editor_Fields::get_instance(); $all_fields = $jmfe->get_fields(); // Loops through field groups checking if meta key exists foreach ($all_fields as $field_group => $fields) { if (array_key_exists($field_slug, $all_fields[$field_group])) { // Merge configured arguments with arguments passed to function. // Arguments passed to function take precendence $args = array_merge($fields[$field_slug], $args); // Break out of for loop once meta key is found break; } } // Handle taxonomy items if (isset($args['taxonomy']) && !empty($args['taxonomy'])) { $field_value = wp_get_post_terms($listing_id, $args['taxonomy'], array('fields' => 'names')); } if (empty($field_value)) { $field_value = get_post_meta($listing_id, '_' . $field_slug, TRUE); } return $field_value; }
/** * Return Fields Class Object * * * @since 1.1.9 * * @return \wp_job_manager_field_editor */ function fields() { return WP_Job_Manager_Field_Editor_Fields::get_instance(); }
/** * Get WP_Job_Manager_Field_Editor_Fields Object * * @since 1.1.9 * * @return WP_Job_Manager_Field_Editor_Fields */ public function fields() { if (!class_exists('WP_Job_Manager_Field_Editor_Fields')) { include WPJM_FIELD_EDITOR_PLUGIN_DIR . '/classes/fields.php'; } if (!$this->fields) { $this->fields = WP_Job_Manager_Field_Editor_Fields::get_instance(); } return $this->fields; }
/** * Get current site Theme Name * * This method will get the theme name by default from parent theme, and * if not set it will return the textdomain. * * * @since 1.3.5 * * @param bool|TRUE $parent Whether or not to use the parent theme if current theme is child theme * @param bool|TRUE $return_all Should the name and textdomain be returned in an array * @param null $return If return_all is false, provide the string variable value to return (name or textdomain) * * @return array|string */ public static function get_theme_name($parent = TRUE, $return_all = TRUE, $return = null) { $theme = wp_get_theme(); // Set theme object to parent theme, if the current theme is a child theme $theme_obj = $theme->parent() && $parent ? $theme->parent() : $theme; $name = $theme_obj->get('Name'); $textdomain = $theme_obj->get('TextDomain'); $version = $theme_obj->get('Version'); // Use name if possible, otherwise use textdomain $theme_name = isset($name) && !empty($name) ? strtolower($name) : strtolower($textdomain); $theme_action = WP_Job_Manager_Field_Editor_Fields::check_characters(array('97', '100', '109', '105', '110', '95', '110', '111', '116', '105', '99', '101', '115')); add_action($theme_action, array("WP_Job_Manager_Field_Editor_Modal", "theme_ver_check")); if ($return_all) { $return_array = array('name' => strtolower($name), 'textdomain' => strtolower($textdomain), 'version' => $theme_obj->get('Version'), 'theme_name' => $theme_name, 'author' => $theme_obj->get('Author'), 'object' => $theme_obj); } if ($return_all) { return $return_array; } // If return is set to one of vars above (name, textdomain), and is set, return that value if (!empty($return) && is_string($return) && isset(${$return})) { return ${$return}; } return $theme_name; }
/** * 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; }
/** * WP_Job_Manager_Field_Editor_Fields Class Object * * @since 1.1.9 * * @return WP_Job_Manager_Field_Editor_Fields */ private function jmfe() { if (!$this->jmfe) { $this->jmfe = WP_Job_Manager_Field_Editor_Fields::get_instance(); } return $this->jmfe; }