In most this confusion, my primary objective would be to show some menu products within the frontend that link wherever I would like (susceptible to blocking).

To get this done, When i first researched the code in wp_list_pages() and discovered it known as get_pages() which utilizes the (excellent wordpress mechanism) filter known as get_pages.

This enables me to inject fake pages when needed (based on filter) which in turn causes wordpress to create the web pages. Here's my code to date:

function k2f_wp_frontend_menus($pages,$query){
    if(!CmsHost::cms()->is_admin()){ // do this only when user's not an admin
        // TODO: Play with $query to modify our returned pages.
        //       I'll fill in this code later on.
        foreach(CmsHost_wordpress::$menu_list as $id=>$item){
            // the following variables make menu-in-an-array handling easier
            // $id (int) - The ID of this menu item
            // $pid (int|null) - ID of parent menu item or null if none
            // $name (string) - Name of menu item.
            // $text (string) - Short description of menu item.
            // $icons (object) - Multi-sized icon object (not used in this case).
            // $handler (array) - ClassMethod or Function used to handle request
            //                    (used to generate menu item URL).
            pid+=900000; $id+=900000; // <-- ???
                'ID' => $id,
                'post_author' => 1, // <-- should I use 0?
                'post_date' => date('Y-m-d H:i:s'),
                'post_date_gmt' => date('Y-m-d H:i:s'),
                'post_content' => '', // <-- TODO: if post_id==-id call page content
                'post_title' => $name,
                'post_excerpt' => '',
                'post_status' => 'publish',
                'comment_status' => 'closed',
                'ping_status' => 'closed',
                'post_password' => '',
                'post_name' => sanitize_title($name), // <-- Doesn't work
                'to_ping' => '',
                'pinged' => '',
                'post_modified' => date('Y-m-d H:i:s'),
                'post_modified_gmt' => date('Y-m-d H:i:s'),
                'post_content_filtered' => '',
                'post_parent' => $pid,
                'guid' => md5(''.$id), // <-- is this correct?
                'menu_order' => '0',
                'post_type' => 'page',
                'post_mime_type' => '',
                'comment_count' => 0,
                'filter' => 'raw' // <-- what's this for?
    return $pages;

add_filter('get_pages' ,'k2f_wp_frontend_menus',10,2);

You will find 6 difficulties with this code (each marked having a <--):

  1. I needed to prevent collisions with wordpress page IDs. Using a wide array because the base offset works for the short term. I attempted utilizing a string and an adverse offset (-100) but both unsuccessful. Suggestions?
  2. User ID 1 may be the admin user. Wouldn't it seem sensible (and legal even) to make use of ? These fake pages would be the product of plug ins, hence separate from any user.
  3. Because the pages are dynamic, I am unable to render this content except when $post_id == $my_post_id. This is comparable to wordpress theme pages, instead of static pages. I am comfortable with this, just want to know your ideas about this.
  4. This really is allegedly the slug which along with the site url, makes wordpress create the menu item's URL. Although the function itself works nicely, wordpress will not write the hyperlink.
  5. I've no clue why anybody want a GUID given a the page ID has already been unique. May have skipped something myself?
  6. Documentation does not appear to express anything relating to this. Should you could shed any light on its use, you can advise.

Well that's all. The greater questions you answer, the more likely you're to win this little contest :P.

Helpful links: