I am building a job website and I am trying to insert an 'apply' button in a custom post-type single page (called 'vacancy') within WordPress. I need this button to notify the admin of the new 'application' = meaning someone logged in clicked on the button.
I have thought about using the comment_form()
function but I am not sure how to adapt it to register the "button" click. It doesn't show anything at all in fact.
I have got the following code inside the WP_Query( $mypost )
while( have_posts() ) : the_post();
loop:
if ( comments_open() || get_comments_number() ) :
if ( post_password_required() ) {
return;
}
comment_form( array(
'comment_field' => '',
'label_submit' => __( 'Apply' ),
'comment_notes_after' => ''
),
$mypost
);
endif;
I don't want to affect the general comments as I may need them for the normal posts and pages, and preferably if I can separate it from the comments and instead have something else - but I can't think of another way to do it.
Thanks in advance! Really do appreciate any suggestions/help.