*/ class Applyonline_Admin { /** * The ID of this plugin. * * @since 1.0.0 * @access private * @var string $plugin_name The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. * * @since 1.0.0 * @access private * @var string $version The current version of this plugin. */ protected $version; /** * Initialize the class and set its properties. * * @since 1.0.0 * @param string $plugin_name The name of this plugin. * @param string $version The version of this plugin. */ public function __construct( $plugin_name, $version ) { $this->plugin_name = $plugin_name; $this->version = $version; // Hook - Applicant Listing - Column Name add_filter( 'manage_edit-aol_application_columns', array ( $this, 'applicants_list_columns' ) ); // Hook - Applicant Listing - Column Value add_action( 'manage_aol_application_posts_custom_column', array ( $this, 'applicants_list_columns_value' ), 10, 2 ); //Fix comments on application add_filter('comment_row_actions', array($this, 'comments_fix'), 10, 2); add_filter('post_row_actions',array($this, 'aol_post_row_actions'), 10, 2); //Filter Aplications based on parent. add_action( 'pre_get_posts', array($this, 'applications_filter') ); // Add Application data to the Application editor. add_action ( 'edit_form_after_title', array ( $this, 'aol_application_post_editor' ) ); //Application Print add_action('init', array($this, 'application_print')); add_filter( 'post_date_column_status', array($this, 'application_date_column'), 10, 2); $this->hooks_to_search_in_post_metas(); new Applyonline_MetaBoxes(); new Applyonline_Settings($version); } /** * Register the stylesheets for the admin area. * * @since 1.0.0 */ public function enqueue_styles() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Applyonline_Loader as all of the hooks are defined * in that particular class. * * The Applyonline_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/applyonline-admin.css', array(), $this->version, 'all' ); wp_enqueue_style($this->plugin_name.'um-admin-builder', plugin_dir_url(__FILE__).'css/builder/um-admin-builder.css', array( ), $this->version, 'all'); wp_enqueue_style($this->plugin_name.'um-admin-columns', plugin_dir_url(__FILE__).'css/builder/um-admin-columns.css', array( ), $this->version, 'all'); wp_enqueue_style($this->plugin_name.'um-admin-dashboard', plugin_dir_url(__FILE__).'css/builder/um-admin-dashboard.css', array( ), $this->version, 'all'); wp_enqueue_style($this->plugin_name.'um-admin-form', plugin_dir_url(__FILE__).'css/builder/um-admin-form.css', array( ), $this->version, 'all'); wp_enqueue_style($this->plugin_name.'um-admin-forms', plugin_dir_url(__FILE__).'css/builder/um-admin-forms.css', array( ), $this->version, 'all'); wp_enqueue_style($this->plugin_name.'um-admin-global', plugin_dir_url(__FILE__).'css/builder/um-admin-global.css', array( ), $this->version, 'all'); wp_enqueue_style($this->plugin_name.'um-admin-menu', plugin_dir_url(__FILE__).'css/builder/um-admin-menu.css', array( ), $this->version, 'all'); wp_enqueue_style($this->plugin_name.'um-admin-misc', plugin_dir_url(__FILE__).'css/builder/um-admin-misc.css', array( ), $this->version, 'all'); wp_enqueue_style($this->plugin_name.'um-admin-modal', plugin_dir_url(__FILE__).'css/builder/um-admin-modal.css', array( ), $this->version, 'all'); } /** * Register the JavaScript for the admin area. * * @since 1.0.0 */ public function enqueue_scripts() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Applyonline_Loader as all of the hooks are defined * in that particular class. * * The Applyonline_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ $localize['app_submission_message'] = 'Form has been submitted successfully. If required, we will get back to you shortly.'; $localize['app_closed_alert'] = 'We are no longer accepting applications for this ad.'; $localize['aol_required_fields_notice'] = 'Fields with (*) are compulsory.'; wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/applyonline-admin.js', array( 'jquery', 'jquery-ui-sortable' ), $this->version, false ); wp_enqueue_script($this->plugin_name.'_md5', plugin_dir_url(__FILE__).'js/md5.min.js', array( 'jquery' ), $this->version, false); wp_localize_script( $this->plugin_name, 'aol_admin', $localize ); } public function settings_notice(){ $notices = get_option('aol_dismissed_notices', array()); if(in_array('aol', $notices) OR !current_user_can('manage_options')) return; ?>

', '', '', ''); ?>

ID, '_aol_ad_closing_date', true); if($timestamp != null and $timestamp < time()){ $post_states['ad_closed'] = __( 'Closed' ); } return $post_states; } public function aol_ad_closing($post){ $types = get_aol_ad_types(); if( !in_array($post->post_type, $types)) return; $date = $closed_class = NULL; $close_type = get_post_meta($post->ID, '_aol_ad_close_type', true); $close_ad = ($close_type == 'ad' or empty($close_type)) ? 'checked': NULL; $close_form = ($close_type == 'form') ? 'checked': NULL; $timestamp = (int)get_post_meta($post->ID, '_aol_ad_closing_date', true); if(is_int($timestamp) and $timestamp != null){ $date = date('j-m-Y' ,sanitize_text_field($timestamp)); $closed_class = ($timestamp < time()) ? 'closed' : null; } ob_start(); ?>

Format: dd-mm-yyyy
Example:

When Expires:
/>     />

getTimestamp(); update_post_meta( $post_id, '_aol_ad_closing_date', $timestamp); //Add new value. } } update_post_meta( $post_id, '_aol_ad_close_type', $_POST['_aol_ad_close_type']); //Add new value. } function application_date_column($status, $post ){ if($post->post_type == 'aol_application') $status = 'Received'; return $status; } /** * Extend WordPress search to include custom fields * Join posts and postmeta tables * * http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join * * @since 1.6 */ function hooks_to_search_in_post_metas(){ add_filter('posts_join', array($this, 'cf_search_join' )); add_filter( 'posts_where', array($this, 'cf_search_where' )); add_filter( 'posts_distinct', array($this, 'cf_search_distinct' )); } function cf_search_join( $join ) { global $wpdb; if ( is_search() and is_admin() ) { $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id '; } return $join; } /** * Modify the search query with posts_where * * http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_where * * @since 1.6 */ function cf_search_where( $where ) { global $wpdb; if ( is_search() and is_admin() ) { $where = preg_replace( "/\(\s*".$wpdb->posts.".post_title\s+LIKE\s*(\'[^\']+\')\s*\)/", "(".$wpdb->posts.".post_title LIKE $1) OR (".$wpdb->postmeta.".meta_value LIKE $1)", $where ); } return $where; } /** * Prevent duplicates * * http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_distinct * * @since 1.6 */ function cf_search_distinct( $where ) { global $wpdb; if ( is_search() and is_admin() ) { return "DISTINCT"; } return $where; } /** * */ public function comments_fix($actions, $comment){ $post_id = $comment->comment_post_ID; if(get_post_field('post_type', $post_id) == 'aol_application'){ $author = get_user_by('email', $comment->comment_author_email ); if(get_current_user_id() != $author->ID) unset($actions['quickedit']); //if not comment author, dont show the quick edit unset($actions['unapprove']); unset($actions['trash']); unset($actions['edit']); } return $actions; } /** * Applicant Listing - Column Name * * @param array $columns * @access public * @return array */ public function applicants_list_columns( $columns ){ $columns = array ( 'cb' => '', 'title' => __( 'Ad Title', 'apply-online' ), 'applicant'=> __( 'Applicant', 'apply-online' ), 'taxonomy' => __( 'Tags', 'apply-online' ), 'date' => __( 'Date', 'apply-online' ), ); return $columns; } /** * Case in-sensitive array_search() with partial matches * * @param string $needle The string to search for. * @param array $haystack The array to search in. * * @author Bran van der Meer * @since 29-01-2010 */ function array_find($needle, array $haystack) { foreach ($haystack as $key => $value) { if (stripos($value, $needle) !== FALSE) { return $key; } } return false; } /** * Applicant Listing - Column Value * * @param array $columns * @param int $post_id * @access public * @return void */ public function applicants_list_columns_value( $column, $post_id ){ $keys = get_post_custom_keys( $post_id ); $values = get_post_meta($post_id); $new = array(); foreach($values as $key => $val){ $new[$key]=$val[0]; } $name = $this->array_find('name', $keys); switch ( $column ) { case 'applicant' : if($name === FALSE): $applicant_name = 'Undefined'; else: $applicant = get_post_meta( $post_id, $keys[ $name ], TRUE ); if(is_object($applicant)) $applicant = NULL; elseif(is_array($applicant)) $applicant = implode(',', $applicant); $applicant_name = sprintf( '%s', esc_url( add_query_arg( array ( 'post' => $post_id, 'action' => 'edit' ), 'post.php' ) ), esc_html( $applicant ) ); endif; echo $applicant_name; break; case 'taxonomy' : //$parent_id = wp_get_post_parent_id( $post_id ); // get_post_field ( 'post_parent', $post_id ); $terms = get_the_terms( $post_id, 'aol_application_status' ); if ( ! empty( $terms ) ) { $out = array (); foreach ( $terms as $term ) { $out[] = sprintf( '%s', esc_url( add_query_arg( array ( 'post_type' => 'aol_application', 'aol_application_status' => $term->slug ), 'edit.php' ) ), esc_html( sanitize_term_field( 'name', $term->name, $term->term_id, 'jobpost_category', 'display' ) ) ); } echo join( ', ', $out ); }/* If no terms were found, output a default message. */ else { _e( 'Undefined' , 'apply-online'); } break; } } public function aol_post_row_actions($actions, $post){ $types = get_aol_ad_types(); if($post->post_type == 'aol_application'){ $actions = array(); //Empty actions. $actions['filters'] = ''; $actions['ad'] = ''; $actions['view'] = ''; } elseif( in_array($post->post_type, $types) ){ $actions['test'] = 'Applications'; } return $actions; } public function applications_filter( $query ) { if ( $query->is_main_query() AND is_admin() AND isset($_GET['ad'])) { $query->set( 'post_parent', $_GET['ad'] ); } } public function application_print(){ if( current_user_can('edit_applications') AND isset($_GET['aol_page']) AND $_GET['aol_page'] == 'print' ){ $post = get_post($_GET['id']); $parent = get_post($post->post_parent); ?> Application <?php echo $_GET['id']; ?> - Apply online
#

post_title; ?>

post_date; ?>
Application

ID, $key, true ); //Escaping output. if(is_array($val)) $val = implode(', ', $val); $val = esc_textarea($val); if (!filter_var($val, FILTER_VALIDATE_URL) === false) $val = 'Attachment'; echo ''; } endforeach; ?>
' . str_replace ( '_', ' ', substr ( $key, 9 ) ) . '' . $val . '
post_type =='aol_application' ): $keys = get_post_custom_keys ( $post->ID ); ?>

