WordPress.org

Support

Support » Plugins and Hacks » Document Feedback » [Resolved] Adding Feedback to Posts using Filters

[Resolved] Adding Feedback to Posts using Filters

  • I am trying to add document feedback prompt to posts. I know there is a filter for that so I am trying to apply that filter using this in my theme’s functions.php file but it is not working. I think I am using the wrong syntax, can you please provide an example of how to add posts?

    $feedback_post_types = array(
    'post',
    'page',
    );
    apply_filters('document_feedback_post_types', $feedback_post_types);

    http://wordpress.org/extend/plugins/document-feedback/

Viewing 1 replies (of 1 total)
  • Plugin Contributor Mario Peshev

    @nofearinc

    The apply_filters is used for ‘applying’ added filters, so you need to add a callback function with add_filter that returns your post types, more specifically:

    function your_document_feedback_post_types( $post_types ) {
        $feedback_post_types = array(
            'post',
            'page',
        );
    
        return $feedback_post_types;
    }
    
    add_filter( 'document_feedback_post_types', 'your_document_feedback_post_types' );
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Adding Feedback to Posts using Filters’ is closed to new replies.
Skip to toolbar