Media Library Infinite Scrolling
add_filter( ‘media_library_infinite_scrolling’, ‘__return_true’ );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter( ‘media_library_infinite_scrolling’, ‘__return_true’ );Continue reading
/** * Change a currency symbol */ add_filter(‘woocommerce_currency_symbol’, ‘change_existing_currency_symbol’, 10, 2); function change_existing_currency_symbol( $currency_symbol, $currency ) { switch( $currency ) { case ‘AMD’: $currency_symbol = ‘֏’; break; } return $currency_symbol; }Continue reading
// 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
function redirect_after_logout($redirect) { // error_log(‘[redirect_after_logout] Redirecting to: ‘ . home_url(‘store-login’)); return home_url(‘store-login’); } add_filter(‘wpmem_logout_redirect’, ‘redirect_after_logout’);Continue reading
/** * Bypass Force Login to allow for exceptions. * * @param bool $bypass Whether to disable Force Login. Default false. * @param string $visited_url The visited URL. * @return bool */ function my_forcelogin_bypass( $bypass, $visited_url ) { // Allow…Continue reading
function mepr_send_password_email_after_signup( $event ) { $user = $event->get_data(); $mepr_options = MeprOptions::fetch(); $wp_user = MeprUtils::get_user_by( ‘id’, $user->ID ); // Creates and stores key (user_activation_key) with default expiration of 1 day add_filter( ‘allow_password_reset’, ‘MeprUser::allow_password_reset’, 99, 2 ); $key = get_password_reset_key($wp_user); remove_filter( ‘allow_password_reset’,…Continue reading
function account_user_profile_update( $user ) { $user_id = $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…Continue reading
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 ,…Continue reading