Created
January 8, 2024 22:34
-
-
Save tripflex/dace1b37e5aaa619ba52fa29788b762c to your computer and use it in GitHub Desktop.
Auto populate a field based on user logged in status when using WP Job Manager Field Editor
This file contains hidden or 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_filter( 'field_editor_auto_populate_is_user_logged_in', 'smyles_is_user_logged_in_populate' ); | |
function smyles_is_user_logged_in_populate( $value ){ | |
return is_user_logged_in() ? 1 : 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This assumes the meta key is
is_user_logged_in