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
<FilesMatch "\.(csv)$"> | |
FileETag None | |
<IfModule mod_headers.c> | |
Header unset ETag | |
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" | |
Header set Pragma "no-cache" | |
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT" | |
</IfModule> | |
</FilesMatch> |
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
/** | |
* Create clean description attribute by removing html, VC en DIVI markup etc. | |
* @param array $attributes variable is an array that contains all the product data that goes into the feed. | |
* @param Int $feed_id makes it possible to only edit a specific feed. You can find the id of a feed in the url of the Feed Editor | |
* @param Int $product_id makes it possible to select a specific product id that you want to filter. | |
* @return array. | |
*/ | |
function alter_feed_description_item( $attributes, $feed_id, $product_id ) { | |
// Remove WordPress shortcodes from Description |
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: wordpress assist clean header | |
Plugin URI: http://www.wordpressassist.nl/ | |
Description: Remove shortlink hook | |
Version: 1.0 | |
Author: AukeJomm | |
Author URI: http://www.aukejongbloed.nl | |
*/ | |
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 | |
// These functions will be added natively to our product feed manager plugin from version 3.2.0 | |
function wppfm_show_quick_edit_custom_fields() { | |
if ( function_exists('wppfm_create_gtin_wc_support_field' ) ) { | |
// Add the Brand field. | |
woocommerce_wp_text_input( | |
array( |
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 set_batch_time( $batch_time ) { | |
// the default batch time limit is set to 30 seconds. | |
// It means that each 30 seconds a new batch is started or when 90% of the max memory limit is reached. | |
// use the below time to change the default 30 second limit. | |
return 20; | |
} | |
add_filter( 'wppfm_default_time_limit', 'set_batch_time' ); |
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 product_old_new( $attributes, $feed_id, $product_id ) { | |
global $product; | |
// Get product creat | |
$product = wc_get_product( $product_id ); | |
$product_created = strtotime($product->get_date_created()); | |
// Calculate the date 10 days ago |
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 add_availability_date_when_backorder( $attributes, $feed_id, $product_id ) { | |
$wc_product = wc_get_product( $product_id ); // Get the WC_Product Object | |
if ($wc_product->is_on_backorder() ) { | |
// add availability_date attribute | |
$attributes['availability_date'] = gmdate( 'c', strtotime( '+7 days' ) ); | |
} | |
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 wppfm_add_product_attributes( $attributes, $feed_id, $product_id ) { | |
$wc_product = wc_get_product( $product_id ); // Get the WC_Product Object | |
if ( $wc_product instanceof WC_Product_Variation || $wc_product instanceof WC_Product_Variable ) { | |
$product_attributes = $wc_product->get_attributes(); // Get the product attributes | |
// Loop through the attributes and add them to the $attributes array | |
foreach ( $product_attributes as $key => $value ) { | |
if ( $value ) { | |
$attributes[ $key ] = $value; |
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 replace_yoast_seo_title( $attributes, $feed_id, $product_id ) { | |
// replace %%title%% with the product title. | |
$attributes['title'] = str_replace('%%title%%', get_the_title($product_id), $attributes['title']); | |
$attributes['description'] = str_replace('%%title%%', get_the_title($product_id), $attributes['description']); | |
// replace %%sitename%% with the site name | |
$attributes['title'] = str_replace('%%sitename%%', get_bloginfo('name'), $attributes['title']); |
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
// woocommerce product feed manager (www.marketingrobot.com) | |
// Removes specific products ID's from the feed generation process | |
function wppfm_exclude_product_ids_from_feed( $products_queue, $feed_id ) { | |
$products_to_exclude = array( | |
'20872', | |
'20875', | |
'20876', | |
'20879', | |
'20883', | |
'20895', |
NewerOlder