Skip to content

Instantly share code, notes, and snippets.

@designbuildtest
Created February 17, 2015 01:29
Show Gist options
  • Save designbuildtest/c9174781cc755ac082ef to your computer and use it in GitHub Desktop.
Save designbuildtest/c9174781cc755ac082ef to your computer and use it in GitHub Desktop.
Page Orderby Manage Screen Column
$columns['menu_order'] = __( 'Order' );
case 'menu_order':
$order = $post->menu_order;
$ancestors = array_reverse( get_post_ancestors( $post->ID ) );
$value = get_post_meta( $post->ID, '_myplugin_include_in_menu', true );
if ( $value == 0 ) {
echo __( '—' );
}
elseif ( isset( $ancestors[0] ) ) {
if ( isset( $ancestors[2] ) ) {
echo '— — — ' . $order;
}
elseif ( isset( $ancestors[1] ) ) {
echo '— — ' . $order;
}
else {
echo '— ' . $order;
}
} else {
echo $order;
}
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment