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
sanitize_text_field( string $str ) |
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
//add font to wigiy editor | |
add_editor_style( '/css/editor.css' ); | |
add_filter( 'tiny_mce_before_init', 'wpex_mce_google_fonts_array' ); | |
function wpex_mce_google_fonts_array( $initArray ) { | |
$theme_advanced_fonts = 'futura=futura;'; | |
$theme_advanced_fonts .= 'futura_b=futura_b;'; | |
$theme_advanced_fonts .= 'avenir_Bold=avenir_b;'; | |
$theme_advanced_fonts .= 'avenir_Regular=avenir_r'; | |
$initArray['font_formats'] = $theme_advanced_fonts; | |
return $initArray; |
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
wp_schedule_single_event( time() - 1, 'mailchimp_user_sync_run' ); | |
spawn_cron(); |
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
// scroll tools | |
var keys = {37: 1, 38: 1, 39: 1, 40: 1}; | |
function preventDefault(e) { | |
e = e || window.event; | |
if (e.preventDefault) | |
e.preventDefault(); | |
e.returnValue = false; | |
} | |
function preventDefaultForScrollKeys(e) { | |
if (keys[e.keyCode]) { |
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
add_filter( 'template_include', 'so_25789472_template_include' ); | |
function so_25789472_template_include( $template ) { | |
if ( is_singular('product') && (has_term( 'mock', 'product_cat')) ) { | |
$template = get_stylesheet_directory() . '/woocommerce/single-product-mock.php'; | |
} | |
return $template; | |
} |
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 codex_custom_init() { | |
register_post_type( | |
'testimonials', array( | |
'labels' => array('name' => __( 'Books' ), 'singular_name' => __( 'Book' ) ), | |
'public' => true, | |
'has_archive' => true, | |
'menu_icon' => 'dashicons-cart', | |
'supports' => array('title', 'editor', 'thumbnail') | |
) |
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
//enable catogries and tags for pages | |
function myplugin_settings() { | |
// Add tag metabox to page | |
register_taxonomy_for_object_type('post_tag', 'page'); | |
// Add category metabox to page | |
register_taxonomy_for_object_type('category', 'page'); | |
} | |
// Add to the admin_init hook of your theme functions.php file | |
add_action( 'init', 'myplugin_settings' ); |
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
$wc_emails = WC()->mailer()->get_emails(); | |
foreach ( $wc_emails as $wc_mail ) | |
if ( $wc_mail->id == "wc_notifi_live" ) | |
$wc_mail->trigger( 1191 ); |