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
/** | |
* HTML Markup to place in your <head> tag | |
* <link rel="icon" type="image/png" href="/favicon.png" data-dark="/favicon-dark.png" /> | |
*/ | |
// Attach listener to DOM Loaded | |
window.addEventListener( 'DOMContentLoaded', setFavicon ); | |
// Set specific favicon if browser is in dark mode | |
function setFavicon() { |
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 | |
/** | |
* Change submit form <input> element to <button> element for AJAX enabled forms | |
* | |
* @link https://docs.gravityforms.com/gform_submit_button/ | |
*/ | |
add_filter( 'gform_submit_button', function ( $button, $form ) { | |
$dom = new DOMDocument(); |
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
/** | |
* My markup for video is generated with PHP and it looks like this: | |
* | |
* foreach ( $videoURLs as $video_url ) : | |
* | |
* Need to get only video_id param from URL, something like: dEy6mu0UarM | |
* | |
* $video_id = explode('=', $video_url); | |
* | |
* |
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 | |
/** | |
* Filters whether the current taxonomy should be shown in the Quick Edit panel. | |
* | |
* @since 4.2.0 | |
* | |
* @param bool $show_in_quick_edit Whether to show the current taxonomy in Quick Edit. | |
* @param string $taxonomy_name Taxonomy name. |
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 | |
/** | |
* Remove variouse template parts in WooCommerce | |
*/ | |
add_filter( 'wc_get_template', function( $located, $template_name, $args, $template_path, $default_path ) { | |
$remove = [ | |
'sale-flash.php', | |
'meta.php', |
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 if ( ! defined( 'ABSPATH' ) ) exit; | |
/** | |
* Filter Streaming videos products from JSON search in wp-admin 'Woocommerce orders' view | |
*/ | |
add_filter( 'woocommerce_json_search_found_products', function( $products ) { | |
/** | |
* Check HTTP Referer | |
*/ |
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
const path = require('path'); | |
const config = require('./config'); | |
const webpack = require('webpack'); | |
const merge = require('webpack-merge'); | |
const CleanWebpackPlugin = require('clean-webpack-plugin'); | |
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin'); | |
const BrowserSyncPlugin = require('browser-sync-webpack-plugin'); | |
const hotMiddlewareScript = require('webpack-hot-middleware'); | |
/** |
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
const path = require('path'); | |
const config = require('./config'); | |
const webpack = require('webpack'); | |
const merge = require('webpack-merge'); | |
const BrowserSyncPlugin = require('browser-sync-webpack-plugin'); | |
const CleanWebpackPlugin = require('clean-webpack-plugin'); | |
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); |
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 | |
/** | |
* Display errors | |
*/ | |
if ( ! function_exists('debug_wpmail') ) : | |
function debug_wpmail( $result = false ) { | |
if ( $result ) | |
return; |
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 | |
/** | |
* WooCommerce 3.0 gallery fix | |
*/ | |
add_action( 'after_setup_theme', function () { | |
add_theme_support( 'wc-product-gallery-zoom' ); | |
add_theme_support( 'wc-product-gallery-lightbox' ); | |
add_theme_support( 'wc-product-gallery-slider' ); | |
}); |