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
/* LOAD TEXT DOMAIN */ | |
load_child_theme_textdomain( | |
'sergeliatko', | |
apply_filters( | |
'child_theme_textdomain', | |
get_stylesheet_directory() . '/languages', | |
'sergeliatko' | |
) | |
); |
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 | |
if( ! function_exists('wp_parse_args_recursive') ) { | |
/** | |
* Parses arguments considering multi-dimensional arrays and objects. | |
* | |
* @param mixed $args | |
* @param mixed $default | |
* @param bool $preserve_integer_keys | |
* | |
* @return mixed |
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 | |
/** add save_post_meta to save_post hook */ | |
add_action( 'save_post', 'save_post_meta', 10, 3 ); | |
/** | |
* Saves post meta. | |
* | |
* @param $post_ID | |
* @param WP_Post $post | |
* @param $update | |
* |
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 | |
/** | |
* Adds image size to WordPress with setting to control the dimensions in media.php screen and size name in WP user interface. | |
* example: | |
* | |
* if( !defined('PIS_TXD') ) { | |
* define( 'PIS_TXD', 'your-text-domain' ); | |
* } | |
* require_once( dirname( __FILE__ ) . '/PostImageSize.php' ); | |
* $teaser_size = new PostImageSize( 'teaser', __( 'Teaser', 'your-text-domain' ), 460, 280, true ); |
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 | |
/** | |
* Returns terms from a different taxonomy using common published posts as search criteria. | |
* Example: get list of post tags assigned to all posts in a specific category. | |
* | |
* @param array $ids Array of source term ids. | |
* @param string $source Source taxonomy. | |
* @param string $target Target taxonomy. | |
* | |
* @return array |
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
<!-- Track phone number link clicks --> | |
<script type="text/javascript"> | |
/* <![CDATA[ */ | |
(function(){ | |
var DOMReady = function( a, b, c ) { | |
b = document; | |
c = 'addEventListener'; | |
b[c] ? b[c]( 'DOMContentLoaded',a ) : window.attachEvent( 'onload', a ); | |
}; | |
var addDOMListener = function( o, e, f, c ) { |
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
/* clickable phone numbers */ | |
a[href^="tel:"]:before | |
{ | |
content: "\f525"; | |
font-family: 'dashicons'; | |
vertical-align: middle; | |
margin-right: 0.25em; | |
opacity: 0.65; | |
} |
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 removeValue( v, a ) { | |
if( a.length ) { | |
var i = a.indexOf(v); | |
if( -1 === i ) { | |
return a; | |
} | |
a.splice( i, 1 ); | |
return removeValue( v, a ); | |
} | |
return a; |
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 | |
/** | |
* Masks credit card number leaving up to 4 last available digits. | |
* | |
* @param string $n Credit card number (up to 16 characters) | |
* @param string $m Masking string | |
* @param int $v Maximum number of visible characters at the end of the credit card number (in range of 0-4) | |
* | |
* @return string | |
*/ |
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 | |
/** | |
* Adds extra CSS rules to the HEAD html tag after to your theme stylesheet. | |
*/ | |
function my_extra_css() { | |
wp_add_inline_style( | |
sanitize_title_with_dashes( wp_get_theme()->get( 'Name' ) ), | |
'/*** YOUR CSS HERE ***/' | |
); | |
} |
OlderNewer