Replace Long Application Links with Text Links

Replace Long Application Links with Text Links

Application links from some imported jobs can be very long and ugly, as exemplified below:

To avoid this you can replace the long link with a short text link, as exemplified below:

Just add this snippet to your functions.php file:

add_action( 'goft_wpjm_single_goft_job', 'my_goft_override_application_url', 999 );

function my_goft_override_application_url() {
	remove_action( 'job_manager_application_details_url', array( 'GoFetch_Frontend', 'application_details_url' ), 15 );
	add_action( 'job_manager_application_details_url', '_my_gofj_application_link', 12 );
}

function _my_gofj_application_link( $apply ) {
	global $post;

	$link = $apply->url;

	$atts = apply_filters( 'goft_wpjm_source_link_attributes', array(
		'class'  => '',
		'rel'    => 'nofollow',
		'href'   => $link,
		'target' => '_blank',
	), $post );

	echo  html( 'p', sprintf( __( 'To apply for this job please %s.', 'gofetch-wpjm' ), html( 'a', $atts, 'click here' ) ) );
}