/** * Init form */ public static function init() { add_action('wp', array(__CLASS__, 'process')); // Get step/job self::$step = !empty($_REQUEST['step']) ? max(absint($_REQUEST['step']), 0) : 0; $register = jobify_find_page_with_shortcode(array('jobify_register_form', 'register_form')); $register = get_post($register); self::$action = get_permalink($register->ID); self::$steps = (array) apply_filters('register_form_steps', array('submit' => array('name' => __('Register', 'jobify'), 'view' => array(__CLASS__, 'submit'), 'handler' => array(__CLASS__, 'submit_handler'), 'priority' => 10))); usort(self::$steps, array(__CLASS__, 'sort_by_priority')); }
/** * Append modal boxes to the bottom of the the page that * will pop up when certain links are clicked. * * Login/Register pages must be set in EDD settings for this to work. * * @since Jobify 1.0 * * @return void */ function jobify_inline_modals() { if (!jobify_is_job_board()) { return; } $login = jobify_find_page_with_shortcode(array('jobify_login_form', 'login_form')); if (0 != $login) { get_template_part('modal', 'login'); } $register = jobify_find_page_with_shortcode(array('jobify_register_form', 'register_form')); if (0 != $register) { get_template_part('modal', 'register'); } }
/** * Job/Resume login page. * * @since Jobify 1.0 * * @return void */ function form_login_url($url) { $page = jobify_find_page_with_shortcode(array('jobify_login_form', 'login_form')); if (!$page) { return $url; } return get_permalink($page); }
<?php /** * Register * * @package Jobify * @since Jobify 1.0 */ $register = jobify_find_page_with_shortcode(array('jobify_register_form', 'register_form')); $register = get_post($register); ?> <div id="register-modal-wrap" class="modal-register modal"> <h2 class="modal-title"><?php echo esc_attr($register->post_title); ?> </h2> <?php echo do_shortcode(get_post_field('post_content', $register->ID)); ?> </div>
echo $field['label'] . ($field['required'] ? '' : ' <small>' . __('(optional)', 'jobify') . '</small>'); ?> </label> <div class="field"> <?php get_job_manager_template('form-fields/' . $field['type'] . '-field.php', array('key' => $key, 'field' => $field)); ?> </div> </fieldset> <?php } } ?> <p class="has-account" id="login-modal"><i class="icon-help-circled"></i> <?php printf(__('Already have an account? <a href="%s">Login</a>', 'jobify'), get_permalink(jobify_find_page_with_shortcode(array('login_form', 'jobify_login_form')))); ?> </p> <p class="register-submit"> <?php wp_nonce_field('register_form_posted'); ?> <input type="hidden" name="job_manager_form" value="<?php echo $form; ?> " /> <input type="submit" name="submit_register" class="button button-medium" value="<?php echo esc_attr($submit_button_text); ?> " />
<?php /** * login * * @package Jobify * @since Jobify 1.0 */ $login = jobify_find_page_with_shortcode(array('jobify_login_form', 'login_form')); $login = get_post($login); ?> <div id="login-modal-wrap" class="modal-login modal"> <h2 class="modal-title"><?php echo esc_attr($login->post_title); ?> </h2> <?php echo do_shortcode(get_post_field('post_content', $login->ID)); ?> </div>
/** * widget function. * * @see WP_Widget * @access public * @param array $args * @param array $instance * @return void */ function widget($args, $instance) { if ($this->get_cached_widget($args)) { return; } ob_start(); extract($args); $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); $description = $instance['description']; $levels = rcp_get_subscription_levels('active'); if (!$levels) { return; } $content = ob_get_clean(); echo $before_widget; ?> <div class="container"> <?php if ($title) { echo $before_title . $title . $after_title; } ?> <?php if ($description) { ?> <p class="homepage-widget-description"><?php echo $description; ?> </p> <?php } ?> <div class="job-packages row"> <?php foreach ($levels as $key => $level) { ?> <?php if (rcp_show_subscription_level($level->id)) { ?> <div class="col-lg-4 col-md-6 col-sm-12 pricing-table-widget-wrapper"> <div class="pricing-table-widget rcp_subscription_level rcp_subscription_level_fake" data-href="<?php echo esc_url(get_permalink(jobify_find_page_with_shortcode(array('register_form')))); ?> "> <div class="pricing-table-widget-title"> <span class="rcp_subscription_level_name"><?php echo stripslashes($level->name); ?> </span> </div> <div class="pricing-table-widget-description"> <h2> <span class="rcp_price" rel="<?php echo esc_attr($level->price); ?> "> <?php if ($level->fee) { ?> <?php $adjusted_price = $level->price + $level->fee; ?> <?php echo $adjusted_price > 0 ? rcp_currency_filter($adjusted_price) : __('free', 'jobify'); ?> </h2> <small> <?php $promo_duration = sprintf(_n('%2$s', '%1$s %2$ss', $level->duration, 'jobify'), $level->duration, $level->duration_unit); ?> <?php printf(__('* %s after first %s', 'jobify'), rcp_currency_filter($level->price), $promo_duration); ?> </small> <?php } else { ?> <?php $adjusted_price = $level->price; ?> <?php echo $adjusted_price > 0 ? rcp_currency_filter($adjusted_price) : __('free', 'jobify'); ?> </h2> <?php } ?> </span> </h2> <p><span class="rcp_level_duration"><?php echo $level->duration > 0 ? $level->duration . ' ' . rcp_filter_duration_unit($level->duration_unit, $level->duration) : __('unlimited', 'jobify'); ?> </span></p> <?php echo wpautop(wp_kses(stripslashes($level->description), rcp_allowed_html_tags())); ?> <p><a href="#" class="rcp-select button"><?php _e('Get Started', 'jobify'); ?> </a></p> </div> </div> </div> <?php } ?> <?php } ?> </div> </div> <?php echo $after_widget; echo $content; $this->cache_widget($args, $content); }
/** * widget function. * * @see WP_Widget * @access public * @param array $args * @param array $instance * @return void */ function widget($args, $instance) { if ($this->get_cached_widget($args)) { return; } ob_start(); extract($args); $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); $description = $instance['description']; $levels = rcp_get_subscription_levels('active'); if (!$levels) { return; } $content = ob_get_clean(); echo $before_widget; ?> <div class="container"> <?php if ($title) { echo $before_title . $title . $after_title; } ?> <?php if ($description) { ?> <p class="homepage-widget-description"><?php echo $description; ?> </p> <?php } ?> <div class="pricing-table-widget-<?php echo count($levels); ?> "> <?php foreach ($levels as $key => $level) { ?> <?php if (rcp_show_subscription_level($level->id)) { ?> <div id="rcp_subscription_level_<?php echo $level->id; ?> " class="pricing-table-widget rcp_subscription_level_fake" data-href="<?php echo esc_url(get_permalink(jobify_find_page_with_shortcode(array('register_form')))); ?> "> <div class="pricing-table-widget-title" style="background-color: #01da90"> <span class="rcp_subscription_level_name"><?php echo stripslashes($level->name); ?> </span> </div> <div class="pricing-table-widget-description"> <h2><span class="rcp_price" rel="<?php echo esc_attr($level->price); ?> "><?php echo $level->price > 0 ? rcp_currency_filter($level->price) : __('free', 'jobify'); ?> </h2> <p><span class="rcp_level_duration"><?php echo $level->duration > 0 ? $level->duration . ' ' . rcp_filter_duration_unit($level->duration_unit, $level->duration) : __('unlimited', 'jobify'); ?> </span></p> <?php echo wpautop(wp_kses($level->description, rcp_allowed_html_tags())); ?> </div> </div> <?php } ?> <?php } ?> </div> </div> <?php echo $after_widget; echo $content; $this->cache_widget($args, $content); }
function jobify_authenticate_username_password($user, $username, $password) { if (is_a($user, 'WP_User')) { return $user; } if (empty($username) || empty($password)) { $page = jobify_find_page_with_shortcode(array('jobify_login_form', 'login_form')); $page = get_permalink($page); wp_redirect($page); exit; } }
function jobify_submit_job_form_logout_url($url) { $page = jobify_find_page_with_shortcode(array('jobify_login_form', 'login_form')); return get_permalink($page); }