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 | |
/** | |
* Custom rating form validation free version | |
* | |
* @param unknown $validation_results | |
* @param unknown $data | |
* @return $validation_results | |
*/ | |
function mr_custom_rating_form_validation_check( $validation_results, $data ) { |
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 | |
/** | |
* Adds example mainEntityofPage to Product type based on WordPress SEO graph | |
*/ | |
function mrp_structured_data_type_product_main_entity_example( $schema, $post_id ) { | |
$structured_data_type = get_post_meta( $post_id, MRP_Multi_Rating::STRUCTURED_DATA_TYPE_POST_META, true ); | |
if ( $structured_data_type === 'Product' ) { | |
return ' |
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 | |
/** | |
* Adds example address, priceRange and telephone data to the LocalBusiness type | |
*/ | |
function mrp_structured_data_type_localbusiness_example( $schema, $post_id ) { | |
$structured_data_type = get_post_meta( $post_id, MRP_Multi_Rating::STRUCTURED_DATA_TYPE_POST_META, true ); | |
if ( $structured_data_type === 'LocalBusiness' ) { | |
return ' |
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
/** | |
* Adds JSON-LD ratings for schema.org item types | |
*/ | |
function mrp_jsonld_ratings() { | |
if ( is_page() || is_single() ) { | |
$post_id = get_queried_object_id(); | |
if ($post_id == null) { | |
return; |
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 | |
/** | |
* If pretty permalinks are turned on, we need to make the following query string variables | |
* available to WP_Query to sort by highest rated posts | |
*/ | |
function my_query_vars( $qvars ) { | |
$qvars[] = 'orderby'; | |
$qvars[] = 'meta_key'; | |
$qvars[] = 'order'; | |
$qvars[] = 'ignore_sticky_posts'; |
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 | |
$q1 = new WP_Query( array( | |
'meta_key' => 'mrp_rating_result_1_star_rating', | |
'orderby' => 'meta_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 | |
// The Query | |
$q1 = new WP_Query( $args ); | |
// The Loop | |
if ( $q1->have_posts() ) { | |
while ( $q1->have_posts() ) { | |
$q1->the_post(); | |
// Post content here | |
} |
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 mr_check_auto_placement2( $filter, $post_id, $rating_form_id) { | |
// only apply filter once... hopefully, this is the post title... | |
if ( in_the_loop() && ( is_single() || is_page() || is_attachment() ) && get_the_ID() != 430 ) { | |
remove_filter( $filter, 'mr_filter_' . $filter ); | |
} | |
} | |
remove_action( 'mr_after_auto_placement', 'mr_check_auto_placement', 10 ); | |
add_action( 'mr_after_auto_placement', 'mr_check_auto_placement2', 10, 3); |
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
{ | |
"type" : 3, | |
"imageUrl": "https://danielpowney.com/wp-content/uploads/2017/05/photo-1434396505260-9ec0d649179 | |
} |
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
{ | |
"type":2, | |
"title":"Choose one", | |
"replies":[ | |
"A", | |
"B", | |
"C", | |
"D" | |
] | |
} |
NewerOlder