WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#9622 closed defect (bug) (invalid)

widget class optimization suggestion

Reported by: Denis-de-Bernardy Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Optimization Keywords: needs-patch 2nd-opinion
Focuses: Cc:

Description

one optimization I do in all of my plugins, is this:

if ( is_admin() ) {
  echo $before_title . $title . $after_title;
  return;
}

this might be worth doing directly in the WP_Widget class, no?

alternatively, there could be some kind of admin() callback. the point is, it makes no sense to process the entire widget (which can be slow for rss widgets) when only the title is needed.

Change History (2)

comment:1 ryan5 years ago

The new UI doesn't show the title next to the name of the widget. Do we even call widget() from the backend now?

comment:2 azaozz5 years ago

  • Milestone 2.8 deleted
  • Resolution set to invalid
  • Status changed from new to closed

No, widget() is not called from the backend, also %BEG_OF_TITLE% and %END_OF_TITLE% are deprecated (not used) but are still set for back-compat as some widgets check for them.

Note: See TracTickets for help on using tickets.