- Timestamp:
- 08/26/2021 12:53:27 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/classes/class-bp-messages-notice.php
r11293 r13096 19 19 */ 20 20 class BP_Messages_Notice { 21 21 22 /** 22 23 * The notice ID. 23 24 * 25 * @var int|null 26 */ 27 public $id = null; 28 29 /** 30 * The subject line for the notice. 31 * 32 * @var string 33 */ 34 public $subject; 35 36 /** 37 * The content of the notice. 38 * 39 * @var string 40 */ 41 public $message; 42 43 /** 44 * The date the notice was created. 45 * 46 * @var string 47 */ 48 public $date_sent; 49 50 /** 51 * Whether the notice is active or not. 52 * 24 53 * @var int 25 54 */ 26 public $id = null;27 28 /**29 * The subject line for the notice.30 *31 * @var string32 */33 public $subject;34 35 /**36 * The content of the notice.37 *38 * @var string39 */40 public $message;41 42 /**43 * The date the notice was created.44 *45 * @var string46 */47 public $date_sent;48 49 /**50 * Whether the notice is active or not.51 *52 * @var int53 */54 55 public $is_active; 55 56 … … 62 63 */ 63 64 public function __construct( $id = null ) { 64 if ( $id) {65 if ( ! empty( $id ) ) { 65 66 $this->id = (int) $id; 66 67 $this->populate(); … … 72 73 * 73 74 * Runs during constructor. 75 * 76 * @global BuddyPress $bp The one true BuddyPress instance. 77 * @global wpdb $wpdb WordPress database object. 74 78 * 75 79 * @since 1.0.0 … … 93 97 * Saves a notice. 94 98 * 99 * @global BuddyPress $bp The one true BuddyPress instance. 100 * @global wpdb $wpdb WordPress database object. 101 * 95 102 * @since 1.0.0 96 103 * … … 174 181 * Deletes a notice. 175 182 * 183 * @global BuddyPress $bp The one true BuddyPress instance. 184 * @global wpdb $wpdb WordPress database object. 185 * 176 186 * @since 1.0.0 177 187 * … … 215 225 * 216 226 * To get all notices, pass a value of -1 to pag_num. 227 * 228 * @global BuddyPress $bp The one true BuddyPress instance. 229 * @global wpdb $wpdb WordPress database object. 217 230 * 218 231 * @since 1.0.0 … … 223 236 * @type int $pag_page The page number. Defaults to 1. 224 237 * } 225 * @return objectList of notices to display.238 * @return array List of notices to display. 226 239 */ 227 240 public static function get_notices( $args = array() ) { … … 253 266 * @since 2.8.0 254 267 * 255 * @param array $r Array of parameters. 268 * @param array $notices List of notices sorted by date and paginated. 269 * @param array $r Array of parameters. 256 270 */ 257 271 return apply_filters( 'messages_notice_get_notices', $notices, $r ); … … 261 275 * Returns the total number of recorded notices. 262 276 * 277 * @global BuddyPress $bp The one true BuddyPress instance. 278 * @global wpdb $wpdb WordPress database object. 279 * 263 280 * @since 1.0.0 264 281 * … … 276 293 * 277 294 * @since 2.8.0 278 */ 279 return (int) apply_filters( 'messages_notice_get_total_notice_count', $notice_count ); 295 * 296 * @param int $notice_count Total number of recorded notices. 297 */ 298 return apply_filters( 'messages_notice_get_total_notice_count', (int) $notice_count ); 280 299 } 281 300 … … 283 302 * Returns the active notice that should be displayed on the front end. 284 303 * 285 * @since 1.0.0 286 * 287 * @return object The BP_Messages_Notice object. 304 * @global BuddyPress $bp The one true BuddyPress instance. 305 * @global wpdb $wpdb WordPress database object. 306 * 307 * @since 1.0.0 308 * 309 * @return BP_Messages_Notice 288 310 */ 289 311 public static function get_active() { … … 305 327 * 306 328 * @since 2.8.0 329 * 330 * @param BP_Messages_Notice $notice The notice object. 307 331 */ 308 332 return apply_filters( 'messages_notice_get_active', $notice );
Note: See TracChangeset
for help on using the changeset viewer.