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 | |
//* Changed file: controllers/admin/import.php ************************************************************************************ | |
//* OLD: | |
$hide_fields = array('_wp_page_template', '_edit_lock', '_edit_last', '_wp_trash_meta_status', '_wp_trash_meta_time'); | |
//* NEW: | |
$hide_fields = array('_edit_lock', '_edit_last', '_wp_trash_meta_status', '_wp_trash_meta_time'); |
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 | |
//* Load Google charts library | |
add_action( 'wp_enqueue_scripts', 'wp_enqueue_chiptuning_scripts' ); | |
function wp_enqueue_chiptuning_scripts( ) { | |
wp_enqueue_script( 'google-charts-script', 'https://www.gstatic.com/charts/loader.js' ); | |
} | |
//* Replace Genesis loop | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); |
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 | |
//* Highlight parent menu item | |
add_action('nav_menu_css_class', 'nl_nav_menu_css_class', 10, 2 ); | |
function nl_nav_menu_css_class($classes, $item) { | |
global $post; | |
$current_post_type = get_post_type_object(get_post_type($post->ID)); | |
$current_post_type_slug = $current_post_type->rewrite['slug']; |
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 | |
//* Disable the emoji's | |
add_action( 'init', 'nl_disable_wp_emojis' ); | |
function nl_disable_wp_emojis() { | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); | |
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); |
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 | |
//* Disable embed script | |
add_action('init', 'nl_disable_wp_embed'); | |
function nl_disable_wp_embed() { | |
if (!is_admin()) { | |
wp_deregister_script('wp-embed'); | |
} | |
} |
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 | |
//* Remove query strings | |
add_filter( 'script_loader_src', 'nl_remove_query_strings', 15, 1 ); | |
add_filter( 'style_loader_src', 'nl_remove_query_strings', 15, 1 ); | |
function nl_remove_query_strings( $src ){ | |
$parts = explode( '?ver', $src ); | |
return $parts[0]; | |
} |
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 page slug as id to widget title | |
add_filter('widget_title', 'add_slug_id_to_widget_title', 15, 3); | |
function add_slug_id_to_widget_title($title, $instance, $args){ | |
$page = get_page_by_title($title); | |
$title = sprintf('<span id="%s">%s</span>', $page->post_name, $title); | |
return $title; | |
} |
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 | |
//* Get global WC object | |
global $woocommerce; | |
//* Access various WooCommerce cart variables, see also https://docs.woothemes.com/wc-apidocs/class-WC_Cart.html | |
$woocommerce->cart->get_cart_subtotal(); | |
$woocommerce->cart->get_cart_tax(); | |
$woocommerce->cart->get_cart_total(); | |
//* Access various WooCommerce customer variables, see also @see https://docs.woothemes.com/wc-apidocs/class-WC_Customer.html |
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 | |
//* Forward all WC email notifications | |
add_filter( 'woocommerce_email_headers', 'nl_forward_wc_email_notifocations', 10, 2); | |
function nl_forward_wc_email_notifocations($headers, $object) { | |
$headers = array(); | |
$headers[] = 'Bcc: Niels Lange <info@nielslange.com>'; | |
$headers[] = 'Content-Type: text/html'; | |
return $headers; | |
} |
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 | |
//* Remove X-Pingback header | |
add_filter( 'wp_headers', function( $headers ) { | |
unset( $headers['X-Pingback'] ); | |
return $headers; | |
}, 20); | |
//* Remove XML-RPC methods | |
add_filter( 'xmlrpc_methods', function( $methods ) { | |
unset( $methods['pingback.ping'] ); |
OlderNewer