automator_setup_action_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_action_logs( $current_tab, $args = array() ) {

	$headings = array(
		/* translators: Log column. */
		'action_title'      => esc_attr__( 'Action', 'uncanny-automator' ),
		/* translators: Log column. The action completion date */
		'action_date'       => esc_attr__( 'Date', 'uncanny-automator' ),
		/* translators: Log column. The action status */
		'action_completed'  => esc_attr__( 'Status', 'uncanny-automator' ),
		/* translators: Log column. */
		'error_message'     => esc_attr__( 'Notes', '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. */
		'display_name'      => esc_attr__( 'User', 'uncanny-automator' ), // linked

	);

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

	$sortables = array(
		'action_title'      => array( 'action_title', true ),
		'action_date'       => array( 'action_date', true ),
		'action_completed'  => array( 'action_completed', true ),
		'error_message'     => array( 'error_message', 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 ),
		'display_name'      => array( 'display_name', true ),
	);

	$sortables = apply_filters( 'automator_setup_action_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();
}