This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function itsme_disable_feed() { | |
wp_die( __( 'No feed available, please visit the <a href="'. esc_url( home_url( '/' ) ) .'">homepage</a>!' ) ); | |
} | |
add_action('do_feed', 'itsme_disable_feed', 1); | |
add_action('do_feed_rdf', 'itsme_disable_feed', 1); | |
add_action('do_feed_rss', 'itsme_disable_feed', 1); | |
add_action('do_feed_rss2', 'itsme_disable_feed', 1); | |
add_action('do_feed_atom', 'itsme_disable_feed', 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mpc_remove_wp_block_library_css(){ | |
wp_dequeue_style( 'wp-block-library' ); | |
wp_dequeue_style( 'wp-block-library-theme' ); | |
wp_dequeue_style( 'wc-block-style' ); // Remove WooCommerce block CSS | |
} | |
add_action( 'wp_enqueue_scripts', 'mpc_remove_wp_block_library_css', 100 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Changes /s/ search path to /search/ | |
function wpb_change_search_url() { | |
if ( is_search() && ! empty( $_GET['s'] ) ) { | |
wp_redirect( home_url( "/search/" . urlencode( get_query_var( 's' ) ) ) ); | |
exit(); | |
} | |
} | |
add_action( 'template_redirect', 'wpb_change_search_url' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setWithExpiry(key, value, ttl) { | |
const now = new Date() | |
const item = { | |
value: value, | |
expiry: now.getTime() + ttl | |
} | |
localStorage.setItem(key, JSON.stringify(item)) | |
} |
OlderNewer