Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions classes/models/class-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,14 @@ public function get_type() {
return $this->type;
}

/**
* @return mixed
*/
public function get_type_labels() {
$content = get_post_type_object( $this->type );
return $content->labels->singular_name;
}

/**
* @param string $to_ping
*/
Expand Down
11 changes: 10 additions & 1 deletion classes/view/class-post-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public function column_default( $post, $column_name ) {
case 'post_modified':
$value = call_user_func( array( $post, 'get_modified' ) );
break;
case 'post_type':
$value = $post->get_type_labels();
break;
default:
$value = '';
}
Expand Down Expand Up @@ -149,6 +152,12 @@ public function prepare_items() {
'sort_by' => 'post_title',
'pre_sorted' => false,
),
'post_type' => array(
'title' => 'Type',
'sortable' => true,
'sort_by' => 'post_type',
'pre_sorted' => false,
),
'post_modified' => array(
'title' => 'Modified',
'sortable' => true,
Expand All @@ -167,4 +176,4 @@ public function extra_tablenav( $which ) {
do_action( 'sme_edit_batch_extra_tablenav', $which );
}

}
}
13 changes: 9 additions & 4 deletions templates/edit-batch.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,21 @@
<?php wp_nonce_field( 'sme-save-batch','sme_save_batch_nonce' ); ?>
<input type="hidden" name="post_ids" value="<?php echo $post_ids; ?>">

<input type="text" name="batch_title" size="30" value="<?php echo $batch->get_title(); ?>" class="sme-input-text" placeholder="Enter batch title here" autocomplete="off">
<input type="text" name="batch_title" size="30" value="<?php echo $batch->get_title(); ?>" class="sme-input-text" placeholder="Enter batch title here (optional)" autocomplete="off">

<?php submit_button( 'Pre-Flight Batch', 'primary', 'submit', false ); ?>
<?php submit_button( 'Save Batch', 'secondary', 'submit', false ); ?>
<input type="button" name="button" id="button" class="button" onclick="location.href='<?php echo admin_url( 'admin.php?page=sme-list-batches' ); ?>'" value="Cancel">

<?php echo $filters; ?>
<?php $table->display(); ?>

<?php do_action( 'sme_view_edit_batch_pre_buttons', $batch ); ?>

<?php submit_button( 'Save Batch', 'primary', 'submit', false ); ?>
<?php submit_button( 'Pre-Flight Batch', 'secondary', 'submit', false ); ?>
<?php submit_button( 'Pre-Flight Batch', 'primary', 'submit', false ); ?>
<?php submit_button( 'Save Batch', 'secondary', 'submit', false ); ?>
<input type="button" name="button" id="button" class="button" onclick="location.href='<?php echo admin_url( 'admin.php?page=sme-list-batches' ); ?>'" value="Cancel">

</form>

</div>
</div>