Automattic\WooCommerce\Internal\StockNotifications\Admin
ListTable::get_views
Items of the subsubsub status menu.
Method of the class: ListTable{}
No Hooks.
Returns
array.
Usage
// protected - for code of main (parent) or child class $result = $this->get_views();
ListTable::get_views() ListTable::get views code WC 11.2.2
protected function get_views() {
$status_links = array();
// All view.
$class = ! empty( $_REQUEST['status'] ) && 'all_customer_stock_notifications' === $_REQUEST['status'] ? 'current' : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$all_inner_html = sprintf(
/* translators: %s: Notifications count */
_nx(
'All <span class="count">(%s)</span>',
'All <span class="count">(%s)</span>',
$this->total_items,
'notifications_status',
'woocommerce'
),
number_format_i18n( $this->total_items )
);
$status_links['all'] = $this->get_link( array( 'status' => 'all_customer_stock_notifications' ), $all_inner_html, $class );
// Active view.
$class = ! empty( $_REQUEST['status'] ) && 'active_customer_stock_notifications' === $_REQUEST['status'] ? 'current' : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$active_inner_html = sprintf(
/* translators: %s: Notifications count */
_nx(
'Active <span class="count">(%s)</span>',
'Active <span class="count">(%s)</span>',
$this->total_active_items,
'notifications_status',
'woocommerce'
),
number_format_i18n( $this->total_active_items )
);
$status_links['active'] = $this->get_link( array( 'status' => 'active_customer_stock_notifications' ), $active_inner_html, $class );
// Sent view.
$class = ! empty( $_REQUEST['status'] ) && 'sent_customer_stock_notifications' === $_REQUEST['status'] ? 'current' : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$sent_inner_html = sprintf(
/* translators: %s: Notifications count */
_nx(
'Sent <span class="count">(%s)</span>',
'Sent <span class="count">(%s)</span>',
$this->total_sent_items,
'notifications_status',
'woocommerce'
),
number_format_i18n( $this->total_sent_items )
);
$status_links['sent'] = $this->get_link( array( 'status' => 'sent_customer_stock_notifications' ), $sent_inner_html, $class );
// Cancelled view.
$class = ! empty( $_REQUEST['status'] ) && 'cancelled_customer_stock_notifications' === $_REQUEST['status'] ? 'current' : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$cancelled_inner_html = sprintf(
/* translators: %s: Notifications count */
_nx(
'Cancelled <span class="count">(%s)</span>',
'Cancelled <span class="count">(%s)</span>',
$this->total_cancelled_items,
'notifications_status',
'woocommerce'
),
number_format_i18n( $this->total_cancelled_items )
);
$status_links['cancelled'] = $this->get_link( array( 'status' => 'cancelled_customer_stock_notifications' ), $cancelled_inner_html, $class );
// Pending view.
$class = ! empty( $_REQUEST['status'] ) && 'pending_customer_stock_notifications' === $_REQUEST['status'] ? 'current' : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$pending_inner_html = sprintf(
/* translators: %s: Notifications count */
_nx(
'Pending <span class="count">(%s)</span>',
'Pending <span class="count">(%s)</span>',
$this->total_pending_items,
'notifications_status',
'woocommerce'
),
number_format_i18n( $this->total_pending_items )
);
$status_links['pending'] = $this->get_link( array( 'status' => 'pending_customer_stock_notifications' ), $pending_inner_html, $class );
return $status_links;
}