This file contains hidden or 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 lw_woocommerce_gpf_feed_item_google( $feed_item, $product ) { | |
| // Modify $feed_item->additional_elements['product_type'] here, e.g. | |
| $feed_item->additional_elements['product_type'] = [ | |
| 'Product ID ' . $product->get_id(), | |
| ]; | |
| return $feed_item; | |
| } | |
| add_filter( 'woocommerce_gpf_feed_item_google', 'lw_woocommerce_gpf_feed_item_google', 10, 2 ); |
This file contains hidden or 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 lw_crfwp_timing_options( $options ) { | |
| // 259200 is the number of seconds in 72 hours. | |
| $options[259200] = '72 Hours'; | |
| return $options; | |
| } | |
| add_filter( 'crfwp_timing_options', 'lw_crfwp_timing_options' ); |
This file contains hidden or 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 | |
| /** | |
| * Export Data to CSV file | |
| * Could be used in WordPress plugin or theme | |
| */ | |
| // A sample link to Download CSV, could be placed somewhere in plugin settings page | |
| ?> | |
| <a href="<?php echo admin_url( 'admin.php?page=myplugin-settings-page' ) ?>&action=download_csv&_wpnonce=<?php echo wp_create_nonce( 'download_csv' )?>" class="page-title-action"><?php _e('Export to CSV','my-plugin-slug');?></a> |
This file contains hidden or 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 | |
| /** | |
| * Export WordPress post data to CSV | |
| * Based on <http://stackoverflow.com/a/3474698> and <http://ran.ge/2009/10/27/howto-create-stream-csv-php/> | |
| */ | |
| /** | |
| ********************************************************************* | |
| * Configuration | |
| ********************************************************************* |