',
esc_attr( $target_icon ),
esc_html( $target_label )
);
// Build the translated sentence with flex container for vertical alignment.
return sprintf(
/* translators: %1$s: Fee or Discount tag HTML, %2$s: Target tag HTML (e.g., Checkout, Line Item, Shipping) */
'' . __( 'Apply a %1$s to %2$s', 'surecart' ) . '',
$type_tag,
$target_tag
);
}
/**
* Get row actions.
*
* @param \SureCart\Models\AutoFee $auto_fees Auto Fee model.
*
* @return array
*/
public function getRowActions( $auto_fees ) {
return $this->row_actions(
array_filter(
[
'edit' => '' . esc_html__( 'Edit', 'surecart' ) . '',
'delete' => '' . esc_html__( 'Delete', 'surecart' ) . '',
]
)
);
}
/**
* Displays extra table navigation.
*
* @param string $which Top or bottom placement.
*/
protected function extra_tablenav( $which ) {
?>
mode_dropdown();
/**
* Fires before the Filter button on the Auto fees list tables.
*
* The Filter button allows sorting by date and/or category on the
* auto fees list table, and sorting by date on the Pages list table.
*
* @since 2.1.0
* @since 4.4.0 The `$post_type` parameter was added.
* @since 4.6.0 The `$which` parameter was added.
*
* @param string $post_type The post type slug.
* @param string $which The location of the extra table nav markup:
* 'top' or 'bottom' for WP_Posts_List_Table,
* 'bar' for WP_Media_List_Table.
*/
do_action( 'restrict_manage_auto_fees', $this->screen->post_type, $which );
$output = ob_get_clean();
if ( ! empty( $output ) ) {
echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
submit_button( __( 'Filter', 'surecart' ), '', 'filter_action', false, array( 'id' => 'filter-by-mode-submit' ) );
}
}
?>