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 | |
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored) | |
// http://youtu.be/dQw4w9WgXcQ | |
// http://www.youtube.com/embed/dQw4w9WgXcQ | |
// http://www.youtube.com/watch?v=dQw4w9WgXcQ | |
// http://www.youtube.com/?v=dQw4w9WgXcQ | |
// http://www.youtube.com/v/dQw4w9WgXcQ | |
// http://www.youtube.com/e/dQw4w9WgXcQ | |
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ | |
// http://www.youtube.com/sandalsResorts#p/c/54B8C800269D7C1B/0/dQw4w9WgXcQ |
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
/** | |
* Add checkbox field to the checkout | |
**/ | |
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
function my_custom_checkout_field( $checkout ) { | |
echo '<div id="my-new-field"><h3>'.__('My Checkbox: ').'</h3>'; | |
woocommerce_form_field( 'my_checkbox', array( |
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
Options +FollowSymLinks |
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
RewriteEngine On | |
RewriteCond %{REQUEST_URI} !/robots.txt$ | |
RewriteCond %{HTTP_USER_AGENT} ^$ [OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*EventMachine.*$ [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*NerdyBot.*$ [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*Typhoeus.*$ [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*archive.org_bot.*$ [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*archive.*$ [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*github.*$ [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*chroot.*$ [NC,OR] |
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
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] |
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
<video width="100%" autoplay="autoplay" loop="loop" autobuffer="autobuffer" muted="muted" playsinline="playsinline"> | |
<source data-src="./images/vid.mp4" type="video/mp4" /> | |
</video> |
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
<picture> | |
<source srcset='your/path/image.webp' type='image/webp' /> | |
<img src='your/path/image.jpg' alt="" /> | |
</picture> |
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
class Link extends LinkCore | |
{ | |
protected function getLangLink($id_lang = null, Context $context = null, $id_shop = null) | |
{ | |
$parent_result = parent::getLangLink($id_lang, $context, $id_shop); | |
if ($parent_result) { | |
if ($id_lang == Configuration::get('PS_LANG_DEFAULT')) { | |
return ''; | |
} else { |
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 mb_ucfirst($string){ | |
return mb_strtoupper(mb_substr($string, 0, 1)).mb_strtolower(mb_substr($string, 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
//Auto sync from loaded JSON | |
function sync_acf_fields() { | |
$groups = acf_get_field_groups(); | |
$sync = array(); | |
// bail early if no field groups | |
if( empty( $groups ) ) | |
return; |
OlderNewer