Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator t-p

    (@t-p)

    A WordPress private post is blocked from the public. Those with the right user access are able to see the private post if they log into the WordPress dashboard.

    Hence not shown in the Latest Posts Widget

    If a post is shown in the Latest Posts Widget, then its not private anymore?

    Thread Starter d3d5x1

    (@deraxia)

    Thanks for the reply. The private posts would still be private. A logged out user would see them listed in the widget and be redirected to a 404 page when they click on them, unless you use a plugin like this as I do:
    https://www.ads-software.com/plugins/lh-private-content-login/

    In which case they would be redirected to wp-login.

    I’m already achieving this behavior with the classic latest posts widget before WP 5.8 using this code:

    function filter_recent_posts_widget_parameters($args) {
       $args['post_status'] = array( 'publish', 'private' );
       return $args;
    }

    I’m just wondering what the filter is for the new widget.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Private Posts in Latest Posts Widget’ is closed to new replies.