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
# This is a basic workflow to help you get started with Actions | |
# The name of the script you are intending to run. | |
name: Deployment | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch. | |
# I left my branch name as main, but you could change this to whatever your branches are called. | |
push: |
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 | |
/** | |
* Plugin Name: Theme Showdown 2020 Helper Plugin | |
* Plugin URI: https://www.ithemes.com/training | |
* Description: Plugin that includes handy helpful code snippets for Theme Showdown 2020 | |
* Author: iThemes / AJ Morris | |
* Author URI: https://www.ithemes.com/training | |
* Text Domain: ithemes-training | |
* Domain Path: /languages | |
* Version: 1.0.0 |
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 | |
// Adds the descriptions to menu output | |
function prefix_nav_description( $item_output, $item, $depth, $args ) { | |
if ( !empty( $item->description ) ) { | |
$item_output = str_replace( $args->link_after . '</a>', '<p class="menu-item-description">' . $item->description . '</p>' . $args->link_after . '</a>', $item_output ); | |
} | |
return $item_output; | |
} |
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 // Do not include this if already open! | |
/** | |
* Code goes in theme functions.php. | |
*/ | |
add_action( 'woocommerce_created_customer', 'woocommerce_created_customer_admin_notification' ); | |
function woocommerce_created_customer_admin_notification( $customer_id ) { | |
wp_send_new_user_notifications( $customer_id, 'admin' ); | |
} |
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 | |
add_action( 'woocommerce_after_add_to_cart_form', 'dropdown_waitlist_label' ); | |
function dropdown_waitlist_label() { | |
echo " | |
<script> | |
jQuery(document).ready(function($) { | |
var variation_data = $('form.variations_form').attr('data-product_variations'); | |
var variation_data = JSON.parse(variation_data); |
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
function custom_wc_ajax_variation_threshold( $qty, $product ) { | |
return 10; | |
} | |
add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 ); |
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 | |
function hwid_load_custom_tab( $tab_key, $tab_info ) { | |
echo apply_filters( 'the_content', $tab_info['tabContent'] ); | |
} | |
function hwid_add_content_tabs( $tabs ) { | |
global $post; | |
$custom_tabs = get_field( 'tabs', $post->ID ); |
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( function_exists('acf_add_local_field_group') ): | |
acf_add_local_field_group(array ( | |
'key' => 'acf_product_options', | |
'title' => 'Product Options', | |
'fields' => array ( | |
array ( | |
'key' => 'acf_product_options_tabbedcontent_label', | |
'label' => 'Tabbed Content', |
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 // Do not include this if already open! | |
/** | |
* Code goes in theme functions.php. | |
*/ | |
add_action( 'woocommerce_created_customer', 'woocommerce_created_customer_admin_notification' ); | |
function woocommerce_created_customer_admin_notification( $customer_id ) { | |
wp_send_new_user_notifications( $customer_id, 'admin' ); |
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 | |
add_action( 'woocommerce_after_add_to_cart_form', 'dropdown_waitlist_label' ); | |
function dropdown_waitlist_label() { | |
echo " | |
<script> | |
jQuery(document).ready(function($) { | |
var variation_data = $('form.variations_form').attr('data-product_variations'); | |
var variation_data = JSON.parse(variation_data); | |
$('#pa_size > option').each(function() { | |
for (var i = 0; i < variation_data.length; i++) { |
NewerOlder