public function indeed_job_search($atts) { $settings = jobify_settings(); $publisher_id = !empty($settings['publisher_id']) ? $settings['publisher_id'] : '9769494768160125'; $type = !empty($atts['type']) ? $atts['type'] : 'all-in-one'; ob_start(); switch ($type) { case 'all-in-one': ?> <form action='https://www.indeed.com/jobs' METHOD='GET'> <input type="hidden" name="indpubnum" value="<?php echo $publisher_id; ?> "> <table cellspacing='0' style='font-family:arial'> <tr><td style='font-size:16px;color:#F60'><b><?php echo _e('Job Search', 'jobify'); ?> </b></td><td> </td></tr> <tr> <td><input name='q' value='' size='25'></td> <td><input type='submit' value='<?php echo esc_attr(__('Find Jobs', 'jobify')); ?> '/></td> </tr> <tr> <td valign='top' style='font-size:10px'><?php _e('job title, keywords, company, location', 'jobify'); ?> </td> <td colspan='1' valign='top' style='font-size:13px;'> <span id=indeed_at> <a href="https://www.indeed.com/?indpubnum=<?php echo $publisher_id; ?> " style="text-decoration:none; color: #000"><?php _e('jobs by', 'jobify'); ?> </a> <a href="https://www.indeed.com/?indpubnum=<?php echo $publisher_id; ?> " title=Job Search> <img src="https://www.indeed.com/p/jobsearch.gif" style="border: 0;vertical-align: middle;" alt="job search"> </a> </span> </td> </tr> </table> </form> <?php break; } return ob_get_clean(); }
public function load_settings() { // Retrieve the settings. $settings = jobify_settings(); foreach ($this->default_settings as $key => $val) { if (!isset($settings[$key])) { if (is_bool($val)) { $settings[$key] = 0; } else { $settings[$key] = $val; } } } $this->settings = $settings; }
<?php /** * Include the Careerjet's PHP API * * @since 1.4.0 */ require_once JOBIFY_ROOT . 'src' . DIRECTORY_SEPARATOR . 'Careerjet_API.php'; jobify_addAPI(array('key' => 'careerjet', 'title' => __('Careerjet', 'jobify'), 'logo' => plugins_url('img/careerjet.jpg', JOBIFY_PLUGIN), 'requirements' => array('geolocation' => __('Supports geolocation if enabled.', 'jobify')), 'getJobs' => function ($args) { // Create the returned jobs array $jobs = array(); // Get Jobify settings $settings = jobify_settings(); // Set the Careerjet affiliate ID $careerjet_api_key = !empty($settings['careerjet_api_key']) ? $settings['careerjet_api_key'] : 'b4a44bbbcaa7fe6bfd6039d1e864294e'; // Set the Careerjet locale $careerjet_locale = !empty($args['careerjet_locale']) ? $args['careerjet_locale'] : 'en_US'; // Check cache for results $results = wp_cache_get('jobs-careerjet-' . jobify_string($args), 'jobify'); if (false === $results) { // Query the Careerjet PHP API $careerjet = new Careerjet_API($careerjet_locale); $params = array('page' => 1, 'affid' => $careerjet_api_key); $params['keywords'] = !empty($args['keyword']) ? $args['keyword'] : ''; // Location if (!empty($args['lat']) && !empty($args['lng'])) { $location = jobify_get_location($args['lat'] . ',' . $args['lng']); if (count($location) > 0) { $params['location'] = $location[3]; } } elseif (!empty($args['location'])) {