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 | |
/* | |
Plugin Name: WP Dynamic Distant Urls. (Adapted from Local by Flywheel Relative URL (for Live Links)) | |
License: GPLv2 or later | |
*/ | |
$original_domain = parse_url( get_option( 'siteurl' ), PHP_URL_HOST ); | |
$distant_domain = $_SERVER['SERVER_NAME']; | |
if( $original_domain !== $distant_domain ){ |
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 | |
define( 'WP_USE_THEMES', false ); | |
require( dirname( __FILE__ ) . '/wp-blog-header.php' ); | |
require_once ABSPATH . '/wp-admin/includes/post.php'; | |
header("HTTP/1.1 200 OK"); | |
$directory = dirname(__FILE__)."/txt"; |
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 | |
// Le filtre est appliqué dans class-wc-coupon.php | |
add_filter('woocommerce_coupon_is_valid', 'happy_hour_coupon_validity', 10, 2 ); | |
function happy_hour_coupon_validity( $valid, $coupon ){ | |
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_enqueue_style('main', get_stylesheet_uri(), array(), filemtime( get_stylesheet_directory().'/style.css' ) ); |
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
<p class="dummy"> | |
Your text | |
</p> | |
<p class="dummy"> | |
Another paragraph | |
</p> |
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( 'woocommerce_email_attachments', 'mbcreation_woocommerce_attachments', 10, 3 ); | |
function mbcreation_woocommerce_attachments($attachments, $email_id, $email_object){ | |
if( $email_id === 'customer_on_hold_order'){ | |
$attachments[] = get_attached_file( 612 ); | |
} |
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_action('wp_head', function() { | |
$items = wp_get_nav_menu_items('Your Menu Name Here'); | |
foreach ($items as $item) { | |
foreach ($item->classes as $class) { | |
if( preg_match('/([a-fA-F0-9]{3}){1,2}\b/', $class ) ) | |
echo '<style type="text/css">#menu-item-'.$item->ID.' a{color:#'.$class.'!important;}</style>'."\r\n"; | |
} |
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_filter('manage_posts_columns', 'mb_add_pdt_stock_columns', 5); | |
add_action('manage_posts_custom_column', 'mb_add_pdt_stock_columns_display', 5, 2); | |
add_filter('pre_get_posts', 'mb_add_pdt_stock_columns_query', 999); | |
add_filter('manage_edit-product_sortable_columns', 'mb_add_pdt_stock_columns_sort'); |