ID, '_aol_attachment', true ); ?>    

ID, $key, true ); //Support to previuos versions where only URL was saved in the post meta. if (!filter_var($val, FILTER_VALIDATE_URL) === false) $val = 'View | Download'; elseif(is_array($val)){ //If the outputs is file attachment if(isset($val['url']) AND isset($val['type'])) $val = 'View | Download'; //If output is a radio or checkbox. else $val = implode(', ', $val); } echo ''; } endforeach; ?>
' . str_replace ( '_', ' ', substr ( $key, 9 ) ) . '' . $val . '

app_field_types = $this->app_field_types(); add_action( 'add_meta_boxes', array($this, 'aol_meta_boxes'),1 ); add_action('admin_menu', array($this, 'remove_submit_metabox')); add_action('aol_schedule_event', array($this, 'close_ad')); //keep this cron hook claing at top. add_action('post_submitbox_misc_actions', array($this, 'aol_metas')); add_action( 'save_post', array( $this, 'save_ad' ) ); add_action('save_post_aol_application', array($this, 'save_application')); add_action('do_meta_boxes', array($this, 'alter_metaboxes_on_application_page')); add_action( 'admin_enqueue_scripts', array($this, 'enqueue_date_picker') ); } function app_field_types(){ return array( 'text'=>'Text Field', 'number'=>'Number Field', 'text_area'=>'Text Area', 'email'=>'E Mail Field', 'date'=>'Date Field', 'checkbox'=>'Check Boxes', 'radio'=> 'Radio Buttons', 'dropdown'=>'Dropdown Options', 'file'=>'Attachment Field', //'seprator' => 'Seprator', //Deprecated since 1.9.6. Need to be fixed for older versions. 'separator' => 'Separator', 'paragraph' => 'Paragraph', ); } function save_application($post_id){ if ( wp_is_post_revision( $post_id ) ) return; // Check if this post is in default category if ( isset($_POST['aol_tag']) AND !empty($_POST['aol_tag'])) { $result = wp_set_post_terms( $post_id, $_POST['aol_tag'], 'aol_application_status' ); $term = get_term($result[0]); do_action('aol_application_status_change', $term, $post_id); } } function remove_submit_metabox(){ remove_meta_box( 'submitdiv', 'aol_application', 'side' ); } function close_ad($post_id){ update_post_meta($post_id, '_aol_closed', 0); } function enqueue_date_picker(){ wp_enqueue_script( 'jquery-ui-datepicker'); wp_enqueue_style('jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.min.css'); } public function alter_metaboxes_on_application_page(){ remove_meta_box('commentstatusdiv', 'aol_application', 'normal'); //Hide discussion meta box. } /** * Metaboxes for Ads Editor * * @since 1.0 */ function aol_meta_boxes($post) { $screens = array('aol_ad'); $types = get_option_fixed('aol_ad_types'); if(is_array($types)){ foreach ($types as $type){ $screens[] = 'aol_'.strtolower($type['singular']); } } if(empty($screens) or !is_array($screens)) $screens = array(); add_meta_box( 'aol_ad_metas', __( 'Ad Features', 'apply-online' ), array($this, 'ad_features'), $screens, 'advanced', 'high' ); add_meta_box( 'aol_ad_app_fields', __( 'Application Form Builder', 'apply-online' ), array($this, 'application_form_fields'), $screens, 'advanced', 'high' ); add_meta_box( 'aol_application', __( 'Application Details', 'apply-online' ), array($this, 'application_general'), 'aol_application', 'side' ); /* add_meta_box( 'aol_form_builder', __( 'New Application Form Builder', 'apply-online' ), array($this, 'application_form_builder'), $screens, 'advanced', 'high' ); * */ } function application_form_builder(){ ?>
Test
Date Picker
ID, 'aol_application_status'); $stauses = aol_app_statuses_active(); ?>

