'array', // 'string', 'boolean', 'integer', 'number', 'array', or 'object' 'description' => '', // A description of the data attached to this setting. 'sanitize_callback' => [ $sanitization, 'sanitize_for_options' ], 'show_in_rest' => false, 'default' => array(), // When calling get_option() ) ); $field_id = 'custom_menu_order'; $field_slug = 'custom-menu-order'; add_settings_field( $field_id, // Field ID '', // Field title [ $render_field, 'render_sortable_menu' ], // Callback to render field with custom arguments in the array below AMCUST_SLUG, // Settings page slug 'main-section', // Section ID array( 'field_id' => $field_id, // Custom argument 'field_name' => AMCUST_SLUG_U . '['. $field_id .']', // Custom argument 'field_type' => 'sortable-menu', // Custom argument 'field_description' => '', // Custom argument 'class' => 'amcust-sortable amcust-hide-th ' . $field_slug, // Custom class for the element ) ); } }