Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#35393 closed enhancement (wontfix)

should "publish_future_post" be "wp_publish_future_post"?

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

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
11 years ago

  • Component General → Cron API
  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status new → 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
11 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.