Skip to content

Instantly share code, notes, and snippets.

View mikejolley's full-sized avatar

Mike Jolley mikejolley

View GitHub Profile
@mikejolley
mikejolley / gist:4d0f9b82b8d8dc810b8c
Created January 11, 2015 22:47
Set default category via query string
add_filter( 'submit_job_form_fields', 'custom_submit_job_form_fields' );
function custom_submit_job_form_fields( $fields ) {
if ( isset( $_REQUEST['job_category'] ) ) {
$fields['job']['job_category']['default'] = sanitize_text_field( $_REQUEST['job_category'] );
}
return $fields;
}
@mikejolley
mikejolley / gist:c0f7637800cf6bf5e45c
Last active August 29, 2015 14:13
Applications - Change "CV" to "Resume"
<?php
add_filter( 'gettext', 'change_cv_to_resume', 20, 3 );
/**
* Changes 'CV' to "resume" for applications
*/
function change_cv_to_resume( $translated_text, $text, $domain ) {
if ( "wp-job-manager-applications" === $domain ) {
$translated_text = str_replace( 'Upload CV', 'Upload Resume', $translated_text );
}
@mikejolley
mikejolley / gist:5b0a42255e968353a752
Created January 22, 2015 17:05
Output Job Categories on Job Listings
<?php
// Add category to single job listing meta
add_action( 'single_job_listing_meta_end', 'output_job_category' );
// And to job list
add_action( 'job_listing_meta_end', 'output_job_category' );
function output_job_category() {
global $post;
add_theme_support( 'job-manager-templates' );
/** Code goes in theme functions.php **/
add_filter( 'submit_resume_form_login_url', 'custom_submit_resume_form_login_url' );
function custom_submit_resume_form_login_url() {
return 'http://someurl.com';
}
add_filter( 'job_manager_indeed_get_jobs_args', 'custom_job_manager_indeed_get_jobs_args' );
function custom_job_manager_indeed_get_jobs_args( $args ) {
$args['sort'] = 'date';
return $args;
}
@mikejolley
mikejolley / gist:30180e3f090f7d29f9ed
Created February 7, 2015 08:40
Change bookmarks login link
/** Code goes in theme functions.php **/
add_filter( 'job_manager_bookmark_form_login_url', 'custom_job_manager_bookmark_form_login_url' );
function custom_job_manager_bookmark_form_login_url() {
return 'http://someurl.com';
}
@mikejolley
mikejolley / gist:6fa9a4fd6f78745d6e08
Created February 10, 2015 19:57
Applications - Change who gets the email
add_filter( 'create_job_application_notification_recipient', 'custom_create_job_application_notification_recipient', 10, 3 );
function custom_create_job_application_notification_recipient( $send_to, $job_id, $application_id ) {
// change $send_to here
return $send_to;
}
@mikejolley
mikejolley / gist:5e1b6fd8cbfe68276dfe
Created February 11, 2015 19:13
Remove Google Map Link
add_filter( 'the_job_location_map_link', 'custom_the_job_location_map_link' );
function custom_the_job_location_map_link( $link ) {
return strip_tags( $link );
}
@mikejolley
mikejolley / gist:bf70a6cbe0610d4b3528
Created February 13, 2015 19:05
WP Job Manager Resumes & WooCommerce Subscriptions - If resumes require a 'has_active_subscription' capability, limit access to only those with an active subscription.
// Hook into user_has_cap filter. This assumes you have setup resumes to require the capability 'has_active_subscription'
add_filter( 'user_has_cap', 'has_active_subscription_capability_check', 10, 3 );
/**
* has_active_subscription_capability_check()
*
* Filter on the current_user_can() function.
*
* @param array $allcaps All the capabilities of the user
* @param array $cap [0] Required capability