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?
- What’s the WordPress way to get custom HTML for child pages list (with a second relative link)? Currently running regex over wp_list_pages() output
- Get page ID of page that is set as the posts page
- How to get current page ID outside the loop?
- how to get page id of a page using page slug
- get post author id outside loop
- How to get Author ID outside the loop
- Custom Walker: how to get ID in function start_lvl
- How to get page title with the page ID?
- How to get permalink and title from post ID?
- How do I get the current edit page ID in the admin?
- Echo author ID in author.php
- Get page IDs from nav items
- How to get home page ID?
- Are post ID’s reliable?
- Get current post id in functions.php
- Return parent post with its children using WP_Query?
- get all posts ID from a category
- How to obtain the user ID of the current profile being edited in WP-Admin?
- Get previously visited page ID
- Creating a WordPress admin page without a menu for a plugin
- Show just one level of child pages, wp_list_pages woe
- What is an alternative to get_page_by_title()?
- Settings API – creating reusable form elements?
- Get the current post ID as a variable in Javascript
- Is post ID number always incremental n+
- Can’t get post ID in functions.php?
- Shortcode producing headers already sent error
- ID for posts/blogs page
- Get ID of “root-page”
- Get page id by title?
- How to add the category ID to admin page
- Post ID At The End Of Permalink URL Effects Performance (Positively)?
- Importing posts from old website to new conflicting post ID’s?
- Highlighting current item of custom post types’ sub pages, listed by wp_list_pages
- How to hook wp_list_pages?
- Get All IDs Of A Post Type Using WP_Query
- Get user id from email?
- How to change WordPress user ID?
- Is there a way to make a custom Page type?
- How to get page’s ID if I know the title only?
- How does wordpress calculate the page depth?
- Getting the ID of a meta box
- Test if page is child and has children, if so echo child pages also on grandchild pages
- Is there an equivalent of the PHP function sanitize_key in Gutenberg?
- Are all ID’s used unique?
- Ways to give a wp_list_pages menu link specific class names?
- $post->ID displays wrong ID
- How to show only parents subpages of current page item in vertical menu?
- Change ul class=”children” for wp_list_pages?
- Add category to custom post type automatically, using category slug
- How to add active class to custom menu using while loop and wp_list_pages
- how to properly list child pages in sidebar?
- At my posts archive page, outside the loop, get_the_id() returns the top most post’s ID