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

Code for importing theme files from plugin

/** * Import an entire folder from a plugin into the WordPress theme. * * @param string $plugin_folder Plugin folder path. * @param string $theme_folder Theme folder path. * * @return bool True on success, false on failure. */ function…Continue reading

Add Theme Supports

add_editor_style( ‘style-editor.css’ ); add_theme_support( ‘appearance-tools’ ); add_theme_support( ‘align-wide’ ); add_theme_support( ‘responsive-embeds’ ); add_theme_support( ‘post-formats’, array( ‘aside’, ‘gallery’, ‘link’, ‘image’, ‘quote’, ‘status’, ‘video’, ‘audio’, ‘chat’ ) // WordPress supports the following post formats. These formats cannot be changed by the average…Continue reading

Change Method Label (copy)

add_filter( ‘woocommerce_cart_shipping_method_full_label’, ‘wcv_override_vendor_shipping_label’, 10, 2 ); function wcv_override_vendor_shipping_label( $label, $method ){ $label = ‘Flat-rate’; // <- Change this to your preferred prefix $has_cost = 0 cost; $hide_cost = ! $has_cost && in_array( $method->get_method_id(), array( ‘free_shipping’, ‘local_pickup’ ), true ); if…Continue reading

Gravity Forms – Changing Edit Entry Page Title

add_filter( ‘gravityview_edit_entry_title’, ‘gk_change_edit_entry_title’, 10, 1); function gk_change_edit_entry_title( $previous_text = ‘Edit Entry’ ) { $view_id = GravityView_View::getInstance()->getViewId(); if($view_id == 5082){ $title = ‘Edit My Registration’; } return $title; }Continue reading