Documentation

Didn't find anything? Ask your questions in the forum.
Documentation Filters helpful_pre_{name}

helpful_pre_{name}

Help: If you do not know how to execute or save your own PHP code, you can find help here: How to execute PHP code on your WordPress website

These filters can be used to manipulate texts after Helpful has prepared them. This does not affect all options, so there is no general filter for this.

The possible filters for the helpful_pre_{name} can be found here:

/**
 * This message is shown once the user has voted pro.
 * 
 * @param string $content
 * @param int $post_id
 * 
 * @return string
 */
add_filter( 'helpful_pre_after_pro', function( $content, $post_id ) {
	return $content;
}, 10, 2 );

/**
 * This message is shown once the user has voted contra.
 * 
 * @param string $content
 * @param int $post_id
 * 
 * @return string
 */
add_filter( 'helpful_pre_after_contra', function( $content, $post_id ) {
	return $content;
}, 10, 2 );

/**
 * This message is shown as soon as the user has voted, but Helpful cannot detect whether with pro or contra.
 * 
 * @param string $content
 * @param int $post_id
 * 
 * @return string
 */
add_filter( 'helpful_pre_after_fallback', function( $content, $post_id ) {
	return $content;
}, 10, 2 );

/**
 * This message is shown if the user has already voted and a feedback form be shown.
 * 
 * @param string $content
 * @param int $post_id
 * 
 * @return string
 */
add_filter( 'helpful_pre_feedback_message_voted', function( $content, $post_id ) {
	return $content;
}, 10, 2 );

/**
 * Renders the entire form, or the messages. If you want to overwrite this, you can do it with this.
 * 
 * @param string $content
 * @param int $post_id
 * 
 * @return string
 */
add_filter( 'helpful_pre_feedback', function( $content, $post_id ) {
	return $content;
}, 10, 2 );

/**
 * Manipulates everything that is rendered by Helpful after submitting feedback.
 * 
 * @param string $content
 * @param int $post_id
 * 
 * @return string
 */
add_filter( 'helpful_pre_save_feedback', function( $content, $post_id ) {
	return $content;
}, 10, 2 );

/**
 * Manipulates everything that is rendered by Helpful after clicking Pro or Contra.
 * 
 * @param string $content
 * @param int $post_id
 * 
 * @return string
 */
add_filter( 'helpful_pre_save_vote', function( $content, $post_id ) {
	return $content;
}, 10, 2 );

/**
 * Renders the text that is shown when Helpful detects that spam is being submitted or a bot is submitting the form. This is checked by Helpful to a honeypot.
 * 
 * @param string $content
 * @param int $post_id
 * 
 * @return string
 */
add_filter( 'helpful_pre_feedback_message_spam', function( $content, $post_id ) {
	return $content;
}, 10, 2 );

/**
 * This can be used to manipulate the amount of feedback. The number is used in some places in Helpful and there is no reason to manipulate it. But you can.
 * 
 * @param string $content
 * @param int $post_id
 * 
 * @return string
 */
add_filter( 'helpful_pre_get_feedback_count', function( $content, $post_id ) {
	return $content;
}, 10, 2 );

/**
 * This can be used to manipulate the e-mail that is sent using Helpful to admins. The template is only used if it has not been changed in the settings!
 * 
 * @param string $content
 * 
 * @return string
 */
add_filter( 'helpful_pre_get_email_content', function( $content ) {
	return $content;
}, 10, 2 );

/**
 * This can be used to manipulate the e-mail that is sent using Helpful to voters. The template is only used if it has not been changed in the settings!
 * 
 * @param string $content
 * 
 * @return string
 */
add_filter( 'helpful_pre_get_email_content_voter', function( $content ) {
	return $content;
}, 10, 2 );

Was this post helpful?