Viewing 3 reply threads
  • Author
    Posts
    • #712

      I am trying to create a drop-down page containing all pages, I tried:

      ‘select’
      ,’field’ => ‘mypage’
      ,’label’ => ‘Select a page’
      ,’attributes’ => array(‘class’ => ‘text’)
      ,’choices’ => piklist(
      get_pages(
      array(
      ‘sort_order’ => ‘ASC’,
      ‘sort_column’ => ‘post_title’,
      ‘hierarchical’ => 1,
      ‘post_type’ => ‘page’,
      ‘post_status’ => ‘publish’
      )
      ,’objects’
      )
      ,array(‘id’,’post_title’)
      )
      ));

      but it only shows one page in the dropdown. This is the only file in my plugin. What am I doing wrong?

    • #713
      Steve
      Keymaster

      @alex poslavsky– The database column on the posts table is ID (capitalized… not lower case). Just capitalize it, and it should work.

    • #714

      That was painfully simple, and completely fixed it, thanks!

    • #715
      Steve
      Keymaster

      Awesome!  Closing this ticket.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.