Making WordPress.org

Changeset 4809


Ignore:
Timestamp:
01/27/2017 03:45:59 PM (10 years ago)
Author:
iandunn
Message:

Official WordPress Events: Return shortcode output to fix display bug

Shortcodes are supposed to return output rather than printing it. This bug wasn't obvious when make/Community was using the p2 theme because of its particular layout, but when the site switched to o2 the bug because obvious, because the output was not being displayed at all.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/official-wordpress-events/official-wordpress-events.php

    r4808 r4809  
    5050         */
    5151        public function render_events() {
     52                $output = '';
    5253                $events = $this->group_events_by_date( $this->get_all_events() );
    5354
    5455                if ( $events ) {
     56                        ob_start();
    5557                        require_once( __DIR__ . '/template-events.php' );
    56                 }
     58                        $output = ob_get_flush();
     59                }
     60
     61                return $output;
    5762        }
    5863
Note: See TracChangeset for help on using the changeset viewer.