• Resolved jdavidstark

    (@jdavidstark)


    I’m using the following code snippet to attempt to change the default post time to 7:00 am

    update_option( 'edcal_default_time', '07:00' );

    When I click “new post” in the editorial calendar, the default time then shows correctly as 7:00 am.

    But if I drag a draft post onto the calendar from the unscheduled list, I can’t seem to get the calendar to give it a default time of 7:00 am. Whatever time I use in the code snippet, I seem to get various other times when dragging a draft post onto the calendar (9am, 1pm, etc.), but never 7 am. This happens even with post drafts that don’t have a time set on them (i.e., “Publish” is just set to “Immediately”).

    Is there some other code I need to add to get the default time I want to apply to draft posts dragged onto the calendar as well?

    Thank you so much!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Zack Grossbart

    (@zgrossbart)

    Thank you for using the Editorial Calendar. When a post goes into the drafts drawer is still has a time. You can see that time if you go to the details of that post in the standard WordPress editing screen. When you drag that post out of the drafts drawer it keeps the same time that it had when it went in and only the date changes. Right now there’s no way to override that behavior.

    How do you think should work work? If a post has a time when you drag it to the drafts drawer should you lose it and revert back to the default time?

    Thread Starter jdavidstark

    (@jdavidstark)

    Yes, getting the default time to override whatever draft time is the behavior I would have expected.

    I can see the logic in the current setup certainly. But if I mean to set a time for the post via its own post details (not the editorial calendar), then I probably also am going to pick a date for it at that time. By contrast, if I haven’t yet assigned a date, I probably don’t care too much about the time that happens to be assigned via the post details (which could then be overridden with the editorial calendar’s default time).

    To me, that seems a preferable way to have the feature work. But what you’re describing as the current rationale for why it works as it does does certainly make sense as well.

    Thanks so much for all your efforts on developing this very useful tool!

    Plugin Author Zack Grossbart

    (@zgrossbart)

    The problem we ran into is that WordPress doesn’t support a post without a time. Every new post that gets created has a time. That makes it very difficult for the calendar to tell if a given post has a time that you care about or now.

    I’m going to poke around a little and see if I can find a better way to handle this.

    Thank you for using the calendar. I’m glad it’s been helpful for you.

    Thread Starter jdavidstark

    (@jdavidstark)

    Got it. Thanks for looking into it.

    I did happen to think that it looks like a scheduled post will already appear on the calendar by definition. A draft post might appear there or in “unscheduled drafts.” But when a draft post appears on the calendar, it no longer appears in “unscheduled drafts.”

    I don’t code more than hacking out a minor change here or there. But this made me start wondering whether a workflow like what I’ve described above couldn’t be supported pretty easily by a user adding a custom code snippet like what I’ve done with update_option above.

    The snippet would do something like

    1. When post status changes from "unscheduled draft" to "scheduled draft" (i.e., on the calendar) then
    2. Overwrite the saved post time with the calendar default post time

    I may be very wrong, but from using the plugin, it looks like there’s already a way of detecting 1. And there’s already a way of writing the a new default time to be the time for a post on the calendar. So there would just need to be something to link the two together to achieve 2.

    That said, I don’t know what that code snippet would look like. But if it’s an optional snippet users can install that just blanket stamps the default time on anything moving from “unscheduled” to “scheduled,” that would support this workflow without a code change to the plugin itself and without disrupting a workflow that relies on the draft time being retained.

    I don’t know if these thoughts might be helpful at all. But I thought I’d post them in case they may.

    Thanks again for your work on this very helpful tool.

    Plugin Author Zack Grossbart

    (@zgrossbart)

    Those comments make a lot of sense. Thank you for thinking it through. Here’s the case I’m worried about.

    1. Your default post time is 10:00
    2. You create a new post, assign it to a specific date, and set the post time to 11:00
    3. Now you drag that post into the drafts drawer
    4. Then you drag it out to a different day

    At this point should the time for your post be 10:00 or 11:00? If you had just dragged it from the first day to the second day directly it would have kept the time as 11:00. It feels strange to have a different behavior just because you stopped in the drafts drawer along the way.

    Thread Starter jdavidstark

    (@jdavidstark)

    Hmmm … that’s a good point. I suppose I’d say the post time at step 4 should be the default time of 10:00. If I wanted to retain the non-default time at 11:00, I should just drag the post to a different day on the calendar without a stop to the drafts drawer in the middle. (I could even make this a day very far in the future if I just wanted to not reset the time that much but needed a place to put the post where it wouldn’t publish.)

    That said, I follow the rule of always posting at the same time of day. So for me, if I get some other time thrown in the mix, that’s almost certainly a mistake. At any rate, it’s so rare as to be fine just to modify (again if need be) once the post is on the calendar or via the post details.

    So I’d be okay with adding a “custom times die when a post comes out of the drafts drawer” code snippet.

    Thanks so much for your thoughts about this issue as well.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘edcal_default_time’ is closed to new replies.