Skip to content

Commit

Permalink
remove job_id (not needed)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnodesign committed Aug 29, 2024
1 parent 29e2cc2 commit 1d84ef7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
4 changes: 2 additions & 2 deletions templates/job-submit.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
exit; // Exit if accessed directly.
}

global $post, $job_manager;
global $job_manager;
$captcha_version = WP_Job_Manager\WP_Job_Manager_Recaptcha::instance()->get_recaptcha_version();

if ( job_manager_user_can_view_submit_job_listing( $post->ID ) ) : ?>
if ( job_manager_user_can_view_submit_job_listing() ) : ?>
<form action="<?php echo esc_url( $action ); ?>" method="post" id="submit-job-form" class="job-manager-form" enctype="multipart/form-data">

<?php
Expand Down
14 changes: 3 additions & 11 deletions wp-job-manager-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1822,14 +1822,11 @@ function job_manager_user_can_view_job_listing( $job_id ) {
*
* @since $$next_version$$
*
* @param int $job_id
* @return bool
*/
function job_manager_user_can_view_submit_job_listing( $job_id ) {
function job_manager_user_can_view_submit_job_listing() {
$can_view = true;
$job = get_post( $job_id );

$caps = get_option( 'job_manager_submit_job_listing_capability' );
$caps = get_option( 'job_manager_submit_job_listing_capability' );

if ( $caps ) {
$can_view = false;
Expand All @@ -1841,19 +1838,14 @@ function job_manager_user_can_view_submit_job_listing( $job_id ) {
}
}

if ( $job->post_author > 0 && absint( $job->post_author ) === get_current_user_id() ) {
$can_view = true;
}

/**
* Filter if the current user can or cannot view job submission
*
* @since $$next_version$$
*
* @param boolean $can_view
* @param int $job_id
*/
return apply_filters( 'job_manager_user_can_view_submit_job', $can_view, $job_id );
return apply_filters( 'job_manager_user_can_view_submit_job', $can_view );
}

/**
Expand Down

0 comments on commit 1d84ef7

Please sign in to comment.