Private posts in menus
-
I like your plugin but there is a limitation due to the way Worpress treats Private Posts in menus : it ignores them for authorized users as well as for non authorized. It is even worse when a given category or a given month has only Private Posts : that category or that month is completely missing from the menus in the widgets. It becomes very difficult to access the correponding private posts for authorized users.
Is there a way to add a filter in the theme functions.php file to force the widget to display thoses categories or those months with only Private Posts in the menus. I have fond in the forum such a filter ( for categories ) but for some reason it does not work :add_filter( 'widget_categories_args', 'show_private_post_in_widget' ); function show_private_post_in_widget( $cat_args ) { if( current_user_can( 'read_private_posts' ) ) { $cat_args['hide_empty'] = 0; } return $cat_args; }
I am a beginner in programing so I am unable to see what’s wrong. Could you please have a look and supply us with a filter that would work both for categories and months. Thank you for you help.
There is something similar here :
https://www.ads-software.com/support/topic/showing-private-pages-in-default-page-menu?replies=5Regards
https://www.ads-software.com/plugins/wp-jv-post-reading-groups/
- The topic ‘Private posts in menus’ is closed to new replies.