WP Simple Pay: Remove Trailing Decimals
/** * @link https://library.wpcode.com/snippet/323j86jo/ */ add_filter( ‘simpay_decimal_places’, function() { return 0; } );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
/** * @link https://library.wpcode.com/snippet/323j86jo/ */ add_filter( ‘simpay_decimal_places’, function() { return 0; } );Continue reading
function reading_time() { if ( empty( $post ) && isset( $GLOBALS[‘post’] ) ) { $post = $GLOBALS[‘post’]; $content = get_post_field( ‘post_content’, $post->ID ); $word_count = str_word_count( strip_tags( $content ) ); $readingtime = ceil($word_count / 260); if ($readingtime == 1) {…Continue reading
add_filter( ‘body_class’, function( $classes ) { $acc_type=tmwp_get_user_role(); if (!$acc_type) $acc_type=’anonymous’; return array_merge( $classes, array(‘acc-type-‘.strtolower($acc_type),tmwp_get_page_class()) ); } );Continue reading
add_action( ‘init’, ‘custom_logout’ ); function custom_logout() { if ( strpos($_SERVER[‘REQUEST_URI’], ‘/customer-logout’) !== false ) { wp_logout(); $redirect_url = home_url(); wp_safe_redirect($redirect_url); exit; } }Continue reading
/** * Convert Uploaded Images to WebP Format * * This snippet converts uploaded images (JPEG, PNG, GIF) to WebP format * automatically in WordPress. Ideal for use in a theme’s functions.php file, * or with plugins like Code Snippets…Continue reading
function remove_feeds() { wp_die( __( ‘Feeds Disabled’ ) ); } add_action(‘do_feed’, ‘remove_feeds’, 1); add_action(‘do_feed_rdf’, ‘remove_feeds’, 1); add_action(‘do_feed_rss’, ‘remove_feeds’, 1); add_action(‘do_feed_rss2’, ‘remove_feeds’, 1); add_action(‘do_feed_atom’, ‘remove_feeds’, 1); add_action(‘do_feed_rss2_comments’, ‘remove_feeds’, 1); add_action(‘do_feed_atom_comments’, ‘remove_feeds’, 1); remove_action( ‘wp_head’, ‘feed_links_extra’, 3 ); remove_action( ‘wp_head’, ‘feed_links’, 2…Continue reading
add_filter( ‘acf/shortcode/allow_unsafe_html’, function ( $allowed, $atts ) { $allowed = true; return $allowed; }, 10, 2 ); add_filter( ‘acf/the_field/allow_unsafe_html’, function( $allowed, $selector ) { $allowed = true; return $allowed; }, 10, 2 );Continue reading
// This code snippet provides dynamic data to a // In use for Elementor Templates // – Active Templates: Vendor Taxonomy Archive // – Vendor Taxonomies: Vendor Location, Vendor Zone, Vendor Pricing, Vendor Identity Attributes, Vendor Categories // Reference URL…Continue reading