WordPress.org

Support

Support » Plugins and Hacks » Hacks » get list of posts in widget admin panel?

get list of posts in widget admin panel?

  • I’m trying to put together a widget that can present a user with a list posts in a particular custom post type as a dropdown. I’ve gone over the basic widget creation steps and I’m comfortable with that – creating the display, showing a form, saving and retrieving options. What I’m unclear on is how to run a query on the admin side of the widget. I’d like to get a list of posts matching my criteria (ie: post type, is published) which I could then spit out in a loop and put in a select dropdown.

    Any pointers? Google is showing me how to do this on the user-facing side of the widget, but nothing on the admin side.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    @bcworkz

    The process is the same, except instead of the code to get the posts and build the dropdown being in the widget() method, it is in the form() method.

Viewing 1 replies (of 1 total)
  • The topic ‘get list of posts in widget admin panel?’ is closed to new replies.
Skip to toolbar