How to dynamically change the name of the review

By default, the product name for the review box can be set up in the "Product name" option from the WPPR settings and is independent of the post title.  

Using the info from this document you will be able to change the product name of the review whenever you change the title of the post. You don't have to change both post title and product name. Changing the post title will dynamically change the product name of the review.

Here you have a code snippet that will do the trick:

add_filter( 'wppr_name','wppr_name_filter_demo',10,3 );

function wppr_name_filter_demo( $name, $id ) {
    // by default is used the cwp_rev_product_name meta field
    // you can use this filter to change it to the post title and add the proper formatting
    return apply_filters( 'wppr_review_product_name_html' , get_the_title( $id ) );
}

* NOTE: We highly recommend not to make any changes in the original plugin file, as it might break when updated. To make this work, create a fix plugin and there, add this code snippet.

Here's an example plugin that you can use: WPPR Review Name Change

Here's an example:

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us