Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_all_page_ids [ WordPress Function ]

get_all_page_ids ( No parameters )
Uses:
  • $wpdb
Returns:
  • (array) List of page IDs.
Defined at:



Get a list of page IDs.

Source


<?php
function get_all_page_ids() {
    global 
$wpdb;

    
$page_ids wp_cache_get('all_page_ids''posts');
    if ( ! 
is_array$page_ids ) ) {
        
$page_ids $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'page'");
        
wp_cache_add('all_page_ids'$page_ids'posts');
    }

    return 
$page_ids;
}
?>

Examples [ wp-snippets.com ]

Top Google Search Results

More ...

User discussions [ wordpress.org ]

0 User Note(s)

None yet. Be the first!

Add New ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics