Skip to content

Instantly share code, notes, and snippets.

@tripflex
Created January 8, 2024 22:34
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/dace1b37e5aaa619ba52fa29788b762c to your computer and use it in GitHub Desktop.
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
<?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;
}
@tripflex
Copy link
Author

tripflex commented Jan 8, 2024

This assumes the meta key is is_user_logged_in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment