<!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-&gt;__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-&gt;id = $user_id;
</span><span class="cx">                         $this-&gt;populate();
</span><span class="cx"> 
</span><del>-                        if ( $populate_extras )
</del><ins>+                        if ( !empty( $populate_extras ) ) {
</ins><span class="cx">                                 $this-&gt;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-&gt;profile_data = $this-&gt;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-&gt;total_friends = BP_Friends_Friendship::total_friend_count( $this-&gt;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-&gt;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'] = &quot;FROM $wpdb-&gt;users u LEFT JOIN $wpdb-&gt;usermeta um ON um.user_id = u.ID&quot;;
</del><ins>+                $sql['from'] = &quot;FROM {$wpdb-&gt;users} u LEFT JOIN {$wpdb-&gt;usermeta} um ON um.user_id = u.ID&quot;;
</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 &amp;&amp; bp_is_active( 'xprofile' ) ) {
</span><span class="lines">@@ -259,7 +255,7 @@
</span><span class="cx">                         $sql['where_exclude'] = &quot;AND u.ID NOT IN ({$exclude})&quot;;
</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-&gt;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'] = &quot;AND u.ID IN ({$uids})&quot;;
</span><span class="cx">                         }
</span><del>-                } elseif ( $user_id &amp;&amp; bp_is_active( 'friends' ) ) {
</del><ins>+                } elseif ( !empty( $user_id ) &amp;&amp; bp_is_active( 'friends' ) ) {
</ins><span class="cx">                         $friend_ids = friends_get_friend_user_ids( $user_id );
</span><span class="cx">                         $friend_ids = $wpdb-&gt;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 &amp;&amp; bp_is_active( 'xprofile' ) ) {
</del><ins>+                if ( !empty( $search_terms ) &amp;&amp; bp_is_active( 'xprofile' ) ) {
</ins><span class="cx">                         $search_terms             = like_escape( $wpdb-&gt;escape( $search_terms ) );
</span><span class="cx">                         $sql['where_searchterms'] = &quot;AND spd.value LIKE '%%$search_terms%%'&quot;;
</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-&gt;prepare( &quot; AND umm.meta_key = %s&quot;, $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 &amp;&amp; $page ) {
</del><ins>+                if ( !empty( $limit ) &amp;&amp; !empty( $page ) ) {
</ins><span class="cx">                         $sql['pagination'] = $wpdb-&gt;prepare( &quot;LIMIT %d, %d&quot;, 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 &amp;&amp; $page ? $wpdb-&gt;prepare( &quot; LIMIT %d, %d&quot;, 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( &amp;$paged_users, &amp;$user_ids, $type = false ) {
</del><ins>+        public static function get_user_extras( &amp;$paged_users, &amp;$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-&gt;get_row( $wpdb-&gt;prepare( &quot;SELECT * FROM $wpdb-&gt;users WHERE ID = %d LIMIT 1&quot;, $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-&gt;__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-&gt;id = $id;
</span><span class="cx">                         $this-&gt;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-&gt;get_row( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;core-&gt;table_name_notifications} WHERE id = %d&quot;, $this-&gt;id ) ) ) {
-                        $this-&gt;item_id = $notification-&gt;item_id;
-                        $this-&gt;secondary_item_id = $notification-&gt;secondary_item_id;
-                        $this-&gt;user_id           = $notification-&gt;user_id;
-                        $this-&gt;component_name    = $notification-&gt;component_name;
-                        $this-&gt;component_action  = $notification-&gt;component_action;
-                        $this-&gt;date_notified     = $notification-&gt;date_notified;
-                        $this-&gt;is_new            = $notification-&gt;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-&gt;id )
</del><ins>+                if ( !empty( $this-&gt;id ) ) {
</ins><span class="cx">                         $sql = $wpdb-&gt;prepare( &quot;UPDATE {$bp-&gt;core-&gt;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&quot;, $this-&gt;item_id, $this-&gt;secondary_item_id, $this-&gt;user_id, $this-&gt;component_name, $this-&gt;component_action, $this-&gt;date_notified, $this-&gt;is_new, $this-&gt;id );
</span><span class="cx"> 
</span><span class="cx">                 // Save
</span><del>-                else
</del><ins>+                } else {
</ins><span class="cx">                         $sql = $wpdb-&gt;prepare( &quot;INSERT INTO {$bp-&gt;core-&gt;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 )&quot;, $this-&gt;item_id, $this-&gt;secondary_item_id, $this-&gt;user_id, $this-&gt;component_name, $this-&gt;component_action, $this-&gt;date_notified, $this-&gt;is_new );
</span><ins>+                }
</ins><span class="cx"> 
</span><span class="cx">                 if ( !$result = $wpdb-&gt;query( $sql ) )
</span><span class="cx">                         return false;
</span><span class="cx"> 
</span><span class="cx">                 $this-&gt;id = $wpdb-&gt;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-&gt;get_row( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;core-&gt;table_name_notifications} WHERE id = %d&quot;, $this-&gt;id ) ) ) {
+                        $this-&gt;item_id = $notification-&gt;item_id;
+                        $this-&gt;secondary_item_id = $notification-&gt;secondary_item_id;
+                        $this-&gt;user_id           = $notification-&gt;user_id;
+                        $this-&gt;component_name    = $notification-&gt;component_name;
+                        $this-&gt;component_action  = $notification-&gt;component_action;
+                        $this-&gt;date_notified     = $notification-&gt;date_notified;
+                        $this-&gt;is_new            = $notification-&gt;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-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT COUNT(id) FROM {$bp-&gt;core-&gt;table_name_notifications} WHERE id = %d AND user_id = %d&quot;, $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-&gt;query( $wpdb-&gt;prepare( &quot;DELETE FROM {$bp-&gt;core-&gt;table_name_notifications} WHERE user_id = %d AND component_name = %s AND component_action = %s&quot;, $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-&gt;prepare( &quot; AND secondary_item_id = %d&quot;, $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-&gt;query( $wpdb-&gt;prepare( &quot;DELETE FROM {$bp-&gt;core-&gt;table_name_notifications} WHERE item_id = %d AND component_name = %s AND component_action = %s&quot;, $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-&gt;__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'                =&gt; '',
</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-&gt;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-&gt;contents ) )
</span><span class="cx">                         echo $this-&gt;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-&gt;maybe_make_link( $url );
</span><span class="cx">         }
</span><span class="cx"> }
</span><del>-?&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+
+?&gt;
</ins></span></pre>
</div>
</div>

</body>
</html>