• Resolved marimanga

    (@marimanga)


    Hi,

    I copied code line from WPJM site to remove Preview Step and i added on OceanWP child theme functions.php but i have a problem that i do not know, i went to code snippets and i paste code still same problem but the problem doesn’t show once i delete <?php , so i tested if it will remove Review button but still didn’t work.
    Kindly please check the photo below

    Functions.php
    https://prnt.sc/pqghz4

    It shows error with <?php
    https://prnt.sc/pqgj9z

    Doesn’t show error without <?php but still didn’t work
    https://prnt.sc/pqgibm

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • braehler

    (@braehler)

    Hey @marimanga

    you are missing an action filter at the end. Try this one here. just add it to your childthemes functions.php. Always when adding code to your functions.php. do this without the <?php because the function is already a php file

    function custom_submit_job_steps( $steps ) {
    	unset( $steps['preview'] );
    	return $steps;
    }
    add_filter( 'submit_job_steps', 'custom_submit_job_steps' );
    /**
     * Change button text (won't work until v1.16.2)
     */
    function change_preview_text() {
    	return __( 'Submit Job' );
    }
    add_filter( 'submit_job_form_submit_button_text', 'change_preview_text' );
    /**
     * Since we removed the preview step and it's handler, we need to manually publish jobs
     * @param  int $job_id
     */
    function done_publish_job( $job_id ) {
    	$job = get_post( $job_id );
    	if ( in_array( $job->post_status, array( 'preview', 'expired' ) ) ) {
    		// Reset expirey
    		delete_post_meta( $job->ID, '_job_expires' );
    		// Update job listing
    		$update_job                  = array();
    		$update_job['ID']            = $job->ID;
    		$update_job['post_status']   = get_option( 'job_manager_submission_requires_approval' ) ? 'pending' : 'publish';
    		$update_job['post_date']     = current_time( 'mysql' );
    		$update_job['post_date_gmt'] = current_time( 'mysql', 1 );
    		wp_update_post( $update_job );
    	}
    }
    add_action( 'job_manager_job_submitted', 'done_publish_job' );
    Thread Starter marimanga

    (@marimanga)

    @braehler

    It worked Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove the Resume Preview Step code doesn’t work.’ is closed to new replies.