Skip to content

Instantly share code, notes, and snippets.

View mikejolley's full-sized avatar

Mike Jolley mikejolley

View GitHub Profile
@mikejolley
mikejolley / gist:0d0433d45dc965d23e30
Created June 12, 2015 15:40
WP Job Manager Bookmarks - Custom Login URL
/** 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:6d2ac9fdd438763412a6
Created June 2, 2015 19:08
Hide expired jobs on dashboard
add_filter( 'job_manager_get_dashboard_jobs_args', 'hide_expired_job_manager_get_dashboard_jobs_args' );
function hide_expired_job_manager_get_dashboard_jobs_args( $args ) {
$args['post_status'] = array( 'publish', 'pending' );
return $args;
}
<?php
global $post;
if ( current_user_can( 'manage_options' ) && 'resume' === get_post_type( $post->ID ) ) {
$public_link = get_resume_share_link( $post->ID );
echo '<a href="' . $public_link . '">Share Link</a>';
}
?>
@mikejolley
mikejolley / gist:4b495f544bb632757e27
Last active May 12, 2022 12:14
Resume Manager Repeated Rows Example. Requires 1.11.4
/**
* Return an array of fields which will repeat (have multiple rows)
*
* Subfields should be named group_fieldname[]
*
* @return array
*/
function get_custom_repeated_field_fields() {
return array(
'field1' => array(
@mikejolley
mikejolley / gist:ddd499016fdd384229ed
Created May 24, 2015 22:47
Move apply with XING message
add_action( 'init', 'move_xing_message' );
function move_xing_message() {
if ( has_action( 'job_content_start', array( $GLOBALS['wp-job-manager-apply-with-xing'], 'apply_result' ) ) {
remove_action( 'job_content_start', array( $GLOBALS['wp-job-manager-apply-with-xing'], 'apply_result' ) );
add_action( 'SOME_OTHER_HOOK', array( $GLOBALS['wp-job-manager-apply-with-xing'], 'apply_result' ) );
}
}
add_filter( 'resume_manager_user_can_download_resume_file', 'custom_resume_manager_user_can_download_resume_file' );
function custom_resume_manager_user_can_download_resume_file( $can_download ) {
$can_download = current_user_can( 'employer' );
return $can_download;
}
add_filter( 'woocommerce_hidden_order_itemmeta', 'hide_job_id_from_order_itemmeta' );
function hide_job_id_from_order_itemmeta( $hidden ) {
$hidden[] = '_job_id';
return $hidden;
}
@mikejolley
mikejolley / gist:76d8b538fe489377793b
Created May 17, 2015 15:45
How to define a custom template file for a job manager field
add_filter( 'job_manager_locate_template', 'custom_field_job_manager_locate_template', 10, 3 );
function custom_field_job_manager_locate_template( $template, $template_name, $template_path ) {
if ( 'your-template-name' === $template_name ) {
return 'path-to-your-field';
}
return $template;
}
@mikejolley
mikejolley / gist:14d00bafd9d360212cd2
Created May 7, 2015 20:52
Dequeue jquery ui in admin
add_filter( 'admin_enqueue_scripts', 'unhook_jm_jquery_ui', 20 );
function unhook_jm_jquery_ui() {
wp_dequeue_style( 'jquery-ui' );
wp_dequeue_style( 'jquery-ui-style' );
}
/** Code goes in theme functions.php **/
add_filter( 'job_manager_job_dashboard_login_url', 'custom_job_manager_job_dashboard_login_url' );
function custom_job_manager_job_dashboard_login_url() {
return 'http://someurl.com';
}