Skip to content

Stabilise gradient theme API's#20107

Merged
jorgefilipecosta merged 1 commit intomasterfrom
update/stabilize-gradient-theme-apis
Feb 7, 2020
Merged

Stabilise gradient theme API's#20107
jorgefilipecosta merged 1 commit intomasterfrom
update/stabilize-gradient-theme-apis

Conversation

@jorgefilipecosta
Copy link
Copy Markdown
Member

Description

This PR stabilizes the gradients theme API. And improves the documentation we have for these API's.

How has this been tested?

For each of the code blocks bellow I verified the result was the one described after each code block:

function test_code() {
	add_theme_support(
		'editor-gradient-presets',
		array(
			array(
				'name'     => __( 'Vivid cyan blue to vivid purple', 'themeLangDomain' ),
				'gradient' => 'linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)',
				'slug'     => 'vivid-cyan-blue-to-vivid-purple'
			),
			array(
				'name'     => __( 'Vivid green cyan to vivid cyan blue', 'themeLangDomain' ),
				'gradient' => 'linear-gradient(135deg,rgba(0,208,132,1) 0%,rgba(6,147,227,1) 100%)',
				'slug'     =>  'vivid-green-cyan-to-vivid-cyan-blue',
			),
			array(
				'name'     => __( 'Light green cyan to vivid green cyan', 'themeLangDomain' ),
				'gradient' => 'linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)',
				'slug'     => 'light-green-cyan-to-vivid-green-cyan',
			),
			array(
				'name'     => __( 'Luminous vivid amber to luminous vivid orange', 'themeLangDomain' ),
				'gradient' => 'linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)',
				'slug'     => 'luminous-vivid-amber-to-luminous-vivid-orange',
			),
			array(
				'name'     => __( 'Luminous vivid orange to vivid red', 'themeLangDomain' ),
				'gradient' => 'linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)',
				'slug'     => 'luminous-vivid-orange-to-vivid-red',
			),
		)
	);
	add_theme_support( 'disable-custom-gradients' );
}
add_action( 'after_setup_theme', 'test_code' );

The custom gradient picker is disabled. The gradient palette is changed to the one the theme is setting.

function test_code() {
	add_theme_support( 'editor-gradient-presets', array() );
	add_theme_support( 'disable-custom-gradients' );
}
add_action( 'after_setup_theme', 'test_code' );

The gradient functionality is tottaly disbaled.

function test_code() {
	add_theme_support( 'disable-custom-gradients' );
}
add_action( 'after_setup_theme', 'test_code' );

No default gradeints are provided the user can only use the custom gradient picker.

@jorgefilipecosta jorgefilipecosta merged commit 12a6ee4 into master Feb 7, 2020
@jorgefilipecosta jorgefilipecosta deleted the update/stabilize-gradient-theme-apis branch February 7, 2020 21:42
@github-actions github-actions Bot added this to the Gutenberg 7.5 milestone Feb 7, 2020
nylen pushed a commit to nylen/wordpress-develop-svn that referenced this pull request Feb 10, 2020
This commit includes in the core settings for the gradients theme API stabilized in WordPress/gutenberg#20107, and for the image sizes required for the latest posts feature image WordPress/gutenberg#17151.

Props: youknowriad, ryelle.
Fixes #49389.

git-svn-id: https://develop.svn.wordpress.org/trunk@47240 602fd350-edb4-49c9-b593-d223f7449a82
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Feb 10, 2020
This commit includes in the core settings for the gradients theme API stabilized in WordPress/gutenberg#20107, and for the image sizes required for the latest posts feature image WordPress/gutenberg#17151.

Props: youknowriad, ryelle.
Fixes #49389.

git-svn-id: https://develop.svn.wordpress.org/trunk@47240 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Feb 10, 2020
gMagicScott pushed a commit to gMagicScott/core.wordpress-mirror that referenced this pull request Feb 10, 2020
This commit includes in the core settings for the gradients theme API stabilized in WordPress/gutenberg#20107, and for the image sizes required for the latest posts feature image WordPress/gutenberg#17151.

Props: youknowriad, ryelle.
Fixes #49389.
Built from https://develop.svn.wordpress.org/trunk@47240


git-svn-id: https://core.svn.wordpress.org/trunk@47040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@jorgefilipecosta jorgefilipecosta added Needs Dev Note Requires a developer note for a major WordPress release cycle and removed Backport to WP Core labels Feb 11, 2020
@jorgefilipecosta jorgefilipecosta mentioned this pull request Feb 12, 2020
23 tasks
sikc8000 pushed a commit to sikc8000/u0_a165-localhost that referenced this pull request Feb 20, 2020
This commit includes in the core settings for the gradients theme API stabilized in WordPress/gutenberg#20107, and for the image sizes required for the latest posts feature image WordPress/gutenberg#17151.

Props: youknowriad, ryelle.
Fixes #49389.
Built from https://develop.svn.wordpress.org/trunk@47240
miya0001 pushed a commit to cjk4wp/wordpress that referenced this pull request Feb 20, 2020
This commit includes in the core settings for the gradients theme API stabilized in WordPress/gutenberg#20107, and for the image sizes required for the latest posts feature image WordPress/gutenberg#17151.

Props: youknowriad, ryelle.
Fixes #49389.

git-svn-id: http://develop.svn.wordpress.org/trunk@47240 602fd350-edb4-49c9-b593-d223f7449a82
@youknowriad youknowriad removed the Needs Dev Note Requires a developer note for a major WordPress release cycle label Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants