automator_setup_recipe_logs( $current_tab )


Parameters Parameters

$current_tab

(Required)


Source Source

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

function automator_setup_recipe_logs( $current_tab ) {
	$headings = array(
		/* translators: Log column. */
		'recipe_type'      => esc_attr__( 'Recipe type', 'uncanny-automator' ),
		/* translators: Log column. */
		'recipe_title'     => esc_attr__( 'Recipe', 'uncanny-automator' ),
		/* translators: Log column. The recipe status */
		'recipe_completed' => esc_attr__( 'Status', 'uncanny-automator' ),
		/* translators: Log column. The recipe completion date */
		'recipe_date_time' => esc_attr__( 'Completion date', 'uncanny-automator' ),
		/* translators: Log column. Noun. The recipe iteration */
		'run_number'       => esc_attr__( 'Run #', 'uncanny-automator' ),
		/* translators: Log column. */
		'display_name'     => esc_attr__( 'User', 'uncanny-automator' ),
		// Added: actions
		'actions'          => esc_attr__( 'Actions', 'uncanny-automator' ),
	);

	$sortables = array(
		//'recipe_type'      => array( 'recipe_type', true ),
		'recipe_title'     => array( 'recipe_title', true ),
		'recipe_date_time' => array( 'recipe_date_time', true ),
		'display_name'     => array( 'display_name', true ),
		//'user_email'=>array('user_email',true), // linked
		'recipe_completed' => array( 'recipe_completed', true ),
		'run_number'       => array( 'run_number', true ),

	);

	//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();
}