Created
February 17, 2015 01:29
-
-
Save designbuildtest/c9174781cc755ac082ef to your computer and use it in GitHub Desktop.
Page Orderby Manage Screen Column
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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