Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#11842 closed enhancement (fixed)

general-template.php echo/return fixes

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

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

Download all attachments as: .zip

Change History (13)

ShaneF3 years ago

ShaneF3 years ago

removed 'ob_end_clean()'

  • Milestone changed from 2.9.2 to 3.0

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

  • Cc sirzooro added

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

ShaneF3 years ago

added code from '#10575'

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.

Copy that. Making the change...

ShaneF3 years ago

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

ShaneF3 years ago

for master rboren

comment:7   ryan3 years ago

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

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.