NUKnightLab / TimelineJS-Wordpress-Plugin

A simple shortcode plugin to add the Timeline to Wordpress
Other
207 stars 50 forks source link

Custom Post Type and Metabox #25

Closed hermpheus closed 3 years ago

hermpheus commented 12 years ago

Hello Verite/Zach Wise,

I love the Timeline.js plugin, and thought that it would be helpful to have a complete WordPress backend, avoiding Google Docs entirely (and also saving your servers a bit of load).

The modifications I've made set up a custom post type called Timeline which uses a metabox (created through WP Alchemy) for all the values associated with an entry. A datepicker is used for the dates and WP's media uploader is available for the media URL. There is an option to set a particular entry as the intro slide.

I also set up a transient to cache the Timeline when it is generated, for performance reasons. When the custom post type is saved it is updated and set to last for a month.

I hope that you can find this contribution helpful and a bit more accessible for WordPress users. If you find any problems with it please let me know.

I recommend looking at the diff rather than my commits - I'm still getting used to the idea of atomic, progressive Git commits.

Thank you.

zachwise commented 12 years ago

This looks great! We're working on updating the plugin, I'm going to have @scott2b take a look.

scott2b commented 12 years ago

Andrew, this looks really cool. Thank you for your contribution. I am able to get this setup and create new Timeline post entries, however, I do not quite see how I am to create a timeline from the entries. Is there a URL exposed that I am supposed to specify as the source to a timeline?

Thanks, Scott

hermpheus commented 12 years ago

Scott, I tried to keep it backwards compatible with the old plugin, so I left everything the same, including the src attribute for the shortcode. However, if you just leave the src attribute blank it will pull the custom post type instead.

All the best, Andrew Freeman

scott2b commented 12 years ago

I have no idea how to rebase an external pull request to a remote branch, and this code was out of sync with the current code. Thus, I did a copy paste number into the Canary branch. Made some tweaks. Original code was over-writing itself in building the json structure. Added a thumbnail field. Added type=json hack to ajax URL so timeline recognizes it. Put in a remove_filter to deal with smart quotes which were just displaying as raw codes.