automator_setup_trigger_logs( $current_tab, array $args = array() )


Parameters Parameters

$current_tab

(Required)

$args

(array) (Optional)

Default value: array()


Source Source

File: src/core/includes/recipe-logs-view.php

function automator_setup_trigger_logs( $current_tab, $args = array() ) {

	$headings = array(
		/* translators: Log column. */
		'trigger_title'      => esc_attr__( 'Trigger', 'uncanny-automator' ),
		/* translators: Log column. The trigger completion date */
		'trigger_date'       => esc_attr__( 'Completion date', 'uncanny-automator' ),
		/* translators: Log column. */
		'recipe_title'       => esc_attr__( 'Recipe', 'uncanny-automator' ),
		/* translators: Log column. */
		'recipe_completed'   => esc_attr__( 'Recipe status', 'uncanny-automator' ),
		/* translators: Log column. */
		'recipe_date_time'   => esc_attr__( 'Recipe completion date', 'uncanny-automator' ),
		/* translators: Log column. Noun. The recipe iteration */
		'recipe_run_number'  => esc_attr__( 'Recipe run #', 'uncanny-automator' ),
		/* translators: Log column. Noun. The trigger iteration */
		'trigger_run_number' => esc_attr__( 'Trigger run #', 'uncanny-automator' ),
		/* translators: Log column. */
		'display_name'       => esc_attr__( 'User', 'uncanny-automator' ),
	);

	$headings = wp_parse_args( $args, $headings );

	$sortables = array(
		'trigger_title'      => array( 'trigger_title', true ),
		'trigger_date'       => array( 'trigger_date', true ),
		'recipe_title'       => array( 'recipe_title', true ),
		'recipe_completed'   => array( 'recipe_completed', true ), // linked
		'recipe_date_time'   => array( 'recipe_date_time', true ),
		'recipe_run_number'  => array( 'recipe_run_number', true ),
		'trigger_run_number' => array( 'trigger_run_number', false ),
		'display_name'       => array( 'display_name', true ),
	);

	$sortables = apply_filters('automator_setup_trigger_logs_sortables', $sortables);

	//Prepare Table of elements
	$wp_list_table = new Logs_List_Table();
	$wp_list_table->set_columns( $headings );
	$wp_list_table->set_sortable_columns( $sortables );
	$wp_list_table->set_tab( $current_tab );
	$wp_list_table->prepare_items();
	$wp_list_table->display();
}