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 an example for ensuring your content filter function | |
* is called once and only once during the page load of a single Post|Page|Product|etc... | |
* | |
* This is useful when you need to modify the $content via the 'the_content' | |
* filter but you don't want to perform the process more than once because | |
* it's server and/or time intensive. | |
*/ |
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 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 | |
/** | |
* 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 | |
/** | |
* Prevent taxonomy-based attributes from being overwritten when a Product Set | |
* updates a product already in your store. | |
* | |
* @see wc_get_product_terms() | |
* @link http://stackoverflow.com/a/13454788/2489248 | |
* | |
* @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 | |
/** | |
* 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 | |
/** | |
* 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 |