Skip to content

Instantly share code, notes, and snippets.

@tripflex
Created August 14, 2018 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/73acbc707bfa2d429c7144e4dc75e2d1 to your computer and use it in GitHub Desktop.
Save tripflex/73acbc707bfa2d429c7144e4dc75e2d1 to your computer and use it in GitHub Desktop.
Allow browse featured resumes when package required to browse resumes with WP Job Manager Packages
<?php
add_shortcode( 'resumes_featured_only', 'smyles_featured_only_resumes' );
function smyles_featured_only_resumes( $atts ){
// Priority must be higher than 999999 (used by packages addon)
// Add filter to return true to allow outputting browse resumes
add_filter( 'resume_manager_user_can_browse_resumes', '__return_true', 9999999 );
// Call shortcode to output featured resumes
echo do_shortcode( '[resumes featured="true"]' );
// Remove filter after outputting featured resumes
remove_filter( 'resume_manager_user_can_browse_resumes', '__return_true', 9999999 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment