Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#35393 closed enhancement (wontfix)

should "publish_future_post" be "wp_publish_future_post"?

Reported by: ixmati's profile 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
8 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
8 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.