Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jobs pending payment to the Jobs dashboard #2141

Draft
wants to merge 3 commits into
base: trunk
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion includes/class-wp-job-manager-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private function is_job_available_on_dashboard( WP_Post $job ) {
private function get_job_dashboard_query_args( $posts_per_page = -1 ) {
$job_dashboard_args = [
'post_type' => 'job_listing',
'post_status' => [ 'publish', 'expired', 'pending', 'draft', 'preview' ],
'post_status' => [ 'publish', 'expired', 'pending', 'draft', 'preview', 'pending_payment' ],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably hook into job_manager_get_dashboard_jobs_args from WCPL.

'ignore_sticky_posts' => 1,
'posts_per_page' => $posts_per_page,
'orderby' => 'date',
Expand Down Expand Up @@ -418,6 +418,10 @@ public function get_job_actions( $job ) {
break;
case 'pending_payment':
case 'pending':
$actions['continue'] = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need to split pending and pending_payment here. pending is if they've actually submitted it but pending_payment is before the process. Edit (when available based on setting) makes more sense for pending and pending_payment.

We should probably put this in an action under default:, but somehow not break compatibility with older WCPL that don't hook into the new action.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree, and IMO it should set the status back to Draft to actually have the listing go through the status transitions when they actually occur. Reason being the listing should go into preview status again, then transition to pending_payment (instead of just remaining on pending_payment through the entire flow)

'label' => __( 'Continue Submission', 'wp-job-manager' ),
'nonce' => $base_nonce_action_name,
];
if ( WP_Job_Manager_Post_Types::job_is_editable( $job->ID ) ) {
$actions['edit'] = [
'label' => __( 'Edit', 'wp-job-manager' ),
Expand Down