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 | |
// Inspired by this WPSE question: http://wordpress.stackexchange.com/questions/74896/woocommerce-product-category-widget-hide-categories-that-have-no-products-in-s | |
add_filter( 'woocommerce_product_categories_widget_args', 'wpse_74896' ); | |
function wpse_74896( $args ) { | |
global $wpdb; | |
if ( ! empty( $args['current_category'] ) ) { | |
$current = $args['current_category']; | |
$current_clause = "( term_id = '{$current}' OR parent = '{$current}' ) 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
<?php | |
/* | |
Plugin Name: WooCommerce Filter by "Created Via" | |
Description: Filter orders based on how the order was created | |
Author: GoWP | |
Author URI: https://www.gowp.com | |
License: GPL2 | |
License URI: https://www.gnu.org/licenses/gpl-2.0.html | |
*/ |
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_action( 'init', 'gowp_disable_editor_expand_setting' ); | |
function gowp_disable_editor_expand_setting() { | |
global $_updated_user_settings; | |
$_updated_user_settings['editor_expand'] = 'off'; | |
} | |
add_action( 'admin_footer', 'gowp_disable_editor_expand_field' ); | |
function gowp_disable_editor_expand_field() { | |
$screen = get_current_screen(); | |
if ( 'post' == $screen->base ) : ?> |
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
#!/bin/bash | |
# Database configuration | |
DBNAME="" | |
DBUSER="" | |
DBPASS="" | |
# Email configuration |
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
/* | |
* Delays the display of the associated Gravity Form until the visitor has clicked an "Add to cart"-style button | |
* Requires WooCommerce and WooCommerce - Gravity Forms Product Add-Ons plugins | |
*/ | |
add_action( 'wp_footer', 'gowp_woocommerce_gravityforms_reveal_delay' ); | |
function gowp_woocommerce_gravityforms_reveal_delay() { | |
if ( class_exists( 'WooCommerce' ) && class_exists( 'woocommerce_gravityforms' ) && is_product() ) { | |
?> | |
<script type="text/javascript"> |
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_product_data_panels', 'gowp_global_variation_price' ); | |
function gowp_global_variation_price() { | |
?> | |
<script type="text/javascript"> | |
jQuery( document ).ready( function() { | |
a = jQuery( '<a href="#">Apply to all Variations</a>' ); | |
b = jQuery( 'input[name^="variable_regular_price"]' ); | |
a.click( function( c ) { |
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( 'after_switch_theme', 'gowp_copy_theme_mods' ); | |
function gowp_copy_theme_mods() { | |
$mods = get_theme_mods(); | |
if ( is_null( $mods ) || ( ( 1 == count( $mods ) ) && ! $mods[0] ) ) { | |
$parent = wp_get_theme()->get('Template'); | |
$child = basename( dirname( __FILE__ ) ); | |
update_option( "theme_mods_$child", get_option( "theme_mods_$parent" ) ); | |
} |
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
#!/bin/bash | |
# This script will apply outstanding core/plugin updates for all WP installations on the server | |
# Each site will be tested after updates and, if offline as a result, the updates will be reverted | |
# The script assumes a folder structure of: /home/username/domain.com/html/ | |
# WP-CLI (http://wp-cli.org/) and git (http://git-scm.com/) are required | |
find /home/*/*/html -maxdepth 1 -type d -name wp-content | while read FindPath | |
do |
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 theme-provided shortcode | |
remove_shortcode( 'recent_works' ); | |
// add our own modified version | |
add_shortcode( 'recent_works', 'my_shortcode_recent_works' ); | |
function my_shortcode_recent_work( $atts, $content = null ) { | |
... // your modified shortcode function here |
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 | |
private function outputImage($filepath){ | |
$info = UniteFunctionsRev::getPathInfo($filepath); | |
$ext = $info["extension"]; | |
$filetime = filemtime($filepath); | |
$ext = strtolower($ext); | |
if($ext == "jpg") |