BP_Messages_Notices_List_Table::column_subject( object $item )

Generates content for the “subject” column.


Parameters Parameters

$item

(object) (Required) The current item


Source 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( 'users.php' ) ), 'messages-activate-notice-' . $item->id ) ),
				(int) $item->id,
				esc_html__( 'Activate Notice', 'buddypress' ) ),
			'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( 'users.php' ) ), 'messages-delete-notice-' . $item->id ) ),
				(int) $item->id,
				esc_html__( 'Delete Notice', 'buddypress' ) )
		);

		if ( ! empty( $item->is_active ) ) {
			/* translators: %s: notice subject */
			$item->subject = sprintf( _x( 'Active: %s', 'Tag prepended to active site-wide notice titles on WP Admin notices list table', 'buddypress' ), $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( 'users.php' ) ), 'messages-deactivate-notice-' . $item->id ) ),
				(int) $item->id,
				esc_html__( 'Deactivate Notice', 'buddypress' ) );
		}

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


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.