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 the product's size as a size attribute for this product. | |
* | |
* The attribute "Size" with a slug of "size" | |
* must already exist here: | |
* WordPress Admin Area > Products > Attributes. | |
* | |
* @param array|string $value The current value of the $attribute for this $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 | |
/** | |
* Add the product's size as a size attribute for this product. | |
* | |
* The attribute "Size" with a slug of "size" | |
* must already exist here: | |
* WordPress Admin Area > Products > Attributes. | |
* | |
* @param array|string $value The current value of the $attribute for this $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 | |
/** | |
* Add the product's color as a color attribute for this product. | |
* | |
* The attribute "Color" with a slug of "color" must already exist here: | |
* WordPress Admin Area > Products > Attributes. | |
* | |
* @param array|string $value The current value of the $attribute for this $post. | |
* @param string $attribute The slug of the attribute. Examples: pa_color or pa_shoe-size |
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 the product's color as a color attribute for this product. | |
* | |
* The attribute "Color" with a slug of "color" must already exist here: | |
* WordPress Admin Area > Products > Attributes. | |
* | |
* @param array|string $value The current value of the $attribute for this $post. | |
* @param string $attribute The slug of the attribute. Examples: pa_color or pa_shoe-size |
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 | |
/** | |
* Get all Term IDs this product is associated with and store them as an array | |
* in the postmeta table keyed by "_custom_product_cat_ids". | |
* | |
* @param array $post Array containing WordPress Post information. | |
* @param array $product Array containing Datafeedr Product information. | |
* @param array $set Array containing Product Set information. | |
* @param string $action Either "update" or "insert" depending on what the Product Set is doing. |
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 the custom attribute label "Special Promotion" to a product. | |
* | |
* @param array $attributes An array attributes. | |
* @param array $post An array of post data including ID, post_title, post_status, etc... | |
* @param array $product An array of product data returned from the Datafeedr API. | |
* @param array $set A post array for this Product Set with an array key of postmeta containing all post meta data. | |
* @param string $action The action the Product Set is performing. Value are either "insert" or "update". |
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 | |
/** | |
* Replace affiliate links with links to VigLink. | |
* | |
* There are limitations to this method. Not all products contain the necessary data | |
* to redirect to VigLink. If the necessary data is not available, the affiliate network | |
* affiliate link will be returned instead. Therefore it's a good idea to enter your | |
* affiliate ID for all networks just in case here WordPress Admin Area >Datafeedr API > Networks | |
* |