Edit the output of a filter

Question

I’m trying to edit the output of the filter (below) in the plugin WPJobManager. I want to make sure there isn’t a duplicate company_name value in the $job_slug before it is updated. At the moment, its just set to add company_name to the slug.

if ( apply_filters( 'submit_job_form_prefix_post_name_with_company', true ) && ! empty( $values['company']['company_name'] ) ) {
        $job_slug[] = $values['company']['company_name'];
}

I think I need to add a filter in my functions.php but I’m not sure how to do this with an IF statement to remove the duplicate. I was thinking something like this below? Could anyone point me in the right direction?

if ( strpos( $job_slug, sanitize_title($values['company']['company_name'];) ) ) {
            return;
        }
0
michael74 2 years 2020-12-31T10:10:42-05:00 0 Answers 3 views 0

Leave an answer

Browse
Browse