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 | |
if (!defined('ABSPATH')) { | |
die('-1'); | |
} | |
if (!class_exists('ANT_NOTICE')) { | |
class ANT_NOTICE |
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 | |
echo '<a href="#" class="dropdown-back" data-toggle="dropdown"> '; | |
echo '<i class="fa fa-shopping-cart" aria-hidden="true"></i>'; | |
echo ' | |
<div class="basket-item-count" style="display: inline;">'; | |
echo '<span class="cart-items-count count">'; | |
echo WC()->cart->get_cart_contents_count(); | |
echo '</span>'; | |
echo ' | |
</div> |
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 | |
/** | |
* | |
* King Composer | |
* (c) KingComposer.com | |
* | |
*/ | |
if(!defined('KC_FILE')) { | |
header('HTTP/1.0 403 Forbidden'); | |
exit; |
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 FILTER | |
* | |
*/ | |
function custom_responsive_image_sizes($sizes, $img_name, $attachment_id) { | |
$sizes = wp_get_attachment_image_sizes($attachment_id, 'original'); | |
$meta = wp_get_attachment_metadata($attachment_id); | |
$width = $meta['width']; |
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
//Using wp cli | |
wp wc tool run clear_sessions --user=1 | |
Useful related commands: https://github.com/woocommerce/woocommerce/wiki/WC-CLI-Overview#command-1 | |
wp wc tool run delete_orphaned_variations --user=1 | |
wp wc tool run clear_expired_transients --user=1 | |
wp wc tool run clear_transients --user=1 | |
--user=1 is an admin user with ID=1 in my case |
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 | |
$args = array( | |
'post_type' => array( 'product' ), | |
'meta_key' => 'total_sales', | |
'orderby' => 'meta_value_num', | |
'order' => 'desc', | |
'posts_per_page' => 5 | |
); | |
$popular_products = new WP_Query( $args ); |
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 | |
// Display the custom checkbow field in checkout | |
add_action( 'woocommerce_review_order_before_order_total', 'fee_installment_checkbox_field', 20 ); | |
function fee_installment_checkbox_field(){ | |
echo '<tr class="packing-select"><th>'; | |
woocommerce_form_field( 'installment_fee', array( | |
'type' => 'checkbox', | |
'class' => array('installment-fee form-row-wide'), | |
'label' => __('Montaža v 14 dneh (predpripravljen prostor) - 170€'), |
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
{ "name": "resize_and_watermark_images", "version": "1.0.0", "description": "", "main": "resize.js", "author": "Anton Semenov", "license": "", "dependencies": { "sharp": "^0.29.3" } } |
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 wordpress stuff etc | |
if(!is_user_logged_in()) { | |
wp_redirect( wp_login_url($_SERVER['SCRIPT_URI']) ); | |
} |
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
{ | |
"require": { | |
"phpoffice/phpspreadsheet": "^1.18", | |
"mpdf/mpdf": "^8.0" | |
} | |
} |