Anonymous avatar Anonymous committed 23db2ee

filters 'ipwp_reviewpost_noprice' + 'ipwp_reviewpost_nocurrency'

apply_filters('ipwp_reviewpost_noprice', '0.00');
apply_filters('ipwp_reviewpost_nocurrency', 'USD');

in itemprop WP 3.3.6 / 3.3

Comments (0)

Files changed (1)

itemprop_review.php

 	}
 	
 	private function reviewvers(){
-		return '1.1.0';
+		return '1.2.0';
 	}
 
 	public function reviewinit() {
 			if(isset($reviewonoff['onoff'])){
 				if($reviewonoff['onoff']=="on"){
 					if(!$reviewname){$reviewname = $reviewpost->post_title;}
-					if($reviewprice && $reviewcurrency){
+					if($reviewprice || $reviewcurrency){ // @since 1.2.0 with || not &&
 						$pricerows = '<span itemprop="offers" itemscope itemtype="http://schema.org/Offer"><meta itemprop="price" content="'.$reviewprice.'"><meta itemprop="priceCurrency" content="'.$reviewcurrency.'"><link itemprop="availability" href="http://schema.org/InStock"></span>';
 					}
 					
 		$currency = $_POST[$ipwprprefix.'currency'];
 		$rating = $_POST[$ipwprprefix.'rating'];
 		$reviewonoff = $_POST[$ipwprprefix.'reviewonoff'];
-		
-		if(!$product_price||$product_price==''){$product_price = '0.00';}
-		if(!$currency||$currency==''){$currency = 'USD';}
+		// Default price
+		if(!$product_price||$product_price==''){
+			$product_price = apply_filters('ipwp_reviewpost_noprice', '0.00'); // @since 1.2.0 apply_filters
+		}
+		// Default currency
+		if(!$currency||$currency==''){
+			$currency = apply_filters('ipwp_reviewpost_nocurrency', 'USD'); // @since 1.2.0 apply_filters
+		}
 		
 		update_post_meta($post_id, $ipwprprefix.'product_name', $product_name);
 		update_post_meta($post_id, $ipwprprefix.'product_price', $product_price);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.