BP_Messages_Notices_List_Table::column_subject( object $item )

Generates content for the “subject” column.

Description

Parameters

$item

(Required) The current item

Source

File: bp-messages/classes/class-bp-messages-notices-list-table.php

	public function column_subject( $item ) {
		$actions = array(
			'activate_deactivate' => sprintf( '<a href="%s" data-bp-notice-id="%d" data-bp-action="activate">%s</a>', 
				esc_url( wp_nonce_url( add_query_arg( array(
					'page'          => 'bp-notices',
					'notice_action' => 'activate',
					'notice_id'     => $item->id
				), bp_get_admin_url( 'admin.php' ) ), 'messages-activate-notice-' . $item->id ) ),
				(int) $item->id,
				esc_html__( 'Activate Notice', 'buddyboss' ) ),
			'delete' => sprintf( '<a href="%s" data-bp-notice-id="%d" data-bp-action="delete">%s</a>', 
				esc_url( wp_nonce_url( add_query_arg( array(
					'page'          => 'bp-notices',
					'notice_action' => 'delete',
					'notice_id'     => $item->id
				), bp_get_admin_url( 'admin.php' ) ), 'messages-delete-notice-' . $item->id ) ),
				(int) $item->id,
				esc_html__( 'Delete Notice', 'buddyboss' ) )
		);

		if ( ! empty( $item->is_active ) ) {
			$item->subject = sprintf( _x( 'Active: %s', 'Tag prepended to active site-wide notice titles on WP Admin notices list table', 'buddyboss' ), $item->subject );
			$actions['activate_deactivate'] = sprintf( '<a href="%s" data-bp-notice-id="%d" data-bp-action="deactivate">%s</a>', 
				esc_url( wp_nonce_url( add_query_arg( array(
					'page'          => 'bp-notices',
					'notice_action' => 'deactivate',
					'notice_id'     => $item->id
				), bp_get_admin_url( 'admin.php' ) ), 'messages-deactivate-notice-' . $item->id ) ),
				(int) $item->id,
				esc_html__( 'Deactivate Notice', 'buddyboss' ) );
		}

		echo '<strong>' . apply_filters( 'bp_get_message_notice_subject', $item->subject ) . '</strong> ' . $this->row_actions( $actions );
	}

Changelog

Changelog
Version Description
BuddyPress 3.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.