Skip to content

Instantly share code, notes, and snippets.

@meloniq
Last active January 9, 2017 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meloniq/9fa2788509b79034441aa1466d4fc1bc to your computer and use it in GitHub Desktop.
Save meloniq/9fa2788509b79034441aa1466d4fc1bc to your computer and use it in GitHub Desktop.
[ClassiPress] Don't show saved Custom Form field on frontend
<?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