Skip to content

Commit

Permalink
Fix:Overview page job listing count issue fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
SilpaAWSM committed Dec 19, 2024
1 parent 0ad2d62 commit 8e76cde
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions admin/class-awsm-job-openings-overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ public static function get_jobs_by_author( $numberjobs = 7 ) {
$args = array(
'numberjobs' => $numberjobs,
'author_id' => get_current_user_id(),
'job_status' => 'publish',
);
return self::get_jobs( $args );
}
Expand Down
3 changes: 1 addition & 2 deletions admin/templates/meta/applicant-single.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
$applicant_job_id = get_post_meta( $post->ID, 'awsm_job_id', true );
$resume_field_label = ( new AWSM_Job_Openings_Form() )->get_attachment_label( $applicant_job_id );
$this->is_main_applicant_viewed( $post->ID );
// $analytics_option = get_option( 'awsm_jobs_analytics_data' );
// var_dump( $analytics_option );

/**
* Initialize applicant meta box.
*
Expand Down
5 changes: 1 addition & 4 deletions admin/templates/overview/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,14 @@
</div><!-- .awsm-jobs-overview-col-head -->

<?php
if ( ! empty( $jobs ) ) :
// echo '<pre>';
// var_dump($jobs);?>
if ( ! empty( $jobs ) ) : ?>
<div class="awsm-jobs-overview-col-content">
<?php foreach ( $jobs as $job ) :
$jobmeta = get_post_meta( $job->ID );
$expiry_date = isset( $jobmeta['awsm_job_expiry'][0] ) ? $jobmeta['awsm_job_expiry'][0] : null;

// Check if the job is not expired
if ( ! $expiry_date || strtotime( $expiry_date ) >= strtotime( current_time( 'Y-m-d' ) ) ) :

$job_title = get_the_title( $job->ID );
$published_date = get_the_date( 'F j, Y', $job->ID );
?>
Expand Down
8 changes: 7 additions & 1 deletion inc/class-awsm-job-openings-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public function __construct() {
// WooCommerce - Allow the backend access for users with HR Role.
add_filter( 'woocommerce_disable_admin_bar', array( $this, 'woocommerce_disable_backend_access' ) );
add_filter( 'woocommerce_prevent_admin_access', array( $this, 'woocommerce_disable_backend_access' ) );



}

public static function init() {
Expand Down Expand Up @@ -155,7 +158,7 @@ public function register_post_types() {
'capabilities' => array(
'create_posts' => 'do_not_allow',
),
'supports' => false,
'supports' => ['title'],
'rewrite' => false,
)
);
Expand Down Expand Up @@ -463,4 +466,7 @@ public function woocommerce_disable_backend_access( $disable ) {
}
return $disable;
}



}
4 changes: 2 additions & 2 deletions wp-job-openings.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function admin_filters() {
add_filter( 'months_dropdown_results', array( $this, 'awsm_job_month_dropdown' ), 10, 2 );
add_filter( 'views_edit-awsm_job_openings', array( $this, 'modified_post_status_filter' ) );
add_filter( 'views_edit-awsm_job_application', array( $this, 'awsm_job_application_action_links' ) );
add_filter( 'bulk_actions-edit-awsm_job_application', array( $this, 'awsm_job_application_bulk_actions' ) );
//add_filter( 'bulk_actions-edit-awsm_job_application', array( $this, 'awsm_job_application_bulk_actions' ) );
add_filter( 'post_row_actions', array( $this, 'awsm_posts_row_actions' ), 10, 2 );
}
}
Expand Down Expand Up @@ -1147,7 +1147,7 @@ public function awsm_admin_enqueue_scripts() {
array(
'screen_id' => AWSM_Job_Openings_Overview::$screen_id,
'analytics_data' => AWSM_Job_Openings_Overview::get_applications_analytics_data(),
'default_option' => get_option('awsm_jobs_analytics_data', 'month'),
'default_option' => get_option('awsm_jobs_analytics_data', 'year'),
'i18n' => array(
'chart_label' => esc_html__( 'Applications', 'wp-job-openings' ),
),
Expand Down

0 comments on commit 8e76cde

Please sign in to comment.