Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Add filter to determine if certain posts should excluded
- add_filter( 'toplytics_exclude_post', 'check_if_topolytics_should_exclude', 10, 2 );
- function check_if_topolytics_should_exclude( $should_exclude, $post_id ) {
- $excluded_posts = get_peta_excluded_posts();
- if ( in_array( $post_id, $excluded_posts ) ) {
- $should_exclude = true;
- }
- return $should_exclude;
- }
- function display_my_post() {
- // filter checks if post should be excluded
- $exclude_post = apply_filters( 'toplytics_exclude_post', false, $post_id );
- if ( true === $exclude_post ) {
- // Post should be excluded - do not process this post
- return;
- }
- // Continue displaying post if it's not excluded
- // ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement