This file contains hidden or 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
$today = new Datetime(); | |
$min = DateTime::createFromFormat('d/m/Y', '25/02/2017'); | |
$max = DateTime::createFromFormat('d/m/Y', '03/03/2017'); | |
if ($min->getTimestamp() <= $today->getTimestamp() && $max->getTimestamp() >= $today->getTimestamp()) { | |
// | |
} |
This file contains hidden or 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
<style> | |
.mk-flex-photo-container { | |
display: flex; | |
width: 100%; | |
justify-content: center; | |
box-shadow: 0 0 black; | |
} | |
.mk-flex-photo-container a { | |
margin: 0 10px; | |
} |
This file contains hidden or 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
'atom-text-editor': | |
'cmd-shift-G': 'go-to-line:toggle' |
This file contains hidden or 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 | |
function mk_check_edit_in_progress($content) { | |
if (!is_single()) | |
return $content; | |
if ( !$lock = get_post_meta( get_the_ID(), '_edit_lock', true ) ) | |
return false; | |
$lock = explode( ':', $lock ); | |
$time = $lock[0]; | |
$user_id = isset( $lock[1] ) ? $lock[1] : get_post_meta( $post->ID, '_edit_last', true ); |
This file contains hidden or 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 | |
// https://github.com/woocommerce/woocommerce/issues/424#issuecomment-8586651 | |
add_filter( 'woocommerce_is_sold_individually', 'wc_remove_all_quantity_fields', 10, 2 ); | |
function wc_remove_all_quantity_fields( $return, $product ) { | |
return( true ); | |
} |
This file contains hidden or 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_init', function() { | |
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); | |
}); |
This file contains hidden or 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
define( 'S3_UPLOADS_BUCKET', '' ); | |
define( 'S3_UPLOADS_KEY', '' ); | |
define( 'S3_UPLOADS_SECRET', ''); | |
define( 'S3_UPLOADS_REGION', 'eu-central-1' ); // the s3 bucket region, required for Frankfurt and Beijing. |
This file contains hidden or 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
ini_set('xdebug.var_display_max_depth', -1); | |
ini_set('xdebug.var_display_max_children', -1); | |
ini_set('xdebug.var_display_max_data', -1); |
This file contains hidden or 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
# Allow passwordless startup of Vagrant with vagrant-hostsupdater. | |
Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c echo "*" >> /etc/hosts | |
Cmnd_Alias VAGRANT_HOSTS_REMOVE = /usr/bin/sed -i -e /*/ d /etc/hosts | |
%admin ALL=(root) NOPASSWD: VAGRANT_HOSTS_ADD, VAGRANT_HOSTS_REMOVE |
This file contains hidden or 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('rest_insert_attachment', function($attachment, $request, $creating) { | |
$data = $request->get_params(); // Extra data that was sent to /wp/v2/media | |
// In this example we can use $data['entry_id'] | |
// Something like: update_post_meta((int) $data['entry_id'], 'attachment_id', $attachment['ID']); | |
}); | |