Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kermage committed May 30, 2022
1 parent 3ec3edf commit 7b62d88
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
6 changes: 4 additions & 2 deletions includes/Archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,13 @@ public function archive_select( $post ) {
echo ' <select id="at-status-select"' . ( $classic ? ' name="at-post-status"' : '' ) . '>';
echo '<option value="" selected>&mdash; Select &mdash;</option>';

foreach ( $statuses as $value => $status ) : ?>
foreach ( $statuses as $value => $status ) :
?>
<option value="<?php echo $value; ?>">
<?php echo $status->label; ?>
</option>
<?php endforeach;
<?php
endforeach;

echo '</select> <button id="at-status-submit" type="submit" class="button">Save</button>';

Expand Down
2 changes: 1 addition & 1 deletion includes/Sort.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private function filters( $type, $taxonomies ) {
if ( empty( $options ) ) {
continue;
}
?>
?>

<label>
<span><?php echo $taxonomy->labels->singular_name; ?></span>
Expand Down
20 changes: 10 additions & 10 deletions includes/Walker.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ public function end_lvl( &$output, $depth = 0, $args = array() ) {
}


public function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) {
public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {

$indent = '';

if ( $depth ) {
$indent = str_repeat( '&mdash; ', $depth );
}

if ( '' === $page->post_title ) {
if ( '' === $object->post_title ) {
/* translators: %d: ID of a post. */
$page->post_title = sprintf( __( '#%d (no title)' ), $page->ID );
$object->post_title = sprintf( __( '#%d (no title)' ), $object->ID );
}

$p_title = $indent . $page->post_title;
$p_title .= isset( $_GET['post_status'] ) ? '' : _post_states( get_post( $page->ID ), false );
$p_title = $indent . $object->post_title;
$p_title .= isset( $_GET['post_status'] ) ? '' : _post_states( get_post( $object->ID ), false );
$ev_tmpl = '<a href="%s" target="_blank">%s</a>';
$template = '<li id="post-%1$s" class="at-sort-row" data-order="%2$s">
<span class="at-sort-column">%3$s</span>
Expand All @@ -54,25 +54,25 @@ public function start_el( &$output, $page, $depth = 0, $args = array(), $current

$output .= sprintf(
$template,
$page->ID,
$page->menu_order,
$object->ID,
$object->menu_order,
$p_title,
sprintf(
$ev_tmpl,
get_edit_post_link( $page->ID ),
get_edit_post_link( $object->ID ),
__( 'Edit' )
),
sprintf(
$ev_tmpl,
get_permalink( $page->ID ),
get_permalink( $object->ID ),
__( 'View' )
)
);

}


public function end_el( &$output, $page, $depth = 0, $args = array() ) {
public function end_el( &$output, $object, $depth = 0, $args = array() ) {

$output .= '</li>';

Expand Down

0 comments on commit 7b62d88

Please sign in to comment.