Skip to content

Instantly share code, notes, and snippets.

@tripflex
Created June 17, 2015 22:58
Show Gist options
  • Select an option

  • Save tripflex/2152652efe600d28f54a to your computer and use it in GitHub Desktop.

Select an option

Save tripflex/2152652efe600d28f54a to your computer and use it in GitHub Desktop.
Remove specific products from Products 3rd Party Plugin dropdown in Submit Listing page
add_filter( 'submit_job_form_fields', 'heynwa_custom_job_fields', 999999999999 );
function heynwa_custom_job_fields( $fields ) {
if ( isset( $fields[ 'company' ][ 'products' ] ) ){
if( isset( $fields['company']['products']['options'] ) && ! empty( $fields['company']['products']['options'] ) ){
$options = $fields['company']['products']['options'];
// To find out the specific ID of the "products" you can either add &debug to the end of the URL when viewing the company fields
// in admin area (then scroll down until you find them), or go to the products page and get the actual ID
if( isset( $options[894] ) ) unset( $fields['company']['products']['options'][894] );
if( isset( $options[892] ) ) unset( $fields['company']['products']['options'][892] );
if( isset( $options[896] ) ) unset( $fields['company']['products']['options'][896] );
if( isset( $options[895] ) ) unset( $fields['company']['products']['options'][895] );
}
}
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment