Created
June 17, 2015 22:58
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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