Wordpress

Redirect WP-Login to a frontend login

 

WordPress: Add uploaded image to the media library

 

Woocommerce change price in cart

 

Woocommerce Change price of product without effecting the database

 

Woocommerce get order and items in order

 

WordPress check if user has role

 

Force WordPress media library to use HTTPS

 

Check if current user has role in WordPress

 

Woocommerce change quantity of product in cart

 

Get posts meta compare WordPress

 

Get price of product in Woocommerce

if( $product->is_type( 'variable' ) ){
				$available_variations = $product->get_available_variations();
				}
				else {
				
				}
				$regularprice = $available_variations[0]['display_regular_price'];
					
				if (!empty( $regularprice)	){
					
				}
				else {
					$regularprice = $product->regular_price;
				}
					$from = $regularprice;
			        $to = $product->price;
			   if ( $product->price > 0 ) {
			      if ( $from <> $to ) {
			       
			        echo '
'.( ( is_numeric( $to ) ) ? woocommerce_price( $to ) : $to ) .'
van '. ( ( is_numeric( $from ) ) ? woocommerce_price( $from ) : $from ) .'
' ; } else { $to = $product->price; echo '
' . ( ( is_numeric( $to ) ) ? woocommerce_price( $to ) : $to ) . '
'; } } else { //NO PRICE }

Nonce in an AJAX request WordPress



var data = {
		action: 'my_action',
		security: '',
		my_string: 'Hello World!'
	};
	$.post(ajaxurl, data, function(response) {
		alert("Response: " + response);
	});




/*AND IN AJAX.php FILE*/
	check_ajax_referer( 'my-special-string', 'security' );


WordPress sql count meta values and group by meta keys