Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Adam Heckler

    (@adamkheckler)

    Do you mean a rejected status for a job listing, or an application?

    Thread Starter ekajuan

    (@ekajuan)

    A listing.

    Someone submit a job. But the content against the rule. So I want to put it in a ‘rejected’ status, so he can edit it later at the fronted.

    Plugin Contributor Adam Heckler

    (@adamkheckler)

    You can use the core register_post_type() function to do this. More info here:

    https://codex.www.ads-software.com/Function_Reference/register_post_status

    Let me know if there’s anything else I can help with! ?? Thanks!

    Thread Starter ekajuan

    (@ekajuan)

    Up to certain degree I have managed to make the post status to change and saved.

    But I can’t seems to add a label above the listings list on the backend.

    And the listing whose status I’ve changed doesn’t appear on the frontend, when user see his listings list.

    Here’s the code I use. Any additional hint? ??

    add_filter( 'job_listing_post_statuses', 'reject_status');
    function reject_status($a){
    $a['rejected'] = _x( 'Rejected', 'post status', 'wp-job-manager' );
    return $a;
    }
    
    // Register Custom Status
    if ( ! function_exists('custom_post_status') ) {
    
    // Register Custom Status
    
    add_action( 'init', 'custom_post_status', 0 );
    function custom_post_status() {
    
      $args = array(
        'label'                     => _x( 'Rejected', 'Status General Name', 'wp_job_manager' ),
        'label_count'               => _n_noop( 'Rejected (%s)',  'Rejected (%s)', 'wp_job_manager' ),
      );
      register_post_status( 'Rejected', $args );
    
    }

    `

    Thread Starter ekajuan

    (@ekajuan)

    So, I’ve figured out all the backend problem.

    But still don’t know how to show it on the frontend.

    add_action( 'init', 'custom_post_status', 0 );
    function custom_post_status() {
    
      $args = array(
        'label'                     => _x( 'Rejected', 'post status', 'wp_job_manager' ),
        'public'                    => true,
        'protected'                 => true,
        'exclude_from_search'       => true,
        'show_in_admin_all_list'    => true,
        'show_in_admin_status_list' => true,
        'label_count'               => _n_noop( 'Rejected <span class="count">(%s)</span>', 'Rejected <span class="count">(%s)</span>', 'wp-job-manager' ),
    
      );
      register_post_status( 'Rejected', $args );
    
    }

    Thread Starter ekajuan

    (@ekajuan)

    Ok, I’ve figured out

    add_filter ('job_manager_get_dashboard_jobs_args', 'tambah_status_iklan_yang_ditampilkan');
    
    function tambah_status_iklan_yang_ditampilkan($x) {
      $x['post_status' ]  = array( 'publish', 'expired', 'pending', 'rejected' );
      return $x;
    }
    Plugin Contributor Adam Heckler

    (@adamkheckler)

    Glad to hear you got things working!

    Let me know if there’s anything else you need. ?? Thanks!

    sambruce

    (@sambruce)

    Hello ekajuan,
    would you mind sharing how you solved the backend problem.
    The ‘Rejected’ status doesn’t show up in the admin menu.

    This was the closest help i found but not working: https://wordpress.stackexchange.com/questions/176733/custom-post-status-not-working

    Thanks in advance.

    Thread Starter ekajuan

    (@ekajuan)

    Add something like this:

    add_filter( 'job_listing_post_statuses', 'reject_status');
    
    function reject_status($a){
      $a['tidak_lolos'] = _x( 'Tidak Lolos', 'post status', 'wp-job-manager' );
      return $a;
    }

    change ‘tidak lolos’ with ‘rejected’

    sambruce

    (@sambruce)

    Thanks for the prompt response.
    It’s working now.

    On the other note, how do I add the Relist button on the job dashboard when the job is rejected?

    Found this code but no idea how to add this:

    case 'expired' :
    
    if ( job_manager_get_permalink( 'submit_job_form' ) ) {
       $actions['relist'] = array( 'label' => __( 'Relist', 'wp-job-manager' ), 'nonce' => true );
    }
    break;
    Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    Howdy!

    I haven’t tested this, but you’d want to override that template (instructions at https://wpjobmanager.com/document/template-overrides/ ) and swapping out case 'expired': with something like

    case 'expired':
    case 'tidak_lolos':
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to add rejected status on a listing’ is closed to new replies.