function utdt_logout2() { $user_id = get_current_user_id(); $txt = sprintf($user_id = ” has been Logged out of Under the Dementia Tree.”); echo $txt; wp_destroy_current_session(); wp_clear_auth_cookie(); wp_set_current_user( 0 ); do_action( ‘utdt_logout2’, $user_id ); }Continue reading
// Remove plugin deactivation for all users except ‘rubberduckers’ function rubberduckers_disable_plugin_deactivation($actions, $plugin_file, $plugin_data, $context) { // Get the current user $current_user = wp_get_current_user(); // Check if the current user’s username is NOT ‘rubberduckers’ if ($current_user->user_login !== ‘rubberduckers’) { // List…Continue reading
/* * */ function change_min_donation_text( $text, $amount ) { return ‘ ‘ . __( ‘The minimum donation for this campaign is ‘, ‘charitable’ ) . charitable_format_money( $amount, false, true ) . ‘. ‘; } add_filter( ‘charitable_donationa_amount_notice’, ‘change_min_donation_text’, 10, 2 );Continue reading
/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading
add_action( ‘jet-form-builder/media-field/before-upload’, /** * Fired before JetFormBuilder uploads a file for a Media field. * * @param \Jet_Form_Builder\Request\Fields\Media_Field_Parser $parser */ function ( $parser ) { // Extra guard: bail out if the expected object is not passed. if ( !…Continue reading
// Remove query string from static resources function _remove_script_version( $src ){ $parts = explode( ‘?ver’, $src ); return $parts[0]; } add_filter( ‘script_loader_src’, ‘_remove_script_version’, 15, 1 ); add_filter( ‘style_loader_src’, ‘_remove_script_version’, 15, 1 ); // Turn off full screen editor if (is_admin())…Continue reading