Proper scheduled post translation (work in progress)
-
This follows from the recent thread about scheduled posts. Tumblr does now support explicit scheduling (not sure when it happened), although they haven’t seen fit to actually document the API for it.
So, to schedule something it just goes into
queue
status as already happens, but you set apublish_on
value rather thandate
(via this Tumblr API Google Group thread). This turned out to be a very small edit in tumblr-crosspostr.php, eg.:473d472 < 'date' => get_post_time('Y-m-d H:i:s', true, $post_id) . ' GMT', 476a476,482 > > if ($state == 'queue') { > $common_params['publish_on'] = get_post_time('Y-m-d H:i:s', true, $post_id) . ' GMT'; > } else { > $common_params['date'] = get_post_time('Y-m-d H:i:s', true, $post_id) . ' GMT'; > } >
I’ve already tested this with a couple of items, and it works, but there’s one (non-blocking, I think?) issue:
Because WordPress doesn’t lock down pretty permalinks until after publish, the content source gets set as something like
https://example.com/?post_type=[POST_TYPE]&p=[POST_ID]
WordPress does resolve these to your pretty URLs upon visit, so it doesn’t break anything, but it’s a bit less than ideal. (The same issue comes up if you’re using something like the Yoast SEO feature that tacks on the “originally posted at yoursite.com” footer.)I’m not sure if there’s any way to resolve this since the Tumblr post is created at time of scheduling and the content source value isn’t editable later, at least not through the browser interface. On the other hand, it’s not a huge problem since strictly speaking those actually are the “real” URLs of the WP posts.
Another option could be to not schedule these posts at Tumblr and instead just do an immediate publish when the actual WordPress one goes out, but I have no immediate idea how feasible/complicated that would be to implement, and I’m guessing Meitar might object to that as being against concept.
- The topic ‘Proper scheduled post translation (work in progress)’ is closed to new replies.