Last active
April 11, 2022 07:01
-
-
Save awsm-support/6b5d9875c11883636164c43e1ce9209c to your computer and use it in GitHub Desktop.
WP Job Openings - Custom Application Status (Pro)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function awsm_jobs_pro_custom_application_status( $status ) { | |
$status['interviewed'] = array( | |
'label' => _x( 'Interviewed', 'post status', 'pro-pack-for-wp-job-openings' ), | |
'label_count' => _n_noop( 'Interviewed <span>(%s)</span>', 'Interviewed <span>(%s)</span>', 'pro-pack-for-wp-job-openings' ), | |
); | |
$status['offered'] = array( | |
'label' => _x( 'Offered', 'post status', 'pro-pack-for-wp-job-openings' ), | |
'label_count' => _n_noop( 'Offered <span>(%s)</span>', 'Offered <span>(%s)</span>', 'pro-pack-for-wp-job-openings' ), | |
); | |
$status['hired'] = array( | |
'label' => _x( 'Hired', 'post status', 'pro-pack-for-wp-job-openings' ), | |
'label_count' => _n_noop( 'Hired <span>(%s)</span>', 'Hired <span>(%s)</span>', 'pro-pack-for-wp-job-openings' ), | |
); | |
return $status; | |
} | |
add_filter( 'awsm_jobs_pro_application_status', 'awsm_jobs_pro_custom_application_status' ); | |
function awsm_jobs_overview_applications_by_status_data( $chart_data, $applications_count ) { | |
$chart_data['labels'] = array_merge( $chart_data['labels'], array( _x( 'Interviewed', 'post status', 'pro-pack-for-wp-job-openings' ), _x( 'Offered', 'post status', 'pro-pack-for-wp-job-openings' ), _x( 'Hired', 'post status', 'pro-pack-for-wp-job-openings' ) ) ); | |
$chart_data['data'] = array_merge( $chart_data['data'], array( $applications_count['interviewed'], $applications_count['offered'], $applications_count['hired'] ) ); | |
$chart_data['colors'] = array_merge( $chart_data['colors'], array( '#f7b334', '#198989', '#4e9c4c' ) ); | |
return $chart_data; | |
} | |
add_filter( 'awsm_jobs_overview_applications_by_status_data', 'awsm_jobs_overview_applications_by_status_data', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note
After copying the code, please remove
<?php
from line 1 if you are using this code in an existing file (e.g. functions.php).Resources
How to Easily Add Custom Code to Your WordPress Websites