Inline Spoiler Shortcode (copy)

// Hide text using the shortcode like this: [spoiler]hidden text here[/spoiler]. add_shortcode(‘spoiler’, ‘inline_spoiler_shortcode’); function inline_spoiler_shortcode($atts, $content = null) { // Start output buffering ob_start(); // Output the spoiler content with the necessary styles ?> .inline-spoiler { color: transparent; background-color: #333;…Continue reading

MemberPress: Send “Profile Updated” Admin Notification When MemberPress Account Is Updated

function user_profile_update($user) { $site_url = get_bloginfo(‘wpurl’); $user_info = get_userdata($user->ID); $user_name = $user_info->display_name; //Retrieves user’s full name $user_email = $user_info->user_email; //Retrieves user’s e-mail address $subject = “Profile Updated: “.$site_url.””; $message = “Profile of $user_name , $user_email has been updated!”; //Displays retrieved…Continue reading

MemberPress: Send “Profile Updated” Admin Notification

function user_profile_update($user_id) { $site_url = get_bloginfo(‘wpurl’); $user_info = get_userdata($user_id); $user_name = $user_info->display_name; //Retrieves user’s full name $user_email = $user_info->user_email; //Retrieves user’s e-mail address $subject = “Profile Updated: “.$site_url.””; $message = “Profile of $user_name , $user_email has been updated!”; //Displays retrieved…Continue reading

MemberPress: Disable MemberPress Password Lost/Changed Email

function disable_admin_pw_changed_email_memberpress( $recipients, $subject, $message, $headers ) { if( strpos( $subject, ‘Password Lost/Changed’) !== false ) { $recipients = array(); // no recipients } return $recipients; } add_filter( ‘mepr-wp-mail-recipients’, ‘disable_admin_pw_changed_email_memberpress’, 11, 4 );Continue reading

Customize Login URL

function customizeLoginUrl($login_url, $redirect, $force_reauth) { $login_url = site_url(‘store-login’); if(!empty($redirect)) { $login_url = add_query_arg(‘redirect_to’, urlencode($redirect), $login_url); } if($force_reauth) { $login_url = add_query_arg(‘reauth’, ‘1’, $login_url); } return $login_url; } add_filter(‘login_url’, ‘customizeLoginUrl’, 10, 3);Continue reading

Default Featured Image

// Go to Settings > Media after activating this snippet to set the default featured image. add_action( ‘admin_init’, function() { register_setting( ‘media’, ‘default_featured_image’, ‘absint’ ); add_settings_field( ‘default_featured_image’, __( ‘Default Featured Image’, ‘wpcode-snippet’ ), function() { wp_enqueue_media(); $image_id = get_option( ‘default_featured_image’,…Continue reading

Inline Spoiler Shortcode

// Hide text using the shortcode like this: [spoiler]hidden text here[/spoiler]. add_shortcode(‘spoiler’, ‘inline_spoiler_shortcode’); function inline_spoiler_shortcode($atts, $content = null) { // Start output buffering ob_start(); // Output the spoiler content with the necessary styles ?>Continue reading