wp_list_pages()
is for formatted markup. Use get_pages()
and wp_list_pluck()
:
$pages = get_pages(
array (
'parent' => 0, // replaces 'depth' => 1,
'exclude' => '3,5,11'
)
);
$ids = wp_list_pluck( $pages, 'ID' );
$ids
holds an array of page IDs now.
Related Posts:
- How can I hide children of draft pages using wp_list_pages()?
- How to List All Pages (With their template names) Within a Website
- How can I list all pages with their templates?
- Add Parent to List of Subpages
- Add class to the items in wp_list_pages
- Display grandchildren on child and grandchild pages using wp_list_pages
- Load parent pages when there are no child pages
- create shortcode to show children if any otherwise siblings
- dynamically limit depth of wp_list_pages
- Conditional styling of wp_list_pages bullet points [closed]
- Setting multiple values to as sort_column
- wp_list_pages – Using a Walker to customize output order
- Custom category listings
- How can I include private pages in a page list?
- Do Not Display Parent Page if No Subpages
- Arrange Combined List of Pages and Categories
- List pages within a certain parent and show published month
- Change Parent Name with wp_list_pages?
- List all Posts under heading in wp_list_pages menu
- $item->url not retrieving url in custom walker?
- WordPress Side Navigation with Parent Heading and Child Sub Pages
- List subpage of subpage
- wp_list_page with something like showpost
- How can I list all page titles and IDs?
- Hide Parent if No Children
- Add Parent to Subpage List
- active parent page when clicked on childpage
- alternating classes on wp_list_pages
- remove auto generated pages from the menu?
- Inset image thumbnail from page into list
- How to prevent custom walker from creating sub navigation for pages that are not relatives of the current page?
- Exclude current page in wp_list_pages
- Sub Navigation in Sidebar
- wp_list_pages bug in “number” parameter
- Targeting specific instane of wp_list_pages
- Renaming wp_list_pages class
- wp_list_pages issue/bug?
- WordPress get_pages sub nav show current page
- Change class name in WordPress wp_list_page nav
- Non page link in wp_list_pages
- only display Pages which have children
- add a.parent in wp_list_pages
- wp_list_pages by taxonomy?
- wp_list_pages Format only on Recently Modified Pages
- Adding custom class names to anchor in wp_list_pages
- Walker Class : extract function and wp_list_pages
- Exclude pages by custom field (with yes/no) storing wrong data?
- How to get Author ID outside the loop
- get all posts ID from a category
- Get previously visited page ID
- What is an alternative to get_page_by_title()?
- Get page id by title?
- How to add the category ID to admin page
- How to hook wp_list_pages?
- $post->ID displays wrong ID
- Show ids of displayed media library items
- Get the post_id of a new post
- Does the menu item ID ever change?
- How to get user_id from wordpress database inside ajax function?
- No link on empty page in wp_list_pages
- URL scheme to retrieve tag archive by ID
- get menu id using its name
- How to create a link to jump to “Leave a comment” part?
- Why ids in urls don’t work but slugs do?
- wp_list_pages: only show subpages on the parent page?
- Check if someone recently commented in one of my posts
- Populate meta select box with child pages
- Append a code when at the current page in wp_list_pages()
- How to add ID attribute to each submenu?
- Search results posts_orderby and ID
- Combining ‘depth’ with ‘include’ in wp_list_pages()
- Get the ID of the direct parent page
- how would i change post->ID to work correctly when querying pages?
- Single-page wordpress theme navigation
- get term id from term name
- How can I exclude a specific ID from this line of code?
- Displaying pages with a specific custom meta
- php return username of currently viewed author profile
- How do post IDs work in WordPress?
- How to get custom image field of specific post id
- Getting subpage of subpage – Custom posts
- Display posts from an array of ID’s
- Why is my insert row only inserting the final row from the loop into the database rather than just inserting one
- Custom Post Type with Sequence ID
- How to block specific user id in custom login form?
- Retrieve array items without page ID
- Reuse old post ID for new post after deleting post
- get_current_user_id() always return 0 in if else statement
- Create a list of pages excluding children of selected page
- Get attachment URL from attachment Link in WordPress
- How can i take all ids from untrash_post action?
- PHP: Why does my code work in index.php but not a widget?
- Store All Post Categories In Array
- Changing starting number of User ID
- Get current post’s child page?
- unused post IDs
- WordPress function breaks widget’s markup?
- Query specific posts from parent by slug rather ID
- WordPress loop: Display if posts exist
- Set a minimal number for next user_id