• Hello, I am using your plugin and it does a great work, thank you.

    I am generating a .doc file with the entries of a custom post type and ACF but the email field, of course protected with your plugin, gives me as output *protected email*.
    The code that I am using is the following (of course I omit the code not pertinent to this post):

    <?php $args = array(
            'post_type' => 'my_post_type',
            'post_status' => 'publish',
            'posts_per_page' => -1,
            'orderby' => 'title',
            'order' => 'ASC',
        );
    
        $loop = new WP_Query( $args );
    
        while ( $loop->have_posts() ) : $loop->the_post();
    
     while ( have_rows( 'main_acf_group' ) ) : the_row();
       the_sub_field( 'email' );
     endwhile;

    Can you give me any help?
    Thank you
    Alberto

    • This topic was modified 4 years, 2 months ago by symbolily.
    • This topic was modified 4 years, 2 months ago by symbolily.
Viewing 1 replies (of 1 total)
  • Hi @symbolily – good question!
    You could try to use the following filter to prevent the encoding from happening:
    apply_filters( 'eeb/validate/is_post_excluded', $return, $post_id, $skip_posts );
    This filter is called within the EEB()->validate->is_post_excluded() function and usually prevents specific posts from firing. The $return variable contains a bool – simply set it to true to prevent the post from being encoded.

Viewing 1 replies (of 1 total)

The topic ‘Avoid *protected email* in php output’ is closed to new replies.