_n( '%s person', '%s people', $count, 'text-domain' )
<?php echo wp_kses_data( _n( '%d', '%d', WC()->cart->get_cart_contents_count() ); ?>
function add_async_attribute( $tag, $handle ) {
if ( 'my-js-handle' !== $handle ) {
return $tag;
}
return str_replace( ' src', ' async="async" src', $tag );
}
add_filter('script_loader_tag', 'add_async_attribute', 10, 2);
function add_async_attribute( $tag, $handle ) {
// handles скриптов, которым нужен атрибут async
$scripts_to_async = array(
'my-js-handle',
'another-handle',
);
foreach( $scripts_to_async as $async_script ) {
if ( $async_script === $handle ) {
return str_replace( ' src', ' async="async" src', $tag );
}
}
return $tag;
}
add_filter( 'script_loader_tag', 'add_async_attribute', 10, 2 );
add_post_meta()
update_post_meta()
get_post_meta()
delete_post_meta()
// Javascript: email
/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i
// Javascript: phone
^(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$
<div class="<?php echo ( get_the_content() ) ? 'full' : 'empty'; ?>">
...
</div>
(function($){
/**
* Immediate execution
*/
console.log();
/**
* When DOM is ready
*/
$(document).ready(function(){
});
/**
* When all content is loaded
*/
$(window).load(function(){
}); // window.load END
})(jQuery);