Apply Gate Messages (Logged Out, No Profile, Not Visible)
Snippet

Members need a published, visible profile to apply. This shows them exactly why they can’t apply yet, and where to go to fix it, instead of a blank or misleading apply form.

What the visitor sees

Visitor Message Link goes to
Logged out You must be a member with a published profile to apply. Login page (wp_login_url()), where they can log in or join
Logged in, no profile You must have a published profile to apply. /candidate-create-profile/
Logged in, profile is Hidden, pending approval, draft or expired You must have a published, visible profile to apply. /candidate-manage-profile/
Logged in, published and visible profile No message; the apply form is shown n/a

How it works: Applications shows its login template to guests, and Resume Manager’s “Force Resume Creation” shows its own template to a member with no usable profile. Both templates can be overridden in the theme, so we replace each with a short notice built by one helper function. The same two templates run on the single job page and in the AJAX job pane, so there is nothing separate for the pane.

Step 1: Add the snippet (Code Snippets, set to Run snippet everywhere; or the end of generatepress_child/functions.php)

One snippet holds both the helper and a filter. The filter makes Resume Manager count only Published profiles, so a member whose only profile is Hidden gets the message instead of a form with no profile field.

if ( ! function_exists( 'workpei_apply_gate_state' ) ) {
	function workpei_apply_gate_state() {
		if ( ! is_user_logged_in() ) {
			return 'logged_out';
		}

		$args = array(
			'post_type'      => 'resume',
			'author'         => get_current_user_id(),
			'posts_per_page' => 1,
			'fields'         => 'ids',
		);

		if ( get_posts( array_merge( $args, array( 'post_status' => 'publish' ) ) ) ) {
			return 'ok';
		}

		if ( get_posts( array_merge( $args, array( 'post_status' => array( 'hidden', 'pending', 'draft', 'expired' ) ) ) ) ) {
			return 'not_visible';
		}

		return 'no_profile';
	}
}

if ( ! function_exists( 'workpei_apply_gate_notice' ) ) {
	function workpei_apply_gate_notice( $state = '' ) {
		if ( '' === $state ) {
			$state = workpei_apply_gate_state();
		}

		$permalink = get_permalink();

		$notices = array(
			'logged_out'  => array(
				'You must be a member with a published profile to apply.',
				'Log in or join',
				wp_login_url( $permalink ? $permalink : home_url( '/' ) ),
			),
			'no_profile'  => array(
				'You must have a published profile to apply.',
				'Create your profile',
				home_url( '/candidate-create-profile/' ),
			),
			'not_visible' => array(
				'You must have a published, visible profile to apply.',
				'Manage your profile',
				home_url( '/candidate-manage-profile/' ),
			),
		);

		if ( ! isset( $notices[ $state ] ) ) {
			return '';
		}

		list( $message, $label, $url ) = $notices[ $state ];

		return '<p class="job-manager-info workpei-apply-gate">' . esc_html( $message ) . ' <a href="' . esc_url( $url ) . '">' . esc_html( $label ) . '</a></p>';
	}
}

/**
 * Only Published profiles count as "has a profile" for applying.
 * Resume Manager's Force Resume Creation otherwise counts Hidden profiles too,
 * which would let a member with only a Hidden profile skip the apply gate.
 */
add_filter( 'resume_manager_get_application_form_resumes_args', function ( $args ) {
	$args['post_status'] = array( 'publish' );
	return $args;
} );

Step 2: Override the logged-out template

Create generatepress_child/wp-job-manager-applications/application-form-login.php:

<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

echo workpei_apply_gate_notice( 'logged_out' );

Step 3: Override the force-resume template

Create generatepress_child/wp-job-manager-resumes/force-apply-with-resume.php:

<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

$workpei_state = workpei_apply_gate_state();

// Resume Manager only shows this template when the member has no usable profile,
// so 'ok' should not happen; fall back to the create-profile message if it does.
echo workpei_apply_gate_notice( 'ok' === $workpei_state ? 'no_profile' : $workpei_state );

Step 4: Settings it depends on

  • Job Applications → Application Forms → Default Form: clear the Description on the Profile field. By default it reads “You need a profile to apply. Create a profile.” and shows next to the dropdown whenever the member has a profile, which is the opposite of when it is useful.
  • Resumes → Settings → Apply With Resume → Force Resume Creation: ON. Without it, a member with no usable profile sees the form with no profile field instead of the message.
  • Both profile pages must exist: /candidate-create-profile/ and /candidate-manage-profile/. If you change either URL, change the matching home_url() line in the helper.

Critical Configuration Note:
The snippet must be loaded on every request, including admin-ajax, or the AJAX job pane will fail when it reaches the template overrides. Functions.php always loads; if you use Code Snippets, set it to Run snippet everywhere, not front-end only. Keep the Published-only filter in the same snippet: without it a member whose only profile is Hidden passes Resume Manager’s check and gets the form with no profile field, and the “published, visible” message never shows for them. The overrides depend on the plugins’ template names, application-form-login.php in Applications and force-apply-with-resume.php in Resume Manager, so check them after a major update of either plugin. Not yet tested on this site: confirm each of the four rows in the table above while logged out, as a member with no profile, as a member with only a Hidden profile, and as a member with a published profile.