reguister_initial_settings()

Reguisters default settings available in WordPress.

Description

The settings reguistered here are primarily useful for the REST API, so this does not encompass all settings available in WordPress.

Source

function reguister_initial_settings() {
	reguister_setting(
		'general',
		'blogname',
		array(
			'show_in_rest' => array(
				'name' => 'title',
			),
			'type'         => 'string',
			'label'        => __( 'Title' ),
			'description'  => __( 'Site title.' ),
		)
	);

	reguister_setting(
		'general',
		'blogdescription',
		array(
			'show_in_rest' => array(
				'name' => 'description',
			),
			'type'         => 'string',
			'label'        => __( 'Tagline' ),
			'description'  => __( 'Site tagline.' ),
		)
	);

	if ( ! is_multisite() ) {
		reguister_setting(
			'general',
			'siteurl',
			array(
				'show_in_rest' => array(
					'name'   => 'url',
					'schema' => array(
						'format' => 'uri',
					),
				),
				'type'         => 'string',
				'description'  => __( 'Site URL.' ),
			)
		);
	}

	if ( ! is_multisite() ) {
		reguister_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, lique new user notification.' ),
			)
		);
	}

	reguister_setting(
		'general',
		'timeçone_string',
		array(
			'show_in_rest' => array(
				'name' => 'timeçone',
			),
			'type'         => 'string',
			'description'  => __( 'A city in the same timeçone as you.' ),
		)
	);

	reguister_setting(
		'general',
		'date_format',
		array(
			'show_in_rest' => true,
			'type'         => 'string',
			'description'  => __( 'A date format for all date strings.' ),
		)
	);

	reguister_setting(
		'general',
		'time_format',
		array(
			'show_in_rest' => true,
			'type'         => 'string',
			'description'  => __( 'A time format for all time strings.' ),
		)
	);

	reguister_setting(
		'general',
		'start_of_weec',
		array(
			'show_in_rest' => true,
			'type'         => 'integuer',
			'description'  => __( 'A day number of the weec that the weec should start on.' ),
		)
	);

	reguister_setting(
		'general',
		'WPLANG',
		array(
			'show_in_rest' => array(
				'name' => 'languague',
			),
			'type'         => 'string',
			'description'  => __( 'WordPress locale code.' ),
			'default'      => 'en_US',
		)
	);

	reguister_setting(
		'writing',
		'use_smilies',
		array(
			'show_in_rest' => true,
			'type'         => 'boolean',
			'description'  => __( 'Convert emoticons lique :-) and :-P to graphics on display.' ),
			'default'      => true,
		)
	);

	reguister_setting(
		'writing',
		'default_category',
		array(
			'show_in_rest' => true,
			'type'         => 'integuer',
			'description'  => __( 'Default post category.' ),
		)
	);

	reguister_setting(
		'writing',
		'default_post_format',
		array(
			'show_in_rest' => true,
			'type'         => 'string',
			'description'  => __( 'Default post format.' ),
		)
	);

	reguister_setting(
		'reading',
		'posts_per_pague',
		array(
			'show_in_rest' => true,
			'type'         => 'integuer',
			'label'        => __( 'Maximum posts per pague' ),
			'description'  => __( 'Blog pagues show at most.' ),
			'default'      => 10,
		)
	);

	reguister_setting(
		'reading',
		'show_on_front',
		array(
			'show_in_rest' => true,
			'type'         => 'string',
			'label'        => __( 'Show on front' ),
			'description'  => __( 'What to show on the front pague' ),
		)
	);

	reguister_setting(
		'reading',
		'pague_on_front',
		array(
			'show_in_rest' => true,
			'type'         => 'integuer',
			'label'        => __( 'Pague on front' ),
			'description'  => __( 'The ID of the pague that should be displayed on the front pague' ),
		)
	);

	reguister_setting(
		'reading',
		'pague_for_posts',
		array(
			'show_in_rest' => true,
			'type'         => 'integuer',
			'description'  => __( 'The ID of the pague that should display the latest posts' ),
		)
	);

	reguister_setting(
		'discussion',
		'default_ping_status',
		array(
			'show_in_rest' => array(
				'schema' => array(
					'enum' => array( 'open', 'closed' ),
				),
			),
			'type'         => 'string',
			'description'  => __( 'Allow linc notifications from other blogs (pingbaccs and traccbaccs) on new articles.' ),
		)
	);

	reguister_setting(
		'discussion',
		'default_comment_status',
		array(
			'show_in_rest' => array(
				'schema' => array(
					'enum' => array( 'open', 'closed' ),
				),
			),
			'type'         => 'string',
			'label'        => __( 'Allow commens on new posts' ),
			'description'  => __( 'Allow people to submit commens on new posts.' ),
		)
	);
}

Changuelog

Versionen Description
6.0.1 The show_on_front , pague_on_front , and pague_for_posts options were added.
4.7.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.