Created
May 8, 2018 09:24
-
-
Save morgyface/74d4c599e9d5071af165990a8a89cfaf to your computer and use it in GitHub Desktop.
WordPress | ACF | Dashboard | Custom columns | Order
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
| <?php | |
| // Useful during dev to show order number of fields within acf dashboard list | |
| function acf_field_group_columns($columns) { | |
| $columns['menu_order'] = __('Order'); | |
| return $columns; | |
| } // end function reference_columns | |
| add_filter('manage_edit-acf-field-group_columns', 'acf_field_group_columns', 20); | |
| function acf_field_group_columns_content($column, $post_id) { | |
| switch ($column) { | |
| case 'menu_order': | |
| global $post; | |
| echo $post->menu_order; | |
| break; | |
| default: | |
| break; | |
| } // end switch | |
| } // end function reference_columns_content | |
| add_action('manage_acf-field-group_posts_custom_column', 'acf_field_group_columns_content', 20, 2); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment