• Good morning

    I have a client site with a lot of pages that are archival. When creating a new page, in Edit Page/Page Attributes/Parent, there are huge lists of pages. Is there any way to remove the pages that are archival in nature and just leave the current pages visible when Parent is clicked?

    I use the plugin Exclude Pages but unticking a page still leaves it in the list under Parent. I know this just restricts it from the nav menu but am hoping there is something that can do similar for the list in the Parent section.

    I did find this:http://phpwpinfo.com/wordpress-limit-pages-displayed-in-the-parent-page-drop-down/ but this account is apparently suspended. Has anyone used this plugin?

    Thanks

    • This topic was modified 9 years, 3 months ago by Jasnick.
    • This topic was modified 9 years, 3 months ago by Jasnick.
Viewing 5 replies - 1 through 5 (of 5 total)
  • how are those ‘archival’ pages defined?

    there is a filter applied to the ‘Parent’ page list arguments, which you might be able to use to exlude pages from the list.

    i.e., if you hve a list of page IDs to be excluded, try this example code, to be added to functions.php of your theme:

    add_filter( 'page_attributes_dropdown_pages_args', 'page_attributes_parent_exclude_archival_pages' );
    
    function page_attributes_parent_exclude_archival_pages( $args ) {
    	$args['exclude'] = array( 2, 713, 2059 );
    	return $args;
    }
    Thread Starter Jasnick

    (@jasnick)

    Thank you Michael

    I am not very technical but assume ( 2, 723, 2059) are page ID’s?
    Yes I can try that.

    Where you mention _archival_ pages: currently these pages are just ordinary pages – what does “archival” mean in this context?

    Thank you!

    what does “archival” mean in this context?

    I am just using your words:

    a lot of pages that are archival.

    what I meant to find out was, do these pages have anything in common which could be used to automatically get all of them, without needing to find each page ID?

    Thread Starter Jasnick

    (@jasnick)

    At the moment they are organized in quarterly groups:
    Page title: Stories Jan-Mar 2016 with say 20 individual pages with Stories Jan-Mar 2016 as the Parent.
    Then another page: Stories Apr-May 2016 with all its individual pages.
    And so on.
    There is really nothing to distinguish them from any other page on the site.
    These pages do not need any more editing as they are just stored on the site in case someone wants to see them.
    Thanks

    Thread Starter Jasnick

    (@jasnick)

    Thanks Michael – that worked!
    I wonder if something similar could be applied to widgets? For example, left-sidebar widgets that don’t need to be edited anymore; what sort of hook could be applied to them to remove them from the drop-down list of widgets.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Restricting Page Atribute lists’ is closed to new replies.