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 | |
/** | |
* The template for displaying product content within loops | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/content-product.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
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
// GET Request: | |
fetch('https://api.example.com/data') | |
.then(response => response.json()) | |
.then(data => console.log(data)) | |
.catch(error => console.error('Failed to fetch data', error)); | |
// POST Request: | |
fetch('https://api.example.com/data', { | |
method: 'POST', |
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 is_wc_cart_block_based() { | |
$cart_page_id = wc_get_page_id( 'cart' ); | |
if ( $cart_page_id && $cart_page = get_post( $cart_page_id ) ) { | |
// Check for WooCommerce Cart block | |
return has_block( 'woocommerce/cart', $cart_page ); | |
} | |
return false; | |
} |
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 | |
/* | |
* Plugin Name: WooCommerce Shipping Time Display | |
* Plugin URI: https://wcwiz.com/how-to-show-shipping-time-on-woocommerce-product-page/ | |
* Description: Adds a custom shipping time field to WooCommerce products and displays it on the product page. | |
* Version: 1.9 | |
* Author: Shameem Reza | |
* Author URI: https://shameem.dev | |
* License: GPL2 | |
* Text Domain: wc-shipping-time |
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 | |
// Source: https://wordpress.stackexchange.com/questions/414404/how-to-include-custom-fields-in-wordpress-search/414408#414408 | |
function include_custom_field_in_search($query) { | |
if ($query->is_search) { | |
$query->set('meta_query', array( | |
array( | |
'key' => 'release_year', | |
'value' => $query->query_vars['s'], | |
'compare' => 'LIKE' |
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
tar -czvf - --exclude='mydomain.com/administrator/backups' /var/www/sites/mydomain.com > /local/backup/mydomain_backup.tar.gz |
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
(function (UIkit) { | |
if (!UIkit) { | |
throw new Error('UIkit not found. Make sure UIkit is loaded before this plugin.'); | |
} | |
UIkit.component('floating-label', { | |
connected() { | |
this.initFloatingLabel(); | |
}, | |
methods: { |
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 | |
abstract class Helper { | |
public static function getVidId($text) { | |
if(preg_match('~(?:https?://)?(?:www.)?(?:youtube.com|youtu.be|youtube-nocookie.com)/(?:watch\?v=|embed/)?([^"\?\s]+)~', $introtext, $match)) { | |
return $match[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
// YOOtheme > SETTINGS > Custom Code > CSS/LESS: | |
@media(max-width: @breakpoint-medium-max) { | |
.tm-toolbar.uk-visible\@m { | |
display: block !important; | |
order: -1; | |
} | |
.tm-page { | |
display: flex; | |
flex-direction: column; |
NewerOlder