Print Application

post_type, $types)) return; echo '
'; echo '

Full ad shortcode

'; echo '

Form shortcode

'; echo '

View all Applications

'; do_action('aol_metabox_after', $post); echo '
'; } function ad_features( $post ) { // Add a nonce field so we can check for it later. wp_nonce_field( 'myplugin_adpost_meta_awesome_box', 'adpost_meta_box_nonce' ); /* * Use get_post_meta() to retrieve an existing value * from the database and use the value for the form. */ ?>
    ID); if($keys != NULL): foreach($keys as $key): if(substr($key, 0, 13)=='_aol_feature_'){ $val=get_post_meta($post->ID, $key, TRUE); echo '
  1. '; echo '  
    Delete
  2. '; } endforeach; endif; ?>
Add Feature
Add Field
ID); } else{ $fields = get_option('aol_default_fields', array()); } foreach($fields as $key => $val): $label = isset($val['label']) ? $val['label'] : str_replace('_',' ',substr($key,9)); // if($val['type']=='seprator') $val['type'] = 'separator'; //Fixed bug before 1.9.6, spell mistake in the key. if(!isset($val['required'])) $val['required'] = 1; $req_class = ($val['required'] == 0) ? 'button-disabled': null; $fields = NULL; foreach($this->app_field_types as $field_key => $field_val){ if($val['type'] == $field_key) $fields .= ''; else $fields .= ''; } $req_class .= ($val['type'] == 'separator' OR $val['type'] == 'paragraph') ? ' button-disabled' : ' toggle-required'; //if($key.'[type]'=='text'){ echo ''; echo ''; echo ''; //} endforeach; do_action('aol_after_form_builder', $post); ?>
'; echo ''; echo ''; echo '
Required
'; echo ''; //if(!($val['type']=='text' or $val['type']=='email' or $val['type']=='date' or $val['type']=='text_area' or $val['type']=='file' )): if(in_array($val['type'], array('checkbox','dropdown','radio'))): echo ''; else: echo ''; endif; echo '  
Delete
'; echo '
application_fields_generator($this->app_field_types); do_action('aol_after_form_builder', $post); } /** * Save the meta when the post is saved. * * @param int $post_id The ID of the post being saved. */ function save_ad( $post_id ) { /* * We need to verify this came from our screen and with proper authorization, * because the save_post action can be triggered at other times. */ // Check if our nonce is set. if ( ! isset( $_POST['adpost_meta_box_nonce'] ) ) { return; } // Verify that the nonce is valid. if ( ! wp_verify_nonce( $_POST['adpost_meta_box_nonce'], 'myplugin_adpost_meta_awesome_box' ) ) { return; } /* OK, it's safe for us to save the data now. */ $types = get_aol_ad_types(); if ( !in_array($_POST['post_type'], $types) ) return; //Delete fields. $old_keys = (array)get_post_custom_keys($post_id); $new_keys = array_keys($_POST); $removed_keys = array_diff($old_keys, $new_keys); //List of removed meta keys. foreach($removed_keys as $key => $val): if(substr($val, 0, 13) == '_aol_feature_' OR substr($val, 0, 9) == '_aol_app_'){ delete_post_meta($post_id, $val); //Remove meta from the db. } endforeach; // $existing_keys = array_diff($old_keys, $removed_keys); //List of removed meta keys. UNUSED // Add/update new value. $fields_order = array(); foreach ($_POST as $key => $val): // Make sure that it is set. if ( substr($key, 0, 13)=='_aol_feature_' and isset( $val ) ) { //Sanitize user input. $my_data = sanitize_text_field( $val ); update_post_meta( $post_id, $key, $my_data); // Add new value. } // Make sure that it is set. elseif ( substr($key, 0, 9) == '_aol_app_' and isset( $val ) ) { //$my_data = serialize($val); if(in_array($val['type'], array('separator', 'seprator', 'paragraph'))) $val['required'] = 0; $val['options'] = explode(',', $val['options']); $val['options'] = implode(',', array_map('trim',$val['options'])); /*END - Remove white spaces */ update_post_meta( $post_id, $key, $val); // Add new value. $fields_order[] = $key; } // endforeach; update_post_meta( $post_id, '_aol_fields_order', $fields_order); // Add new value. } function ismd5($md5 ='') { return strlen($md5) == 32 && ctype_xdigit($md5); } } class Applyonline_Updater{ function db_updater(){ global $wpdb; //$rows = $wpdb->get_results( "SELECT * FROM $wpdb->postmeta WHERE meta_key = '_aol_app_%' AND meta_value != ".'%"label"%' ); } } /** * This class contains all nuts and bolts of plugin settings. * * * @since 1.3 * @package Applyonline_settings * @author Farhan Noor **/ class Applyonline_Settings extends Applyonline_MetaBoxes{ private $version; public function __construct($version) { //parent::__construct(); //Acitvating Parent's constructor $this->version = $version; //Registering Submenus. add_action('admin_menu', array($this, 'sub_menus')); //Registering Settings. add_action( 'admin_init', array($this, 'registers_settings') ); add_filter( 'plugin_row_meta', array($this, 'plugin_row_meta'), 10, 2 ); //Manageing AOL role capabilites. add_filter( "option_page_capability_aol_settings_group", 'aol_manager_capability' ); add_filter( "option_page_capability_aol_ad_template", 'aol_manager_capability' ); add_filter( "option_page_capability_aol_ads", 'aol_manager_capability' ); add_filter( "option_page_capability_aol_applications", 'aol_manager_capability' ); } public function plugin_row_meta($links, $file){ if ( strpos( $file, 'apply-online.php' ) !== false ) { $links['settings'] = 'Settings'; } return $links; } public function sub_menus(){ add_menu_page( __('Settings', 'apply-online'), _x('Apply Online', 'admin', 'apply-online'), 'edit_applications', 'aol-settings', array($this, 'settings_page_callback'), 'dashicons-admin-site',31 ); add_submenu_page('aol-settings', __('Settings', 'apply-online'), __('Settings', 'apply-online'), 'delete_others_ads', 'aol-settings'); $filters = aol_ad_filters(); foreach($filters as $key => $val){ add_submenu_page( 'aol-settings', '', sprintf(__('%s Filter', 'apply-online'), $val), 'delete_others_ads', "edit-tags.php?taxonomy=aol_ad_".sanitize_key($key)."&post_type=aol_ad", null ); } } function save_settings(){ if(!current_user_can('edit_applications')) return; if ( !empty( $_POST['aol_default_app_fields'] ) && check_admin_referer( 'aol_awesome_pretty_nonce','aol_default_app_fields' ) ) { //Remove unnecessary fields foreach($_POST as $key => $val){ if(substr($key, 0, 4) != '_aol') unset($_POST[$key]); } //Save aol default fields in DB. update_option('aol_default_fields', $_POST); } } public function settings_page_callback(){ $this->save_settings(); $tabs = $tabs = json_decode(json_encode($this->settings_api()), FALSE); ob_start(); ?>

version version; ?>

id; echo '
'; if(isset($tab->name)) echo '

'.$tab->name.'

'; if(isset($tab->desc)) echo '

'.$tab->desc.'

'; echo isset($tab->output) ? $tab->output : $this->$func(); //Return $output or related method of the same variable name. echo '
'; } ?>
'integer', 'default' => 1, 'sanitize_callback' => 'intval') ); register_setting( 'aol_settings_group', 'aol_upload_folder', array('sanitize_callback' => 'sanitize_text_field') ); register_setting( 'aol_settings_group', 'aol_allowed_file_types', array('sanitize_callback' => 'sanitize_text_field') ); register_setting( 'aol_ad_template', 'aol_default_fields'); register_setting( 'aol_ads', 'aol_ad_types', array('sanitize_callback' => 'aol_sanitize_filters') ); register_setting( 'aol_ads', 'aol_ad_filters', array('sanitize_callback' => 'aol_array_check') ); register_setting( 'aol_applications', 'aol_app_statuses', array('default' => array())); //On update of aol_slug field, update permalink too. add_action('update_option_aol_slug', array($this, 'refresh_permalink')); add_action('update_option_aol_ad_types', array($this, 'refresh_types_permalink'), 10, 3); } public function refresh_permalink(){ //Re register post type for proper Flush Rules. $slug = get_option_fixed('aol_slug', 'ads'); /*Register Main Post Type*/ register_post_type('aol_ad', array('has_archive' => true, 'rewrite' => array('slug'=> $slug))); flush_rewrite_rules(); } function register_cpts_for_flushing($cpt, $plural){ $result = register_post_type('aol_'.$cpt, array( 'has_archive' => true, 'public' => true, 'rewrite' => array('slug' => sanitize_key($plural)), )); } function refresh_types_permalink($old, $new, $option){ wp_cache_delete ( 'alloptions', 'options' ); foreach($new as $cpt => $val){ $this->register_cpts_for_flushing($cpt, $val['plural']); } flush_rewrite_rules(); } function settings_api(){ $tabs = array( 'general' => array( 'id' => 'general', 'name' => __( 'General' ,'apply-online' ), 'desc' => __( 'General settings of the plugin', 'apply-online' ), 'href' => null, 'classes' => 'nav-tab-active', ), 'template' => array( 'id' => 'template', 'name' => __('Template' ,'apply-online'), 'desc' => __( 'Application form template for new ads.', 'apply-online' ), 'href' => null, ), 'applications' => array( 'id' => 'applications', 'name' => __('Applications' ,'apply-online'), 'desc' => __( 'Add status to each application you have received.', 'apply-online' ), 'href' => null, ), 'types' => array( 'id' => 'types', 'name' => __('Ad Types' ,'apply-online'), 'desc' => __( 'Define different types of ads e.g. Careers, Classes, Memberships. These types will appear under All Ads section.', 'apply-online' ), 'href' => null, ), /*'labels' => array( 'id' => 'labels', 'name' => __('Labels' ,'apply-online'), 'desc' => __( 'Modify labels on front-end.', 'apply-online' ), 'href' => null, ),*/ ); $tabs = apply_filters('aol_settings_tabs', $tabs); $tabs['faqs'] = array( 'id' => 'faqs', 'name' => __('FAQs' ,'apply-online'), 'desc' => __('Frequently Asked Questions.' ,'apply-online'), 'href' => null, ); $tabs['extend'] = array( 'id' => 'extend', 'name' => __('Extend' ,'apply-online'), 'desc' => __('Extend Plugin' ,'apply-online'), 'href' => 'http://wpreloaded.com/plugins/apply-online', 'capability' => 'manage_options' ); return $tabs; } private function wp_pages(){ $pages = get_pages(); $pages_arr = array(); foreach ( $pages as $page ) { $pages_arr[$page->ID] = $page->post_title; } return $pages_arr; } private function tab_general(){ ?>

