<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][5708] trunk/bp-core/bp-core-classes.php: PHP5'ize bp-core-classes.php - Set methods as public, private, static, and kill off PHP4 constructors.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://buddypress.trac.wordpress.org/changeset/5708">5708</a></dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2012-02-11 04:18:44 +0000 (Sat, 11 Feb 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>PHP5'ize bp-core-classes.php - Set methods as public, private, static, and kill off PHP4 constructors.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcoreclassesphp">trunk/bp-core/bp-core-classes.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcorebpcoreclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-classes.php (5707 => 5708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-classes.php        2012-02-11 03:36:06 UTC (rev 5707)
+++ trunk/bp-core/bp-core-classes.php        2012-02-11 04:18:44 UTC (rev 5708)
</span><span class="lines">@@ -108,14 +108,7 @@
</span><span class="cx">          */
</span><span class="cx">         var $total_groups;
</span><span class="cx">
</span><del>-        /**
-         * PHP4 constructor.
-         *
-         * @see BP_Core_User::__construct()
-         */
-        function bp_core_user( $user_id, $populate_extras = false ) {
-                $this->__construct( $user_id, $populate_extras );
-        }
</del><ins>+        /** Public Method*s *******************************************************/
</ins><span class="cx">
</span><span class="cx">         /**
</span><span class="cx">          * Class constructor.
</span><span class="lines">@@ -123,16 +116,19 @@
</span><span class="cx">          * @param integer $user_id The ID for the user
</span><span class="cx">          * @param boolean $populate_extras Whether to fetch extra information such as group/friendship counts or not.
</span><span class="cx">          */
</span><del>-        function __construct( $user_id, $populate_extras = false ) {
-                if ( $user_id ) {
</del><ins>+        public function __construct( $user_id, $populate_extras = false ) {
+                if ( !empty( $user_id ) ) {
</ins><span class="cx">                         $this->id = $user_id;
</span><span class="cx">                         $this->populate();
</span><span class="cx">
</span><del>-                        if ( $populate_extras )
</del><ins>+                        if ( !empty( $populate_extras ) ) {
</ins><span class="cx">                                 $this->populate_extras();
</span><ins>+                        }
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        /** Private Methods *******************************************************/
+
</ins><span class="cx">         /**
</span><span class="cx">          * Populate the instantiated class with data based on the User ID provided.
</span><span class="cx">          *
</span><span class="lines">@@ -143,7 +139,7 @@
</span><span class="cx">          * @uses bp_core_fetch_avatar() Returns HTML formatted avatar for a user
</span><span class="cx">          * @uses bp_profile_last_updated_date() Returns the last updated date for a user.
</span><span class="cx">          */
</span><del>-        function populate() {
</del><ins>+        private function populate() {
</ins><span class="cx">
</span><span class="cx">                 if ( bp_is_active( 'xprofile' ) )
</span><span class="cx">                         $this->profile_data = $this->get_profile_data();
</span><span class="lines">@@ -176,7 +172,7 @@
</span><span class="cx">         /**
</span><span class="cx">          * Populates extra fields such as group and friendship counts.
</span><span class="cx">          */
</span><del>-        function populate_extras() {
</del><ins>+        private function populate_extras() {
</ins><span class="cx">
</span><span class="cx">                 if ( bp_is_active( 'friends' ) ) {
</span><span class="cx">                         $this->total_friends = BP_Friends_Friendship::total_friend_count( $this->id );
</span><span class="lines">@@ -188,13 +184,13 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        function get_profile_data() {
</del><ins>+        private function get_profile_data() {
</ins><span class="cx">                 return BP_XProfile_ProfileData::get_all_for_user( $this->id );
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        /** Static Functions ******************************************************/
</del><ins>+        /** Static Methods ********************************************************/
</ins><span class="cx">
</span><del>-        function get_users( $type, $limit = 0, $page = 1, $user_id = 0, $include = false, $search_terms = false, $populate_extras = true, $exclude = false, $meta_key = false, $meta_value = false ) {
</del><ins>+        public static function get_users( $type, $limit = 0, $page = 1, $user_id = 0, $include = false, $search_terms = false, $populate_extras = true, $exclude = false, $meta_key = false, $meta_value = false ) {
</ins><span class="cx">                 global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx">                 $sql = array();
</span><span class="lines">@@ -221,7 +217,7 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                $sql['from'] = "FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON um.user_id = u.ID";
</del><ins>+                $sql['from'] = "FROM {$wpdb->users} u LEFT JOIN {$wpdb->usermeta} um ON um.user_id = u.ID";
</ins><span class="cx">
</span><span class="cx">                 // We search against xprofile fields, so we must join the table
</span><span class="cx">                 if ( $search_terms && bp_is_active( 'xprofile' ) ) {
</span><span class="lines">@@ -259,7 +255,7 @@
</span><span class="cx">                         $sql['where_exclude'] = "AND u.ID NOT IN ({$exclude})";
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( $include ) {
</del><ins>+                if ( !empty( $include ) ) {
</ins><span class="cx">                         if ( is_array( $include ) ) {
</span><span class="cx">                                 $uids = $wpdb->escape( implode( ',', (array)$include ) );
</span><span class="cx">                         } else {
</span><span class="lines">@@ -269,7 +265,7 @@
</span><span class="cx">                         if ( !empty( $uids ) ) {
</span><span class="cx">                                 $sql['where_users'] = "AND u.ID IN ({$uids})";
</span><span class="cx">                         }
</span><del>-                } elseif ( $user_id && bp_is_active( 'friends' ) ) {
</del><ins>+                } elseif ( !empty( $user_id ) && bp_is_active( 'friends' ) ) {
</ins><span class="cx">                         $friend_ids = friends_get_friend_user_ids( $user_id );
</span><span class="cx">                         $friend_ids = $wpdb->escape( implode( ',', (array)$friend_ids ) );
</span><span class="cx">
</span><span class="lines">@@ -282,12 +278,12 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( $search_terms && bp_is_active( 'xprofile' ) ) {
</del><ins>+                if ( !empty( $search_terms ) && bp_is_active( 'xprofile' ) ) {
</ins><span class="cx">                         $search_terms = like_escape( $wpdb->escape( $search_terms ) );
</span><span class="cx">                         $sql['where_searchterms'] = "AND spd.value LIKE '%%$search_terms%%'";
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( $meta_key ) {
</del><ins>+                if ( !empty( $meta_key ) ) {
</ins><span class="cx">                         $sql['where_meta'] = $wpdb->prepare( " AND umm.meta_key = %s", $meta_key );
</span><span class="cx">
</span><span class="cx">                         // If a meta value is provided, match it
</span><span class="lines">@@ -314,7 +310,7 @@
</span><span class="cx">                                 break;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( $limit && $page ) {
</del><ins>+                if ( !empty( $limit ) && !empty( $page ) ) {
</ins><span class="cx">                         $sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -381,7 +377,7 @@
</span><span class="cx">          * @return mixed False on error, otherwise associative array of results.
</span><span class="cx">          * @static
</span><span class="cx">          */
</span><del>-        function get_users_by_letter( $letter, $limit = null, $page = 1, $populate_extras = true, $exclude = '' ) {
</del><ins>+        public static function get_users_by_letter( $letter, $limit = null, $page = 1, $populate_extras = true, $exclude = '' ) {
</ins><span class="cx">                 global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx">                 $pag_sql = '';
</span><span class="lines">@@ -443,7 +439,7 @@
</span><span class="cx">          * @return array Associative array
</span><span class="cx">          * @static
</span><span class="cx">          */
</span><del>-        function get_specific_users( $user_ids, $limit = null, $page = 1, $populate_extras = true ) {
</del><ins>+        public static function get_specific_users( $user_ids, $limit = null, $page = 1, $populate_extras = true ) {
</ins><span class="cx">                 global $wpdb;
</span><span class="cx">
</span><span class="cx">                 $pag_sql = '';
</span><span class="lines">@@ -488,7 +484,7 @@
</span><span class="cx">          * @return array Associative array
</span><span class="cx">          * @static
</span><span class="cx">          */
</span><del>-        function search_users( $search_terms, $limit = null, $page = 1, $populate_extras = true ) {
</del><ins>+        public static function search_users( $search_terms, $limit = null, $page = 1, $populate_extras = true ) {
</ins><span class="cx">                 global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx">                 $pag_sql = $limit && $page ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * intval( $limit ) ), intval( $limit ) ) : '';
</span><span class="lines">@@ -531,7 +527,7 @@
</span><span class="cx">          * @return mixed False on error, otherwise associative array of results.
</span><span class="cx">          * @static
</span><span class="cx">          */
</span><del>-        function get_user_extras( &$paged_users, &$user_ids, $type = false ) {
</del><ins>+        public static function get_user_extras( &$paged_users, &$user_ids, $type = false ) {
</ins><span class="cx">                 global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx">                 if ( empty( $user_ids ) )
</span><span class="lines">@@ -611,7 +607,7 @@
</span><span class="cx">          * @return array Associative array
</span><span class="cx">          * @static
</span><span class="cx">          */
</span><del>-        function get_core_userdata( $user_id ) {
</del><ins>+        public static function get_core_userdata( $user_id ) {
</ins><span class="cx">                 global $wpdb;
</span><span class="cx">
</span><span class="cx">                 if ( !$user = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE ID = %d LIMIT 1", $user_id ) ) )
</span><span class="lines">@@ -687,76 +683,72 @@
</span><span class="cx">          */
</span><span class="cx">         var $is_new;
</span><span class="cx">
</span><ins>+        /** Public Methods ********************************************************/
</ins><span class="cx">
</span><span class="cx">         /**
</span><del>-         * PHP4 constructor
-         *
-         * @param integer $id
-         */
-        function bp_core_notification( $id = 0 ) {
-                $this->__construct($id);
-        }
-
-        /**
</del><span class="cx">          * Constructor
</span><span class="cx">          *
</span><span class="cx">          * @param integer $id
</span><span class="cx">          */
</span><del>-        function __construct( $id = 0 ) {
-                if ( $id ) {
</del><ins>+        public function __construct( $id = 0 ) {
+                if ( !empty( $id ) ) {
</ins><span class="cx">                         $this->id = $id;
</span><span class="cx">                         $this->populate();
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /**
</span><del>-         * Fetches the notification data from the database.
-         *
-         * @global object $bp Global BuddyPress settings object
-         * @global wpdb $wpdb WordPress database object
-         */
-        function populate() {
-                global $bp, $wpdb;
-
-                if ( $notification = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE id = %d", $this->id ) ) ) {
-                        $this->item_id = $notification->item_id;
-                        $this->secondary_item_id = $notification->secondary_item_id;
-                        $this->user_id = $notification->user_id;
-                        $this->component_name = $notification->component_name;
-                        $this->component_action = $notification->component_action;
-                        $this->date_notified = $notification->date_notified;
-                        $this->is_new = $notification->is_new;
-                }
-        }
-
-        /**
</del><span class="cx">          * Update or insert notification details into the database.
</span><span class="cx">          *
</span><span class="cx">          * @global object $bp Global BuddyPress settings object
</span><span class="cx">          * @global wpdb $wpdb WordPress database object
</span><span class="cx">          * @return bool Success or failure
</span><span class="cx">          */
</span><del>-        function save() {
</del><ins>+        public function save() {
</ins><span class="cx">                 global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx">                 // Update
</span><del>-                if ( $this->id )
</del><ins>+                if ( !empty( $this->id ) ) {
</ins><span class="cx">                         $sql = $wpdb->prepare( "UPDATE {$bp->core->table_name_notifications} SET item_id = %d, secondary_item_id = %d, user_id = %d, component_name = %s, component_action = %d, date_notified = %s, is_new = %d ) WHERE id = %d", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new, $this->id );
</span><span class="cx">
</span><span class="cx">                 // Save
</span><del>-                else
</del><ins>+                } else {
</ins><span class="cx">                         $sql = $wpdb->prepare( "INSERT INTO {$bp->core->table_name_notifications} ( item_id, secondary_item_id, user_id, component_name, component_action, date_notified, is_new ) VALUES ( %d, %d, %d, %s, %s, %s, %d )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new );
</span><ins>+                }
</ins><span class="cx">
</span><span class="cx">                 if ( !$result = $wpdb->query( $sql ) )
</span><span class="cx">                         return false;
</span><span class="cx">
</span><span class="cx">                 $this->id = $wpdb->insert_id;
</span><ins>+
</ins><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        /** Static functions ******************************************************/
</del><ins>+        /** Private Methods *******************************************************/
</ins><span class="cx">
</span><del>-        function check_access( $user_id, $notification_id ) {
</del><ins>+        /**
+         * Fetches the notification data from the database.
+         *
+         * @global object $bp Global BuddyPress settings object
+         * @global wpdb $wpdb WordPress database object
+         */
+        private function populate() {
+                global $bp, $wpdb;
+
+                if ( $notification = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE id = %d", $this->id ) ) ) {
+                        $this->item_id = $notification->item_id;
+                        $this->secondary_item_id = $notification->secondary_item_id;
+                        $this->user_id = $notification->user_id;
+                        $this->component_name = $notification->component_name;
+                        $this->component_action = $notification->component_action;
+                        $this->date_notified = $notification->date_notified;
+                        $this->is_new = $notification->is_new;
+                }
+        }
+
+        /** Static Methods ********************************************************/
+
+        public static function check_access( $user_id, $notification_id ) {
</ins><span class="cx">                 global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx">                 return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->core->table_name_notifications} WHERE id = %d AND user_id = %d", $notification_id, $user_id ) );
</span><span class="lines">@@ -772,7 +764,7 @@
</span><span class="cx">          * @return array Associative array
</span><span class="cx">          * @static
</span><span class="cx">          */
</span><del>-        function get_all_for_user( $user_id, $status = 'is_new' ) {
</del><ins>+        public static function get_all_for_user( $user_id, $status = 'is_new' ) {
</ins><span class="cx">                 global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx">                 $is_new = 'is_new' == $status ? ' AND is_new = 1 ' : '';
</span><span class="lines">@@ -790,7 +782,7 @@
</span><span class="cx">          * @param string $component_action
</span><span class="cx">          * @static
</span><span class="cx">          */
</span><del>-        function delete_for_user_by_type( $user_id, $component_name, $component_action ) {
</del><ins>+        public static function delete_for_user_by_type( $user_id, $component_name, $component_action ) {
</ins><span class="cx">                 global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx">                 return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND component_name = %s AND component_action = %s", $user_id, $component_name, $component_action ) );
</span><span class="lines">@@ -808,7 +800,7 @@
</span><span class="cx">          * @param integer $secondary_item_id (optional) The secondary item id of the notifications that we wish to use to delete.
</span><span class="cx">          * @static
</span><span class="cx">          */
</span><del>-        function delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
</del><ins>+        public static function delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
</ins><span class="cx">                 global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx">                 $secondary_item_sql = !empty( $secondary_item_id ) ? $wpdb->prepare( " AND secondary_item_id = %d", $secondary_item_id ) : '';
</span><span class="lines">@@ -826,7 +818,7 @@
</span><span class="cx">          * @param string $component_action The action of the component the notification was sent from.
</span><span class="cx">          * @static
</span><span class="cx">          */
</span><del>-        function delete_from_user_by_type( $user_id, $component_name, $component_action ) {
</del><ins>+        public static function delete_from_user_by_type( $user_id, $component_name, $component_action ) {
</ins><span class="cx">                 global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx">                 return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE item_id = %d AND component_name = %s AND component_action = %s", $user_id, $component_name, $component_action ) );
</span><span class="lines">@@ -843,7 +835,7 @@
</span><span class="cx">          * @param string $secondary_item_id Optional secondary item id that the notifications are to have.
</span><span class="cx">          * @static
</span><span class="cx">          */
</span><del>-        function delete_all_by_type( $item_id, $component_name, $component_action, $secondary_item_id ) {
</del><ins>+        public static function delete_all_by_type( $item_id, $component_name, $component_action, $secondary_item_id ) {
</ins><span class="cx">                 global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx">                 if ( $component_action )
</span><span class="lines">@@ -995,12 +987,8 @@
</span><span class="cx">          * @param array $args
</span><span class="cx">          * @return bool False if not allowed
</span><span class="cx">          */
</span><del>-        function bp_button( $args = '' ) {
-                $this->__construct($args);
-        }
</del><ins>+        public function __construct( $args = '' ) {
</ins><span class="cx">
</span><del>-        function __construct( $args = '' ) {
-
</del><span class="cx">                 // Default arguments
</span><span class="cx">                 $defaults = array(
</span><span class="cx">                         'id' => '',
</span><span class="lines">@@ -1103,7 +1091,7 @@
</span><span class="cx">          *
</span><span class="cx">          * @return string
</span><span class="cx">          */
</span><del>-        function contents() {
</del><ins>+        public function contents() {
</ins><span class="cx">                 return $this->contents;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1112,7 +1100,7 @@
</span><span class="cx">          *
</span><span class="cx">          * Output contents of button
</span><span class="cx">          */
</span><del>-        function display() {
</del><ins>+        public function display() {
</ins><span class="cx">                 if ( !empty( $this->contents ) )
</span><span class="cx">                         echo $this->contents;
</span><span class="cx">         }
</span><span class="lines">@@ -1128,12 +1116,13 @@
</span><span class="cx"> * @see WP_Embed
</span><span class="cx"> */
</span><span class="cx"> class BP_Embed extends WP_Embed {
</span><ins>+
</ins><span class="cx">         /**
</span><span class="cx">          * Constructor
</span><span class="cx">          *
</span><span class="cx">          * @global unknown $wp_embed
</span><span class="cx">          */
</span><del>-        function __construct() {
</del><ins>+        public function __construct() {
</ins><span class="cx">                 global $wp_embed;
</span><span class="cx">
</span><span class="cx">                 // Make sure we populate the WP_Embed handlers array.
</span><span class="lines">@@ -1182,7 +1171,7 @@
</span><span class="cx">          * @param string $url The URL attempting to be embeded.
</span><span class="cx">          * @return string The embed HTML on success, otherwise the original URL.
</span><span class="cx">          */
</span><del>-        function shortcode( $attr, $url = '' ) {
</del><ins>+        public function shortcode( $attr, $url = '' ) {
</ins><span class="cx">                 if ( empty( $url ) )
</span><span class="cx">                         return '';
</span><span class="cx">
</span><span class="lines">@@ -1247,7 +1236,7 @@
</span><span class="cx">          * @param array $rawattr Untouched shortcode attributes from {@link WP_Embed::shortcode()}.
</span><span class="cx">          * @return string The embed HTML on success, otherwise the original URL.
</span><span class="cx">          */
</span><del>-        function parse_oembed( $id, $url, $attr, $rawattr ) {
</del><ins>+        public function parse_oembed( $id, $url, $attr, $rawattr ) {
</ins><span class="cx">                 $id = intval( $id );
</span><span class="cx">
</span><span class="cx">                 if ( $id ) {
</span><span class="lines">@@ -1280,4 +1269,5 @@
</span><span class="cx">                 return $this->maybe_make_link( $url );
</span><span class="cx">         }
</span><span class="cx"> }
</span><del>-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+
+?>
</ins></span></pre>
</div>
</div>
</body>
</html>