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 mycode_add_product_id_as_tracking_id( $tracking_id, $product ) { | |
return wc_get_product_id_by_sku( $product['_id'] ); | |
} | |
add_filter( 'dfrapi_tracking_id', 'mycode_add_product_id_as_tracking_id', 20, 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 | |
/** | |
* Make terms retrieved by wp_get_object_terms() organized hierarchically. | |
* | |
* Use this function instead of wp_get_object_terms() to get a hierarchically | |
* structured array or term data. | |
* | |
* This function takes the terms returned by wp_get_object_terms() and organizes | |
* them into a hierarchical array with the parent's children (and grandchildren) |
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
#! /bin/bash | |
# | |
# Script to deploy from Github to WordPress.org Plugin Repository | |
# A modification of a number of different sources: | |
# @link https://github.com/deanc/wordpress-plugin-git-svn | |
# @link https://github.com/GaryJones/wordpress-plugin-svn-deploy | |
# @link https://github.com/thenbrent/multisite-user-management/blob/master/deploy.sh | |
# | |
# Accompanying Tutorial Here: | |
# @link https://ericbusch.net/?p=106 |
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 | |
/** | |
* Map each affiliate network ID to your affiliate ID for that network. | |
* | |
* In this example, Commission Junction's network ID is 3 and my Commission | |
* Junction affiliate ID is '321321321'. | |
*/ | |
$affiliate_ids = array( | |
3 => '321321321', // Commission Junction Affiliate 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 | |
/** | |
* Remove the woocommerce_template_loop_product_link_open() function from the | |
* WooCommerce "woocommerce_before_shop_loop_item" action. | |
* | |
* @see remove_action() | |
*/ | |
add_action( 'wp_head', 'mycode_remove_woocommerce_template_loop_product_link_open' ); | |
function mycode_remove_woocommerce_template_loop_product_link_open() { |
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 | |
/** | |
* THIS IS THE ONLY REQUIRED MODIFICATION!!! | |
* | |
* 1. GO HERE WordPress Admin Area > Pages > Add New | |
* 2. CREATE A NEW PAGE TO BE USED FOR DISPLAYING SEARCH RESULTS. | |
* 3. REPLACE "123" BELOW WITH THE ID OF YOUR NEW PAGE. | |
* | |
* Return the ID of the page to be used to display the search results. |
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 merchant logo (if it exists) to the Loop between product thumbnail and product name. | |
*/ | |
add_action( 'woocommerce_before_shop_loop_item_title', 'mycode_add_merchant_logo_to_loop', 20 ); | |
function mycode_add_merchant_logo_to_loop() { | |
global $product; | |
if ( dfrpswc_is_dfrpswc_product( $product->id ) ) { | |
$postmeta = get_post_meta( $product->id, '_dfrps_product', true ); |
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 merchant logo (if it exists) to product details page. | |
*/ | |
add_action( 'woocommerce_external_add_to_cart', 'mycode_add_merchant_logo_to_single_product_page' ); | |
function mycode_add_merchant_logo_to_single_product_page() { | |
global $product; | |
if ( dfrpswc_is_dfrpswc_product( $product->id ) ) { | |
$postmeta = get_post_meta( $product->id, '_dfrps_product', true ); |
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 | |
/** | |
* Import a product's image during a Product Set import/update instead | |
* of after the product is imported. | |
* | |
* Use with CAUTION. This may cause product imports to be drastically slower or fail. | |
* | |
* @see do_action_ref_array(), get_post() | |
* |
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 | |
/** | |
* Remove Comparison Sets from WooCommerce Product pages. | |
* | |
* @see remove_action(), dfrcs_wc_compset_priority() | |
*/ | |
add_action( 'wp_head', 'mycode_remove_compset_from_woocommerce_product_pages' ); | |
function mycode_remove_compset_from_woocommerce_product_pages() { | |
remove_action( 'woocommerce_after_single_product_summary', 'dfrcs_wc_single_product_page_compset', 0 ); |
NewerOlder