Skip to content

Commit

Permalink
Remove experimental flag for image editing (#23349)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix authored Jun 22, 2020
1 parent 6c4eb8d commit f2ed972
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 37 deletions.
12 changes: 0 additions & 12 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,6 @@ function gutenberg_initialize_experiments_settings() {
'id' => 'gutenberg-full-site-editing-demo',
)
);
add_settings_field(
'gutenberg-rich-image-editing',
__( 'Rich Image Editing', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Enable inline rich image editing', 'gutenberg' ),
'id' => 'gutenberg-rich-image-editing',
)
);
register_setting(
'gutenberg-experiments',
'gutenberg-experiments'
Expand Down Expand Up @@ -157,7 +146,6 @@ function gutenberg_experiments_editor_settings( $settings ) {
'__experimentalBlockDirectory' => gutenberg_is_experiment_enabled( 'gutenberg-block-directory' ),
'__experimentalEnableFullSiteEditing' => gutenberg_is_experiment_enabled( 'gutenberg-full-site-editing' ),
'__experimentalEnableFullSiteEditingDemo' => gutenberg_is_experiment_enabled( 'gutenberg-full-site-editing-demo' ),
'__experimentalEnableRichImageEditing' => gutenberg_is_experiment_enabled( 'gutenberg-rich-image-editing' ),
);

$gradient_presets = current( (array) get_theme_support( 'editor-gradient-presets' ) );
Expand Down
4 changes: 0 additions & 4 deletions lib/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,6 @@ function gutenberg_auto_draft_get_sample_permalink( $permalink, $id, $title, $na
* @since 7.x.0
*/
function gutenberg_register_image_editor() {
if ( ! gutenberg_is_experiment_enabled( 'gutenberg-rich-image-editing' ) ) {
return;
}

$image_editor = new WP_REST_Image_Editor_Controller();
$image_editor->register_routes();
}
Expand Down
1 change: 0 additions & 1 deletion packages/block-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ _Properties_
- _\_\_experimentalBlockDirectory_ `boolean`: Whether the user has enabled the Block Directory
- _\_\_experimentalEnableFullSiteEditing_ `boolean`: Whether the user has enabled Full Site Editing
- _\_\_experimentalEnableFullSiteEditingDemo_ `boolean`: Whether the user has enabled Full Site Editing Demo Templates
- _\_\_experimentalEnableRichImageEditing_ `boolean`: Whether the user has enabled Rich Image Editing

<a name="SkipToSelectedBlock" href="#SkipToSelectedBlock">#</a> **SkipToSelectedBlock**

Expand Down
2 changes: 0 additions & 2 deletions packages/block-editor/src/store/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const PREFERENCES_DEFAULTS = {
* @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory
* @property {boolean} __experimentalEnableFullSiteEditing Whether the user has enabled Full Site Editing
* @property {boolean} __experimentalEnableFullSiteEditingDemo Whether the user has enabled Full Site Editing Demo Templates
* @property {boolean} __experimentalEnableRichImageEditing Whether the user has enabled Rich Image Editing
*/
export const SETTINGS_DEFAULTS = {
alignWide: false,
Expand Down Expand Up @@ -151,7 +150,6 @@ export const SETTINGS_DEFAULTS = {
__experimentalBlockDirectory: false,
__experimentalEnableFullSiteEditing: false,
__experimentalEnableFullSiteEditingDemo: false,
__experimentalEnableRichImageEditing: false,
__mobileEnablePageTemplates: false,
gradients: [
{
Expand Down
20 changes: 3 additions & 17 deletions packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,9 @@ export default function Image( {
},
[ id, isSelected ]
);
const {
maxWidth,
isRTL,
imageSizes,
__experimentalEnableRichImageEditing,
} = useSelect( ( select ) => {
const { maxWidth, isRTL, imageSizes } = useSelect( ( select ) => {
const { getSettings } = select( 'core/block-editor' );
return pick( getSettings(), [
'imageSizes',
'isRTL',
'maxWidth',
'__experimentalEnableRichImageEditing',
] );
return pick( getSettings(), [ 'imageSizes', 'isRTL', 'maxWidth' ] );
} );
const { toggleSelection } = useDispatch( 'core/block-editor' );
const isLargeViewport = useViewportMatch( 'medium' );
Expand Down Expand Up @@ -187,11 +177,7 @@ export default function Image( {
}
}, [ isSelected ] );

const canEditImage =
__experimentalEnableRichImageEditing &&
id &&
naturalWidth &&
naturalHeight;
const canEditImage = id && naturalWidth && naturalHeight;

const controls = (
<>
Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ class EditorProvider extends Component {
'__experimentalEnableLinkColor',
'__experimentalEnableFullSiteEditing',
'__experimentalEnableFullSiteEditingDemo',
'__experimentalEnableRichImageEditing',
'__experimentalFeatures',
'__experimentalGlobalStylesUserEntityId',
'__experimentalGlobalStylesBase',
Expand Down

0 comments on commit f2ed972

Please sign in to comment.