Override strings

add_filter( ‘gettext’, function ( $translated_text, $text, $domain ) { if ( $text == ‘Birthday (optional)’ ) { $translated_text = __( ‘Birthday’, ‘rug’ ); } return $translated_text; }, 20, 3 );Continue reading

Smush – Original Images

/** * Plugin Name: [Smush] – Original Images * Plugin URI: https://premium.wpmudev.org/ * Description: Displays all original images so they can be deleted. Requires Smush * Author: Panos Lyrakis @ WPMUDEV * Author URI: https://premium.wpmudev.org/ * License: GPLv2 or later…Continue reading

Add custom class to body

add_filter( ‘body_class’, function ( $classes ) { global $post; if ( is_front_page() || is_page( [64, 78, 532, 533, 76] ) || $post->post_parent == 64 || is_singular( ‘product’ ) || is_post_type_archive( ‘product’ ) ) { $classes[] = ‘header-button-blue’; } if (…Continue reading

Disable OEmbed

remove_action( ‘wp_head’, ‘wp_oembed_add_discovery_links’, 10 ); // Remove the REST API endpoint. remove_action( ‘rest_api_init’, ‘wp_oembed_register_route’ ); // Turn off oEmbed auto discovery. add_filter( ’embed_oembed_discover’, ‘__return_false’ ); // Don’t filter oEmbed results. remove_filter( ‘oembed_dataparse’, ‘wp_filter_oembed_result’, 10 ); // Remove oEmbed discovery links.…Continue reading