register_initial_settings()
Registers default settings available in WordPress.
Description
The settings registered here are primarily useful for the REST API, so this does not encompass all settings available in WordPress.
Source
File: wp-includes/option.php
function register_initial_settings() {
register_setting( 'general', 'blogname', array(
'show_in_rest' => array(
'name' => 'title',
),
'type' => 'string',
'description' => __( 'Site title.' ),
) );
register_setting( 'general', 'blogdescription', array(
'show_in_rest' => array(
'name' => 'description',
),
'type' => 'string',
'description' => __( 'Site tagline.' ),
) );
if ( ! is_multisite() ) {
register_setting( 'general', 'siteurl', array(
'show_in_rest' => array(
'name' => 'url',
'schema' => array(
'format' => 'uri',
),
),
'type' => 'string',
'description' => __( 'Site URL.' ),
) );
}
register_setting( 'general', 'login_custom_image_state', array(
'show_in_rest' => true,
'type' => 'integer',
'default' => false,
'description' => __( 'The state of the "login custom image" feature (0=disabled, 1=square, or 2=banner).' ),
) );
register_setting( 'general', 'login_custom_image_id', array(
'show_in_rest' => true,
'type' => 'integer',
'description' => __( 'Attachment ID for the "login custom image" feature.' ),
) );
if ( ! is_multisite() ) {
register_setting( 'general', 'admin_email', array(
'show_in_rest' => array(
'name' => 'email',
'schema' => array(
'format' => 'email',
),
),
'type' => 'string',
'description' => __( 'This address is used for admin purposes, like new user notification.' ),
) );
}
register_setting( 'general', 'timezone_string', array(
'show_in_rest' => array(
'name' => 'timezone',
),
'type' => 'string',
'description' => __( 'A city in the same timezone as you.' ),
) );
register_setting( 'general', 'date_format', array(
'show_in_rest' => true,
'type' => 'string',
'description' => __( 'A date format for all date strings.' ),
) );
register_setting( 'general', 'time_format', array(
'show_in_rest' => true,
'type' => 'string',
'description' => __( 'A time format for all time strings.' ),
) );
register_setting( 'general', 'start_of_week', array(
'show_in_rest' => true,
'type' => 'integer',
'description' => __( 'A day number of the week that the week should start on.' ),
) );
register_setting( 'general', 'WPLANG', array(
'show_in_rest' => array(
'name' => 'language',
),
'type' => 'string',
'description' => __( 'ClassicPress locale code.' ),
'default' => 'en_US',
) );
register_setting( 'writing', 'use_smilies', array(
'show_in_rest' => true,
'type' => 'boolean',
'description' => __( 'Convert emoticons like :-) and :-P to graphics on display.' ),
'default' => true,
) );
register_setting( 'writing', 'default_category', array(
'show_in_rest' => true,
'type' => 'integer',
'description' => __( 'Default post category.' ),
) );
register_setting( 'writing', 'default_post_format', array(
'show_in_rest' => true,
'type' => 'string',
'description' => __( 'Default post format.' ),
) );
register_setting( 'reading', 'posts_per_page', array(
'show_in_rest' => true,
'type' => 'integer',
'description' => __( 'Blog pages show at most.' ),
'default' => 10,
) );
register_setting( 'discussion', 'default_ping_status', array(
'show_in_rest' => array(
'schema' => array(
'enum' => array( 'open', 'closed' ),
),
),
'type' => 'string',
'description' => __( 'Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.' ),
) );
register_setting( 'discussion', 'default_comment_status', array(
'show_in_rest' => array(
'schema' => array(
'enum' => array( 'open', 'closed' ),
),
),
'type' => 'string',
'description' => __( 'Allow people to post comments on new articles.' ),
) );
}
Changelog
Version | Description |
---|---|
6.0.1 | The show_on_front , page_on_front , and page_for_posts options were added. |
4.7.0 | Introduced. |