Skip to content

Instantly share code, notes, and snippets.

@awsm-support
Last active April 11, 2022 07:01
Show Gist options
  • Save awsm-support/6b5d9875c11883636164c43e1ce9209c to your computer and use it in GitHub Desktop.
Save awsm-support/6b5d9875c11883636164c43e1ce9209c to your computer and use it in GitHub Desktop.
WP Job Openings - Custom Application Status (Pro)
<?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 );
@awsm-support
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment