ericmann / WP-Publication-Archive

Allows users to upload, manage, search, and download publications, documents, and similar content (PDF, Power-Point, etc.) in WordPress.
http://wordpress.org/extend/plugins/wp-publication-archive/
27 stars 12 forks source link

Rudimentary widget to list publications, with helper utility method to query posts #20

Closed MatthewEppelsheimer closed 11 years ago

MatthewEppelsheimer commented 11 years ago

The utility method WP_Publication_Archive::query_publications() may need some explanation. It's used by the widget to query publications before a loop. Why not just write that code directly into the widget? Because in time it can be re-used for front-end display elsewhere in the plugin — possibly to rewrite the shortcode's existing rendering code — and it allows third party plugins and templates a convenience method to write their own custom display code.

If you like this idea, it'll be a more powerful with companion utilities to handles loops, which will accept template callbacks.(Companion utilities will include default templates to be passed as callbacks. Again, this allows third parties a convenient means to modify output for their own purposes in their own theme and plugin contexts.)

I can attack addition of the utilities within the next few days, as this will be useful on some front-burner projects. Using this new code to revise existing front-end display code in the shortcode can happen in time… Along the way, I'll add some filters for even more flexibility.

… and if this make no sense — because I am admittedly writing quickly in a somewhat brain-fried mode after a long day — hit me up via email or tele and we can chat.