WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#11842 closed enhancement (fixed)

general-template.php echo/return fixes

Reported by: ShaneF Owned by: ShaneF
Milestone: 3.0 Priority: low
Severity: minor Version: 2.9.1
Component: Formatting Keywords: has-patch commit tested
Focuses: Cc:

Description

There are 3 functions that does have a way to 'return' data:

  • get_search_form
  • wp_register
  • get_calendar

This patch has all the changes. Tested and working! ;-)

Attachments (5)

11842.diff (7.1 KB) - added by ShaneF 6 years ago.
11842.2.diff (7.1 KB) - added by ShaneF 6 years ago.
removed 'ob_end_clean()'
11842.3.diff (7.3 KB) - added by ShaneF 6 years ago.
added code from '#10575'
11842.4.diff (7.7 KB) - added by ShaneF 6 years ago.
11842.5.2.diff (8.0 KB) - added by ShaneF 6 years ago.
for master rboren

Download all attachments as: .zip

Change History (13)

@ShaneF6 years ago

@ShaneF6 years ago

removed 'ob_end_clean()'

comment:1 @westi6 years ago

  • Milestone changed from 2.9.2 to 3.0

As a code tidy up this shouldn't be done in a Maintenance release.

comment:2 @sirzooro6 years ago

  • Cc sirzooro added

Related: #10575. Path attached to that ticket also adds get_calendar filter.

@ShaneF6 years ago

added code from '#10575'

comment:3 @sirzooro6 years ago

There is one more thing to fix - at the beginning get_calendar() checks if there is a cached version exists, and if yes it takes and displays it. You should also check $echo and use get_calendar filter there.

comment:4 @ShaneF6 years ago

Copy that. Making the change...

@ShaneF6 years ago

comment:5 @ShaneF6 years ago

  • Owner set to ShaneF
  • Status changed from new to accepted

@ShaneF6 years ago

for master rboren

comment:7 @ryan6 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

comment:8 @hakre5 years ago

Keep in mind that there are output buffer functions in PHP and you can use echo to deal for anything in case that's not provided by the original function:

ob_start();
function_that_echos();
$ouput = ob_get_clean();

and

echo function_that_returns();

Related: #7352

Note: See TracTickets for help on using tickets.