WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#35393 closed enhancement (wontfix)

should "publish_future_post" be "wp_publish_future_post"?

Reported by: ixmati Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4.1
Component: Cron API Keywords:
Focuses: Cc:

Description

I notice that other WP cron jobs called are prefixed by "wp_", but not "publish_future_post", which makes it harder to see that this job is part of WP core.

Change History (2)

#1 @ericlewis
5 years ago

  • Component changed from General to Cron API
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Hi @ixmati, thanks for opening this ticket and welcome to WordPress Trac!

I notice that other WP cron jobs called are prefixed by "wp_", but not "publish_future_post", which makes it harder to see that this job is part of WP core.

Although it does not have the wp_* prefix, it is in the WordPress core software, so hopefully this explains that it is part of core.

The WordPress project has a commitment to backwards compatibility. Renaming the event could be a breaking change — a plugin could expect the event to be named publish_future_post, and changing it would break the plugin. @nacin has a good note on not refactoring code if we don't have to, which is a good read.

#2 @ixmati
5 years ago

OK, understood. Thanks for the explanation and the read.

I was thinking maybe something like an alias so the code could become more standardized and be backward compatible:

use function wp_publish_future_post as publish_future_post;

But inspired by @nacin, I'll file this personally under "Code should not be rewritten under the cloaks of readability, narrow personal opinion, or general subjectiveness."

Note: See TracTickets for help on using tickets.