Last active
January 9, 2017 06:43
-
-
Save meloniq/9fa2788509b79034441aa1466d4fc1bc to your computer and use it in GitHub Desktop.
[ClassiPress] Don't show saved Custom Form field on frontend
This file contains 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
<?php | |
/** | |
* Don't show saved Custom Form field on frontend. | |
* | |
* @param object $field | |
* @param object $post | |
* @param string $location | |
* | |
* @return object|bool | |
*/ | |
function childtheme_hide_my_custom_form_field( $field, $post, $location ) { | |
$field_to_hide = 'cp_name_of_my_field_to_hide'; | |
if ( $field->field_name == $field_to_hide ) { | |
$field = false; | |
} | |
return $field; | |
} | |
add_filter( 'cp_ad_details_field', 'childtheme_hide_my_custom_form_field', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment