Admin Bar – Updates

function add_updates_admin_bar_menu() { global $wp_admin_bar; $wp_admin_bar->add_menu( array( ‘id’ => ‘updates’, ‘title’ => ‘Updates’, ‘href’ => admin_url( ‘update-core.php’ ), ‘parent’ => ‘top-secondary’, ) ); } add_action( ‘wp_before_admin_bar_render’, ‘add_updates_admin_bar_menu’ );Continue reading

Animacja Formularza

jQuery(“input , textarea”).focus(function(){ jQuery(this).parents(‘.elementor-field-group’).addClass(‘focused’); }); jQuery(“input , textarea”).blur(function(){ var inputValue = jQuery(this).val(); if ( inputValue == “” ) { jQuery(this).parents(‘.elementor-field-group’).removeClass(‘focused’); } });Continue reading

Custom Registration Fields

/** * Add fields to the registration form. * * @param array $fields * @return array */ add_filter( ‘charitable_user_registration_fields’, function( $fields ) { /* Add a text field. */ $fields[‘text_field’] = [ ‘type’ => ‘text’, ‘label’ => ‘My Text Field’,…Continue reading

Set New User Role

/** * Set the role of users who register through the Charitable * registration form shortcode. * * @param array $values * @return array $values */ function ed_charitable_set_user_registration_role( $values ) { if ( array_key_exists( ‘role’, $values ) ) { return…Continue reading

Set Custom Redirection After Registration

/** * Send the user to a custom page after they have registered. * * @param array[] $fields * @return array[] $fields */ function en_set_custom_redirection_after_registration( $fields ) { if ( ! isset( $_GET[ ‘redirect_to’ ] ) ) { $fields[ ‘redirect_to’…Continue reading

Send New User Notifications

/** * Send the new user notification after someone registers * through the Charitable registration form. */ add_action( ‘charitable_after_insert_user’, ‘wp_send_new_user_notifications’ );Continue reading

Customize Donation Stats

/** * Customize the stats that are shown in the Donation Stats widget. * * In this example, we only show the stats specific to a particular category. * * @param array $donation_stats The default stats to show. * @return…Continue reading

Send Notifications On User Registration

/** * Notify admin and user when a user registers with Charitable. * * @param array[] $fields * @param Charitable_Donation_Form $form * @return array[] */ function charitable_notify_new_user($user_id, $values) { wp_new_user_notification( $user_id, null, ‘admin’ ); } add_action(‘charitable_after_insert_user’, ‘charitable_notify_new_user’, 10, 2);Continue reading

Add Country

/** * Add Kosovo to the list of countries in Charitable. */ add_filter( ‘charitable_countries’, function( $countries ) { $countries[‘XK’] = ‘Kosovo’; return $countries; } );Continue reading