Change WordPress user roles and capabilities Forums Bug Reports User Access restrict to return 404 error Reply To: User Access restrict to return 404 error

#3565
Vladimir
Keymaster

Hi Giacomo,

A quick fix for the empty 404 page problem is to add lower priority to the URE Pro’s post filter. You can open user-role-editor-pro/pro/includes/classes/content-view-restrictions-posts-list.php and replace line #17


add_action('pre_get_posts', array($this, 'hide_prohibited_posts'));

with this version


add_action('pre_get_posts', array($this, 'hide_prohibited_posts'), 100);

A reason of this conflict the woffice theme applies its posts restrictions filter even if restricted posts list is empty. Applying this filter theme overwrites the same filter set by URE Pro little earlier. So a restricted page exists for WordPress and WP tries to show it, but with empty content as URE does not allow to view content of restricted post here too.