WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 9 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:
PR Number:

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 10 years ago.
11842.2.diff (7.1 KB) - added by ShaneF 10 years ago.
removed 'ob_end_clean()'
11842.3.diff (7.3 KB) - added by ShaneF 10 years ago.
added code from '#10575'
11842.4.diff (7.7 KB) - added by ShaneF 10 years ago.
11842.5.2.diff (8.0 KB) - added by ShaneF 10 years ago.
for master rboren

Download all attachments as: .zip

Change History (13)

@ShaneF
10 years ago

@ShaneF
10 years ago

removed 'ob_end_clean()'

#1 @westi
10 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.

#2 @sirzooro
10 years ago

  • Cc sirzooro added

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

@ShaneF
10 years ago

added code from '#10575'

#3 @sirzooro
10 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.

#4 @ShaneF
10 years ago

Copy that. Making the change...

@ShaneF
10 years ago

#5 @ShaneF
10 years ago

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

@ShaneF
10 years ago

for master rboren

#7 @ryan
10 years ago

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

#8 @hakre
9 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.