Just one email id in one line.




Update format on Wordpress General Settings Page.

This option doesn't work with Plain permalinks structure. Check Permalink Settings

MBs

MBs

jpg,jpeg,png,doc,docx,pdf,rtf,odt,txt

app_field_types(); settings_fields( 'aol_ad_template' ); do_settings_sections( 'aol_ad_template' ); $keys= get_option('aol_default_fields'); if($keys != NULL): foreach($keys as $key => $val): if(substr($key, 0, 9)=='_aol_app_'): $fields = NULL; foreach($app_fields as $field_key => $field_val){ if($val['type']==$field_key) $fields .= ''; else $fields .= ''; } //if($key.'[type]'=='text'){ echo ''; //} endif; endforeach; endif; ?>
'; if(!($val['type']=='text' or $val['type']=='email' or $val['type']=='date' or $val['type']=='text_area' or $val['type']=='file' or $val['type']=='separator' or $val['type']=='paragraph')): echo ''; else: echo ''; endif; echo '  
Delete
application_fields_generator($this->app_field_types()); ?>
  1. Ad (Ads)

    Direct URL: '.get_post_type_archive_link( 'aol_ad' ).'

    '; echo ''; echo ''; $this->filters($types['ad']['filters'], 'ad'); ?>
  2. $type): $count = wp_count_posts('aol_'.sanitize_key($type['singular'])); echo '
  3. '.sanitize_text_field( $type['singular'] ) .' ('. sanitize_text_field( $type['plural'] ) .') - '. sanitize_text_field( $type['description'] ) .'

    '; echo '

    Shortcode:

    '; echo '

    Direct URL: '.get_post_type_archive_link( 'aol_'.$key ).'

    '; echo ''; echo ''; $this->filters($type['filters'], $key); /*if(($count->publish) == 0)*/ echo '  
  4. '; endforeach; endif; ?>
