Skip to content

Control: Pages

Ale Mostajo edited this page Apr 29, 2020 · 1 revision

Control used as a field type to display a dropdown (<select>) with all WordPress pages listed.

Usage

class Post extends Model
{
    // Class properties and methods...

    protected function init()
    {
        $this->metaboxes = [
            'metabox_id' => [
                'tabs' => [
                    'tab_id' => [
                        'fields' => [

                            'my_page' => [
                                'type' => 'pages',
                                'title' => __( 'My Page', 'my-domain' ),
                            ],

                            // Other fields...
                        ],
                    ],
                ],
            ],
        ];
    }
}

Control options

Control Data type Description
wide bool Flag that indicates if the input should display wider or small.
show_option_none string See WordPress documentation.
show_option_no_change string See WordPress documentation.
option_none_value string See WordPress documentation.
value_field string See WordPress documentation.
depth int See WordPress documentation.