WordPress.org

Ready to get started?Download WordPress

Forums

plugin [EXCLUDE PAGES] and apply filters with non standard get_pages (4 posts)

  1. Zentode
    Member
    Posted 5 years ago #

    wp2.7.1
    my own server

    I have seen how to exclude a specific page from a custom header menu using exclude pages in the menu building function below but, I cannot find how to apply the:

    $pages = apply_filters( 'get_pages', $pages );

    when a non standard menu building function is used. eg:

    <?php function get_the_pa_ges() {
    global $wpdb;
    if ( ! $these_pages = wp_cache_get('these_pages', 'pages') ) {
    $these_pages = $wpdb->get_results('select ID, post_title from '. $wpdb->posts .' where post_status = "publish" and post_type = "page" order by menu_order');
    }
    return $these_pages;
    }
    function list_all_pages(){
    $all_pages = get_the_pa_ges ();
    /*$all_pages = apply_filters(get_the_pa_ges ());*/
    foreach ($all_pages as $thats_all){
    $the_page_id = $thats_all->ID;
    if (is_page($the_page_id)) {
    $addclass = ' class="current_page"';
    } else {
    $addclass = '';
    }
    $output .= '<li' . $addclass . '><a href="'.get_permalink($thats_all->ID).'" title="'.$thats_all->post_title.'"><span>'.$thats_all->post_title.'</span></a></li>';
    }
    return $output;
    }
    ?>

    I tried several methods on my own with no luck. I searched and searched to no avail.

    How can i apply the exclude pages filter to the function above?

    Any clues for me folks?

    Thanks in advance for your assistance.

  2. Zentode
    Member
    Posted 5 years ago #

    Please???

  3. Zentode
    Member
    Posted 5 years ago #

    Wow, first time I never got a answer here!
    I am working on this. Hope I can figure it out..
    If I do I will post it here.

  4. Jbert
    Member
    Posted 5 years ago #

    Hi there,

    I sent out three emails on this also will let you know if i find out anything

Topic Closed

This topic has been closed to new replies.

About this Topic