Skip to content

Commit 5f22db7

Browse files
authored
General: update minimum required WP version (#16445)
1 parent 5f4a1a3 commit 5f22db7

File tree

41 files changed

+69
-190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+69
-190
lines changed

.phpcs.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<ruleset name="Jetpack">
3-
<config name="minimum_supported_wp_version" value="5.3" />
3+
<config name="minimum_supported_wp_version" value="5.4" />
44
<config name="testVersion" value="5.6-"/>
55

66
<rule ref="PHPCompatibilityWP"/>

extensions/blocks/amazon/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import edit from './edit';
1414
* Style dependencies
1515
*/
1616
import './editor.scss';
17-
import { supportsCollections } from '../../shared/block-category';
1817

1918
export const name = 'amazon';
2019
export const title = __( 'Amazon', 'jetpack' );
@@ -23,7 +22,7 @@ export const settings = {
2322
title,
2423
description: __( 'Promote Amazon products and earn a commission from sales.', 'jetpack' ),
2524
icon,
26-
category: supportsCollections() ? 'earn' : 'jetpack',
25+
category: 'earn',
2726
keywords: [ __( 'amazon', 'jetpack' ), __( 'affiliate', 'jetpack' ) ],
2827
supports: {
2928
align: true,

extensions/blocks/business-hours/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import './editor.scss';
1111
import './style.scss';
1212
import BusinessHours from './edit';
1313
import renderMaterialIcon from '../../shared/render-material-icon';
14-
import { supportsCollections } from '../../shared/block-category';
1514

1615
/**
1716
* Block Registrations:
@@ -83,7 +82,7 @@ export const settings = {
8382
title: __( 'Business Hours', 'jetpack' ),
8483
description: __( 'Display opening hours for your business.', 'jetpack' ),
8584
icon,
86-
category: supportsCollections() ? 'grow' : 'jetpack',
85+
category: 'grow',
8786
supports: {
8887
html: true,
8988
},

extensions/blocks/calendly/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { getAttributesFromEmbedCode, REGEX } from './utils';
1818
* Style dependencies
1919
*/
2020
import './editor.scss';
21-
import { supportsCollections } from '../../shared/block-category';
2221

2322
export const CALENDLY_EXAMPLE_URL = 'https://calendly.com/wordpresscom/jetpack-block-example';
2423

@@ -38,7 +37,7 @@ export const settings = {
3837
title,
3938
description: __( 'Embed a calendar for customers to schedule appointments', 'jetpack' ),
4039
icon,
41-
category: supportsCollections() ? 'grow' : 'jetpack',
40+
category: 'grow',
4241
keywords: [
4342
_x( 'calendar', 'block search term', 'jetpack' ),
4443
_x( 'schedule', 'block search term', 'jetpack' ),

extensions/blocks/contact-form/index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import JetpackFieldTextarea from './components/jetpack-field-textarea';
2020
import JetpackFieldCheckbox from './components/jetpack-field-checkbox';
2121
import JetpackFieldMultiple from './components/jetpack-field-multiple';
2222
import renderMaterialIcon from '../../shared/render-material-icon';
23-
import { supportsCollections } from '../../shared/block-category';
2423

2524
export const name = 'contact-form';
2625
export const settings = {
@@ -41,12 +40,12 @@ export const settings = {
4140
edit,
4241
save: InnerBlocks.Content,
4342
variations,
44-
category: supportsCollections() ? 'grow' : 'jetpack',
43+
category: 'grow',
4544
deprecated,
4645
};
4746

4847
const FieldDefaults = {
49-
category: supportsCollections() ? 'grow' : 'jetpack',
48+
category: 'grow',
5049
parent: [ 'jetpack/contact-form' ],
5150
supports: {
5251
reusable: false,

extensions/blocks/contact-info/address/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { Path, Circle } from '@wordpress/components';
1111
import edit from './edit';
1212
import save from './save';
1313
import renderMaterialIcon from '../../../shared/render-material-icon';
14-
import { supportsCollections } from '../../../shared/block-category';
1514

1615
const attributes = {
1716
address: {
@@ -64,7 +63,7 @@ export const settings = {
6463
<Circle cx="12" cy="9" r="2.5" />
6564
</Fragment>
6665
),
67-
category: supportsCollections() ? 'grow' : 'jetpack',
66+
category: 'grow',
6867
attributes,
6968
parent: [ 'jetpack/contact-info' ],
7069
edit,

extensions/blocks/contact-info/email/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { Path } from '@wordpress/components';
1010
import edit from './edit';
1111
import renderMaterialIcon from '../../../shared/render-material-icon';
1212
import save from './save';
13-
import { supportsCollections } from '../../../shared/block-category';
1413

1514
const attributes = {
1615
email: {
@@ -35,7 +34,7 @@ export const settings = {
3534
icon: renderMaterialIcon(
3635
<Path d="M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z" />
3736
),
38-
category: supportsCollections() ? 'grow' : 'jetpack',
37+
category: 'grow',
3938
attributes,
4039
edit,
4140
save,

extensions/blocks/contact-info/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import './style.scss';
1515
import { name as addressName, settings as addressSettings } from './address/';
1616
import { name as emailName, settings as emailSettings } from './email/';
1717
import { name as phoneName, settings as phoneSettings } from './phone/';
18-
import { supportsCollections } from '../../shared/block-category';
1918

2019
const attributes = {};
2120

@@ -41,7 +40,7 @@ export const settings = {
4140
icon: renderMaterialIcon(
4241
<Path d="M19 5v14H5V5h14m0-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 9c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3zm0-4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm6 10H6v-1.53c0-2.5 3.97-3.58 6-3.58s6 1.08 6 3.58V18zm-9.69-2h7.38c-.69-.56-2.38-1.12-3.69-1.12s-3.01.56-3.69 1.12z" />
4342
),
44-
category: supportsCollections() ? 'grow' : 'jetpack',
43+
category: 'grow',
4544
supports: {
4645
align: [ 'wide', 'full' ],
4746
html: false,

extensions/blocks/contact-info/phone/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { Path } from '@wordpress/components';
1010
import edit from './edit';
1111
import renderMaterialIcon from '../../../shared/render-material-icon';
1212
import save from './save';
13-
import { supportsCollections } from '../../../shared/block-category';
1413

1514
const attributes = {
1615
phone: {
@@ -35,7 +34,7 @@ export const settings = {
3534
icon: renderMaterialIcon(
3635
<Path d="M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79h1.51m9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75l1.2-1.19M7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1z" />
3736
),
38-
category: supportsCollections() ? 'grow' : 'jetpack',
37+
category: 'grow',
3938
attributes,
4039
parent: [ 'jetpack/contact-info' ],
4140
edit,

extensions/blocks/eventbrite/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import attributes from './attributes';
1212
import deprecated from './deprecated';
1313
import edit from './edit';
1414
import save from './save';
15-
import { supportsCollections } from '../../shared/block-category';
1615

1716
export const innerButtonBlock = {
1817
name: 'jetpack/button',
@@ -53,7 +52,7 @@ export const settings = {
5352
title,
5453
description: __( 'Embed Eventbrite event details and ticket checkout.', 'jetpack' ),
5554
icon,
56-
category: supportsCollections() ? 'embed' : 'jetpack',
55+
category: 'embed',
5756
keywords: [
5857
_x( 'events', 'block search term', 'jetpack' ),
5958
_x( 'tickets', 'block search term', 'jetpack' ),

extensions/blocks/gathering-tweetstorms/editor.js

+15-38
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { addFilter } from '@wordpress/hooks';
77
* Internal dependencies
88
*/
99
import useGatherTweetstorm from './use-gather-tweetstorm';
10-
import { withNotices, Button, ToolbarGroup, Toolbar, Spinner } from '@wordpress/components';
10+
import { withNotices, Button, ToolbarGroup, Spinner } from '@wordpress/components';
1111
import { __ } from '@wordpress/i18n';
1212
import './editor.scss';
1313
import { BlockControls } from '@wordpress/editor';
@@ -42,44 +42,21 @@ const addTweetstormToTweets = blockSettings => {
4242
<>
4343
{ noticeUI }
4444
<BlockControls>
45-
{ /* @todo Fallback can be removed when WP 5.4 is the minimum supported version. */ }
46-
{ ToolbarGroup ? (
47-
<ToolbarGroup className="gathering-tweetstorms__embed-toolbar">
48-
<Button
49-
className="gathering-tweetstorms__embed-toolbar-button"
50-
onClick={ () => unleashStorm( url, noticeOperations ) }
51-
label={ __(
52-
'Import the entire Twitter thread directly into this post.',
53-
'jetpack'
54-
) }
55-
showTooltip={ true }
56-
disabled={ isGatheringStorm }
57-
>
58-
{ __( 'Unroll', 'jetpack' ) }
59-
</Button>
60-
{ isGatheringStorm && <Spinner /> }
61-
</ToolbarGroup>
62-
) : (
63-
<Toolbar
64-
className="gathering-tweetstorms__embed-toolbar"
65-
controls={ [
66-
{
67-
title: __(
68-
'Import the entire Twitter thread directly into this post.',
69-
'jetpack'
70-
),
71-
onClick: () => unleashStorm( url, noticeOperations ),
72-
extraProps: {
73-
className: 'gathering-tweetstorms__embed-toolbar-button',
74-
children: __( 'Unroll', 'jetpack' ),
75-
disabled: isGatheringStorm,
76-
},
77-
},
78-
] }
45+
<ToolbarGroup className="gathering-tweetstorms__embed-toolbar">
46+
<Button
47+
className="gathering-tweetstorms__embed-toolbar-button"
48+
onClick={ () => unleashStorm( url, noticeOperations ) }
49+
label={ __(
50+
'Import the entire Twitter thread directly into this post.',
51+
'jetpack'
52+
) }
53+
showTooltip={ true }
54+
disabled={ isGatheringStorm }
7955
>
80-
{ isGatheringStorm && <Spinner /> }
81-
</Toolbar>
82-
) }
56+
{ __( 'Unroll', 'jetpack' ) }
57+
</Button>
58+
{ isGatheringStorm && <Spinner /> }
59+
</ToolbarGroup>
8360
</BlockControls>
8461
<CoreTweetEdit { ...props } />
8562
</>

extensions/blocks/gif/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import edit from './edit';
1212
// Ordering is important! Editor overrides style!
1313
import './style.scss';
1414
import './editor.scss';
15-
import { supportsCollections } from '../../shared/block-category';
1615

1716
export const name = 'gif';
1817
export const title = __( 'GIF', 'jetpack' );
@@ -27,7 +26,7 @@ export const icon = (
2726
export const settings = {
2827
title,
2928
icon,
30-
category: supportsCollections() ? 'embed' : 'jetpack',
29+
category: 'embed',
3130
keywords: [
3231
_x( 'animated', 'block search term', 'jetpack' ),
3332
_x( 'giphy', 'block search term', 'jetpack' ),

extensions/blocks/google-calendar/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import edit from './edit';
1111
import { extractAttributesFromIframe, URL_REGEX, IFRAME_REGEX } from './utils';
1212
import './editor.scss';
1313
import icon from './icon';
14-
import { supportsCollections } from '../../shared/block-category';
1514

1615
export const name = 'google-calendar';
1716
export const title = __( 'Google Calendar', 'jetpack' );
@@ -26,7 +25,7 @@ export const settings = {
2625
_x( 'appointments', 'block search term', 'jetpack' ),
2726
],
2827
icon,
29-
category: supportsCollections() ? 'embed' : 'jetpack',
28+
category: 'embed',
3029
supports: {
3130
align: true,
3231
alignWide: true,

extensions/blocks/image-compare/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import icon from './icon';
1111
import save from './save';
1212
import imgExampleAfter from './img-example-after.png';
1313
import imgExampleBefore from './img-example-before.png';
14-
import { supportsCollections } from '../../shared/block-category';
1514

1615
export const name = 'image-compare';
1716

@@ -24,7 +23,7 @@ export const settings = {
2423

2524
icon,
2625

27-
category: supportsCollections() ? 'layout' : 'jetpack',
26+
category: 'layout',
2827
keywords: [
2928
_x( 'juxtapose', 'block search term', 'jetpack' ),
3029
_x( 'photos', 'block search term', 'jetpack' ),

extensions/blocks/instagram-gallery/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { __, _x } from '@wordpress/i18n';
88
*/
99
import attributes from './attributes';
1010
import edit from './edit';
11-
import { supportsCollections } from '../../shared/block-category';
1211

1312
export const name = 'instagram-gallery';
1413

@@ -19,7 +18,7 @@ export const settings = {
1918
'jetpack'
2019
),
2120
icon: 'instagram',
22-
category: supportsCollections() ? 'embed' : 'jetpack',
21+
category: 'embed',
2322
keywords: [
2423
_x( 'images', 'block search term', 'jetpack' ),
2524
_x( 'photos', 'block search term', 'jetpack' ),

extensions/blocks/mailchimp/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { Path, SVG, G } from '@wordpress/components';
1111
import deprecatedV1 from './deprecated/v1';
1212
import edit from './edit';
1313
import './editor.scss';
14-
import { supportsCollections } from '../../shared/block-category';
1514

1615
export const name = 'mailchimp';
1716

@@ -44,7 +43,7 @@ export const settings = {
4443
title: __( 'Mailchimp', 'jetpack' ),
4544
icon,
4645
description: __( 'A form enabling readers to join a Mailchimp list.', 'jetpack' ),
47-
category: supportsCollections() ? 'grow' : 'jetpack',
46+
category: 'grow',
4847
keywords: [
4948
_x( 'email', 'block search term', 'jetpack' ),
5049
_x( 'subscription', 'block search term', 'jetpack' ),

extensions/blocks/map/edit.js

-5
Original file line numberDiff line numberDiff line change
@@ -422,11 +422,6 @@ class MapEdit extends Component {
422422
{ inspectorControls }
423423
<div className={ className }>
424424
<ResizableBox
425-
className={
426-
// @TODO: This can be removed when WP 5.4 is the minimum version, it's a fallback
427-
// for prior to when the `showHandle` property was added.
428-
classnames( { 'is-selected': isSelected } )
429-
}
430425
size={ {
431426
height: mapHeight || 'auto',
432427
width: '100%',

extensions/blocks/map/settings.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import defaultTheme from './map-theme_default.jpg';
1313
import blackAndWhiteTheme from './map-theme_black_and_white.jpg';
1414
import satelliteTheme from './map-theme_satellite.jpg';
1515
import terrainTheme from './map-theme_terrain.jpg';
16-
import { supportsCollections } from '../../shared/block-category';
1716

1817
export const settings = {
1918
name: 'map',
@@ -34,7 +33,7 @@ export const settings = {
3433
<path d="M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM10 5.47l4 1.4v11.66l-4-1.4V5.47zm-5 .99l3-1.01v11.7l-3 1.16V6.46zm14 11.08l-3 1.01V6.86l3-1.16v11.84z" />
3534
</svg>
3635
),
37-
category: supportsCollections() ? 'embed' : 'jetpack',
36+
category: 'embed',
3837
keywords: [
3938
_x( 'maps', 'block search term', 'jetpack' ),
4039
_x( 'location', 'block search term', 'jetpack' ),

extensions/blocks/markdown/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import './editor.scss';
1212
import { isAtomicSite, isSimpleSite } from '../../shared/site-type-utils';
1313
import edit from './edit';
1414
import save from './save';
15-
import { supportsCollections } from '../../shared/block-category';
1615

1716
export const name = 'markdown';
1817

@@ -58,7 +57,7 @@ export const settings = {
5857
</SVG>
5958
),
6059

61-
category: supportsCollections() ? 'formatting' : 'jetpack',
60+
category: 'formatting',
6261

6362
keywords: [
6463
_x( 'formatting', 'block search term', 'jetpack' ),

extensions/blocks/opentable/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ import './view.scss';
2020
export const name = 'opentable';
2121
export const title = __( 'OpenTable', 'jetpack' );
2222
import { getAttributesFromEmbedCode, restRefRegex, ridRegex } from './utils';
23-
import { supportsCollections } from '../../shared/block-category';
2423

2524
export const settings = {
2625
title,
2726
description: __( 'Allow visitors to book a reservation with OpenTable', 'jetpack' ),
2827
icon,
29-
category: supportsCollections() ? 'earn' : 'jetpack',
28+
category: 'earn',
3029
keywords: [
3130
_x( 'booking', 'block search term', 'jetpack' ),
3231
_x( 'reservation', 'block search term', 'jetpack' ),

extensions/blocks/pinterest/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { createBlock } from '@wordpress/blocks';
1010
*/
1111
import edit from './edit';
1212
import { pinType } from './utils';
13-
import { supportsCollections } from '../../shared/block-category';
1413

1514
export const URL_REGEX = /^\s*https?:\/\/(?:www\.)?(?:[a-z]{2}\.)?(?:pinterest\.[a-z.]+|pin\.it)\/([^/]+)(\/[^/]+)?/i;
1615

@@ -35,7 +34,7 @@ export const settings = {
3534

3635
icon,
3736

38-
category: supportsCollections() ? 'embed' : 'jetpack',
37+
category: 'embed',
3938

4039
keywords: [
4140
_x( 'social', 'block search term', 'jetpack' ),

0 commit comments

Comments
 (0)