0

wp_dropdown_pages() while using for any post type other then page returns empty string. Codex says post type can be passed as key also the function uses get_pages() which takes the post_type key. So, I don't see why it isn't working for me.

    $args = array(
        'echo' => 1,
        'name' => 'my_posts',
        'post_type' => 'post',
        'show_option_none' => 'any'
    );
    $select = wp_dropdown_pages($args);

Any idea?

0

On the same codex page:

With the 'post_type' parameter you can get a drop down of any post type, including custom post types, as long as the post type in question is hierarchical.

post != hierachical. That's the answer. :)

  • damn it! :) Memory recall, I knew that!! – Sisir Jul 3 '14 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.