Created
October 16, 2020 20:03
-
-
Save tripflex/5151ba7a0754da099bb1b52c64f3bb73 to your computer and use it in GitHub Desktop.
[job_apply] shortcode from get parameter when using WP Job Manager Field Editor
This file contains 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 | |
add_shortcode( 'job_apply_from_get', 'smyles_job_apply_from_get' ); | |
function smyles_job_apply_from_get( $atts, $content = '' ) { | |
if( ! isset( $_GET['job_id'] ) ){ | |
return ''; | |
} | |
$job_id = absint( $_GET['job_id'] ); | |
return do_shortcode( "[job_apply id='{$job_id}']"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment