Support » Plugin: User Verification » The get_page() function excludes private pages

  • Resolved unalignedcoder



    you use the get_pages() function to populate the list of pages to redirect to, after verification.
    However, this function by default lists only “published” pages, but not “private” ones.

    This is counter-intuitive in this context since, once a user has registered and has logged in, you might want to show them a private page that they couldn’t access previously.

    I would recommend adding arguments to your get_pages(), like so:

    	$args = array(
    	'sort_order' => 'asc',
    	'sort_column' => 'post_title',
    	'hierarchical' => 1,
    	'exclude' => '',
    	'include' => '',
    	'meta_key' => '',
    	'meta_value' => '',
    	'authors' => '',
    	'child_of' => 0,
    	'parent' => -1,
    	'exclude_tree' => '',
    	'number' => '',
    	'offset' => 0,
    	'post_type' => 'page',
    	'post_status' => 'publish,private'
        foreach( get_pages($args) as $page )

    The last argument in the array allows for private pages to be listed. All the other arguments displayed here are the default ones.
    I’ve tested the above in your plugin and it works.

    • This topic was modified 2 years, 11 months ago by .
    • This topic was modified 2 years, 11 months ago by .
Viewing 1 replies (of 1 total)
  • Plugin Author PickPlugins


    Thanks for the idea,

    I just update plugin, please try latest version 1.0.16 let me know the result.


Viewing 1 replies (of 1 total)
  • The topic ‘The get_page() function excludes private pages’ is closed to new replies.