Created
October 5, 2022 06:13
-
-
Save michaeluno/5ab4ef9bb9cb7b544940d1fe1c2f4c19 to your computer and use it in GitHub Desktop.
Inserts a price tag in the unit RSS feeds of Auto Amazon Links
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: Auto Amazon Links - RSS Price Tag | |
* Description: Inserts a price tag in the unit RSS feeds of Auto Amazon Links | |
* Author: Michael Uno (miunosoft) | |
* Version: 1.0.0 | |
*/ | |
function AutoAmazonLinks_InsertRSSPriceTag( $aProduct ) { | |
if ( empty( $aProduct[ 'formatted_price' ] ) ) { | |
return; | |
} | |
echo "<price>" . trim( strip_tags( $aProduct[ 'formatted_price' ] ) ) . "</price>"; | |
} | |
add_action( 'aal_action_rss2_item', 'AutoAmazonLinks_InsertRSSPriceTag' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment