From 6dad7c547dfc2ee031c5693572270c582eb113a3 Mon Sep 17 00:00:00 2001 From: Elio Rivero Date: Mon, 22 Apr 2019 13:43:01 -0300 Subject: [PATCH] Settings - Writing: add toggle for Shortcodes. Make it searchable, remove searchable module. Don't activate shortcodes by default. (#12092) --- _inc/client/searchable-modules/index.jsx | 1 - _inc/client/writing/composing.jsx | 30 ++++++++++++++++++++++-- _inc/client/writing/index.jsx | 1 + modules/shortcodes.php | 4 ++-- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/_inc/client/searchable-modules/index.jsx b/_inc/client/searchable-modules/index.jsx index a6aa8ae4e07ea..c17c361e6696f 100644 --- a/_inc/client/searchable-modules/index.jsx +++ b/_inc/client/searchable-modules/index.jsx @@ -45,7 +45,6 @@ export const SearchableModules = withModuleSettingsFormHelpers( 'json-api', 'latex', 'notes', - 'shortcodes', 'shortlinks', ]; diff --git a/_inc/client/writing/composing.jsx b/_inc/client/writing/composing.jsx index b2650405086ec..2a225838171e9 100644 --- a/_inc/client/writing/composing.jsx +++ b/_inc/client/writing/composing.jsx @@ -200,9 +200,10 @@ export class Composing extends React.Component { const foundCopyPost = this.props.isModuleFound( 'copy-post' ), foundAtD = this.props.isModuleFound( 'after-the-deadline' ), foundLatex = this.props.isModuleFound( 'latex' ), - foundMarkdown = this.props.isModuleFound( 'markdown' ); + foundMarkdown = this.props.isModuleFound( 'markdown' ), + foundShortcodes = this.props.isModuleFound( 'shortcodes' ); - if ( ! foundCopyPost && ! foundMarkdown && ! foundAtD ) { + if ( ! foundCopyPost && ! foundMarkdown && ! foundAtD && ! foundShortcodes ) { return null; } @@ -210,6 +211,7 @@ export class Composing extends React.Component { latex = this.props.module( 'latex' ), atd = this.props.module( 'after-the-deadline' ), copyPost = this.props.module( 'copy-post' ), + shortcodes = this.props.module( 'shortcodes' ), unavailableInDevMode = this.props.isUnavailableInDevMode( 'after-the-deadline' ), copyPostSettings = ( ), + shortcodeSettings = ( + + + + + { __( 'Compose using shortcodes to embed media from popular sites' ) } + + + + + ), atdSettings = ( ); diff --git a/_inc/client/writing/index.jsx b/_inc/client/writing/index.jsx index b918959aad78b..6da5acc59dc3f 100644 --- a/_inc/client/writing/index.jsx +++ b/_inc/client/writing/index.jsx @@ -46,6 +46,7 @@ export class Writing extends React.Component { 'copy-post', 'masterbar', 'markdown', + 'shortcodes', 'after-the-deadline', 'custom-content-types', 'post-by-email', diff --git a/modules/shortcodes.php b/modules/shortcodes.php index de7828c6e7a0b..23ed63e1c81b8 100644 --- a/modules/shortcodes.php +++ b/modules/shortcodes.php @@ -2,12 +2,12 @@ /** * Module Name: Shortcode Embeds - * Module Description: Embed media from popular sites without any coding. + * Module Description: Shortcodes are WordPress-specific markup that let you add media from popular sites. This feature is no longer necessary as the editor now handles media embeds rather gracefully. * Sort Order: 3 * First Introduced: 1.1 * Major Changes In: 1.2 * Requires Connection: No - * Auto Activate: Yes + * Auto Activate: No * Module Tags: Photos and Videos, Social, Writing, Appearance * Feature: Writing * Additional Search Queries: shortcodes, shortcode, embeds, media, bandcamp, dailymotion, facebook, flickr, google calendars, google maps, google+, polldaddy, recipe, recipes, scribd, slideshare, slideshow, slideshows, soundcloud, ted, twitter, vimeo, vine, youtube