Add Type

IMPORTANT: If you get 404 error on direct links, try saving this section once again. Filters are used to narrow down ads listing on front-end and work with [aol] shortcode only.

Need more customized filters? Click here.


/> />
    $val){ if($i >= 3) break; $checked = in_array(sanitize_key($key), $set_filters) ? 'checked' : NULL; echo '
  • '; $i++; } ?>

Need more customized filters? Click Here


    $val){ $checked = in_array(sanitize_key($key), $set_filters) ? 'checked' : NULL; echo '
  • '; $i++; } ?>

Need more customized statuses? Click Here


In your WordPress admin panel, go to "All Ads" menu with globe icon and add a new ad listing here.

How to show ad listings on the front-end?

You may choose either option.
  1. Write [aol] shortcode in an existing page or add a new page and write shortcode anywhere in the page editor. Now click on VIEW to see all of your ads on front-end.
  2. The url lists all the applications using your theme's default look and feel.
        (If above not working, try saving permalinks without any change)

I have a very long application form to fill, how can i facilitate applicant to fill it conveniently?

With Application Tracking System extention, applicant can save/update incomplete form for multiple times before final submission.

Can I show selected ads on front-end?

Yes, you can show any number of ads on your website by using shortcode with "ads" attribute. Ad ids must be separated with commas i.e. [aol ads="1,2,3" type="ad"]. Default type is "ad".

Can I show ads without excerpt/summary?

Yes, use shortcode with "excerpt" attribute i.e. [aol excerpt="no"]

What attributes can i use in the shortcode?

Shortcode with default attributes is [aol ads="1,2,3" excerpt="yes" type="ad"]. Use only required attributes.

Can I display application form only using shortocode?

Yes, [aol_form id="0"] is the shortcode to display a particular application form in WordPress pages or posts. Use correct form id in the shortocode.

Filters under ApplyOnline section are not accessible.

Try deactivating & then reactivating this plugin.

I Have enabled the filters but they are not visible on the 'ads' page.

Possible reasons for not displaying ad filters are given as under:
  1. Filters are visible when you show your ad on front-end using [aol] shortcode only.
  2. Make sure Filters are enabled under Apply Online/Settings/Ad Types section in wordpress Admin Panel.
  3. When you create an ad, there is an option to categorize that ad under each filter e.g. Types or Locations.

Ads archive page on front-end shows 404 error or Nothing Found.

Try saving permalinks without any change.

I am facing a different problem. I may need a new feature in the plugin.

Please contact us through plugin's website for more information.

Looking for more options?

There's a range of ApplyOnline extensions available to put additional power in your hands. Click Here for docs and extensions.