Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * This adds a field to the end of the "Your Details" section in the Profile form.
- *
- * In this example, we add a Birthday field, which is a date field.
- *
- * @param array $fields
- * @param Charitable_Profile_Form $form
- */
- function ed_charitable_remove_phone_field_unless_creator( $fields ) {
- $user = charitable_get_user( get_current_user_id() );
- if ( ! $user || ! $user->get_campaigns( array( 'status' => 'any' ) )->found_posts ) {
- unset( $fields['phone'] );
- }
- return $fields;
- }
- add_filter( 'charitable_user_fields', 'ed_charitable_remove_phone_field_unless_creator' );
Add Comment
Please, Sign In to add comment