Nuxy
  • Nuxy
  • Installation
  • Adding Page Options
  • Adding Post Options
  • Adding Taxonomy Options
  • Adding Frontend Options
  • Getting Fields
  • Adding to admin bar
  • Tabs
    • General tab parameters
    • Add submenu
  • Field parameters
  • Registering field
  • Fields dependency
  • Fields group
  • Field types
    • General field parameters
    • 1. Text
    • 2. Number
    • 3. Textarea
    • 4. Checkbox
    • 5. Select
    • 6. Radio
    • 7. Color
    • 8. Image
    • 9. Editor
    • 10. Autocomplete
    • 11. Datepicker
    • 12. Datepicker range
    • 13. Time
    • 14. Sortable
    • 15. Sortable multi input
    • 16. Gallery
    • 17. Repeater
    • 18. Range slider
    • 19. Image Select
    • 20. Button group
    • 21. Icon picker
    • 22. Ace Editor
    • 23. Spacings
    • 24. Link color
    • 25. Multi checkbox
    • 26. Color Gradient
    • 27. Textarea with hints
    • 28. Typography
    • 29. Multiselect
    • 30. Notification Message
    • 31. Button List
    • 32. Group Title with Preview && Icon
  • Download Nuxy
Powered by GitBook
On this page

Adding Post Options

Modify your post/custom post type with brand new settings

WordPress powered with Post Type meta boxes. Add Meta Box to the desired post type with a unique ID.

add_filter('stm_wpcfto_boxes', function ($boxes) {

    $boxes['my_metabox'] = array(
        'post_type' => array('post', 'my-custom-post-type'),
        'label' => esc_html__('Post settings', 'my-domain'),
    );

    return $boxes;
});

And we need to add fields to this Meta Box:

add_filter('stm_wpcfto_fields', function ($fields) {

    $fields['my_metabox'] = array(

        'tab_1' => array(
            'name' => esc_html__('Field Settings', 'my-domain'),
            'fields' => array(
                'field_1' => array(
                    'type' => 'text',
                    'label' => esc_html__('Field text', 'my-domain'),
                ),
            )
        ),

    );

    return $fields;
});

Custom Fields

You can easily use default WordPress functions such as get_post_meta(), get_option() or get_term_meta(). But for the option we built-in function to get any param you want:

$options = stm_wpcfto_get_options('my_awesome_settings');
PreviousAdding Page OptionsNextAdding Taxonomy Options

Last updated 11 months ago