meta_box_options.php
| 1 | <?php |
| 2 | |
| 3 | // vars |
| 4 | global $post; |
| 5 | |
| 6 | // get options |
| 7 | $options = $this->get_acf_options($post->ID); |
| 8 | |
| 9 | ?> |
| 10 | <table class="acf_input widefat" id="acf_options"> |
| 11 | <tr> |
| 12 | <td class="label"> |
| 13 | <label for=""><?php _e("Order No.",'acf'); ?></label> |
| 14 | <p class="description"><?php _e("Field groups are created in order <br />from lowest to highest.",'acf'); ?></p> |
| 15 | </td> |
| 16 | <td> |
| 17 | <?php |
| 18 | |
| 19 | $this->create_field(array( |
| 20 | 'type' => 'text', |
| 21 | 'name' => 'menu_order', |
| 22 | 'value' => $post->menu_order, |
| 23 | )); |
| 24 | |
| 25 | ?> |
| 26 | </td> |
| 27 | </tr> |
| 28 | <tr> |
| 29 | <td class="label"> |
| 30 | <label for=""><?php _e("Position",'acf'); ?></label> |
| 31 | </td> |
| 32 | <td> |
| 33 | <?php |
| 34 | |
| 35 | $this->create_field(array( |
| 36 | 'type' => 'radio', |
| 37 | 'name' => 'options[position]', |
| 38 | 'value' => $options['position'], |
| 39 | 'choices' => array( |
| 40 | 'normal' => 'Normal', |
| 41 | 'side' => 'Side', |
| 42 | ) |
| 43 | )); |
| 44 | |
| 45 | ?> |
| 46 | </td> |
| 47 | </tr> |
| 48 | <tr> |
| 49 | <td class="label"> |
| 50 | <label for="post_type"><?php _e("Style",'acf'); ?></label> |
| 51 | </td> |
| 52 | <td> |
| 53 | <?php |
| 54 | |
| 55 | $this->create_field(array( |
| 56 | 'type' => 'radio', |
| 57 | 'name' => 'options[layout]', |
| 58 | 'value' => $options['layout'], |
| 59 | 'choices' => array( |
| 60 | 'default' => 'Standard Metabox', |
| 61 | 'no_box' => 'No Metabox', |
| 62 | ) |
| 63 | )); |
| 64 | |
| 65 | ?> |
| 66 | </td> |
| 67 | </tr> |
| 68 | <tr> |
| 69 | <td class="label"> |
| 70 | <label for="post_type"><?php _e("Show on page",'acf'); ?></label> |
| 71 | <p class="description"><?php _e("Deselect items to hide them on the edit page",'acf'); ?></p> |
| 72 | <p class="description"><?php _e("If multiple ACF groups appear on an edit page, the first ACF group's options will be used. The first ACF group is the one with the lowest order number.",'acf'); ?></p> |
| 73 | </td> |
| 74 | <td> |
| 75 | <?php |
| 76 | |
| 77 | $this->create_field(array( |
| 78 | 'type' => 'checkbox', |
| 79 | 'name' => 'options[show_on_page]', |
| 80 | 'value' => $options['show_on_page'], |
| 81 | 'choices' => array( |
| 82 | 'the_content' => 'Content Editor', |
| 83 | 'custom_fields' => 'Custom Fields', |
| 84 | 'discussion' => 'Discussion', |
| 85 | 'comments' => 'Comments', |
| 86 | 'slug' => 'Slug', |
| 87 | 'author' => 'Author' |
| 88 | ) |
| 89 | )); |
| 90 | |
| 91 | ?> |
| 92 | </td> |
| 93 | </tr> |
| 94 | |
| 95 | </table> |