Skip to content

Instantly share code, notes, and snippets.

@brynzovskii
brynzovskii / gettext-filter-multiple.php
Created November 9, 2017 08:48 — forked from BFTrick/gettext-filter-multiple.php
Use the gettext WordPress filter to change any translatable string.
<?php
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Sale!' :
$translated_text = __( 'Clearance!', 'woocommerce' );
@brynzovskii
brynzovskii / wordpress_search_in_custom_fields.php
Created September 6, 2017 17:05 — forked from gradosevic/wordpress_search_in_custom_fields.php
WordPress: Search in ACF fields, functions.php
<?php
///////////////////////////////////
/// SUPPORT FOR SEARCHING IN ACF
///////////////////////////////////
/* Join posts and post-meta tables
*
* http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join
*/
function cf_search_join( $join ) {
global $wpdb;