Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Dec 7th, 2018 62 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. <?php
  2. /**
  3.  * This adds a field to the end of the "Your Details" section in the Profile form.
  4.  *
  5.  * In this example, we add a Birthday field, which is a date field.
  6.  *
  7.  * @param   array                   $fields
  8.  * @param   Charitable_Profile_Form $form
  9.  */
  10. function ed_charitable_remove_phone_field_unless_creator( $fields ) {
  11.     $user = charitable_get_user( get_current_user_id() );
  12.  
  13.     if ( ! $user || ! $user->get_campaigns( array( 'status' => 'any' ) )->found_posts ) {
  14.         unset( $fields['phone'] );
  15.     }
  16.  
  17.     return $fields;
  18. }
  19. add_filter( 'charitable_user_fields', 'ed_charitable_remove_phone_field_unless_creator' );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top