Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance the shortcode block to support previewing of shortcodes #4710

Closed
Closed
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
c3fd280
Work in progress fixes for ticket #1054
Jan 24, 2018
8cec7fc
eslint fixes and reordering for better readibility and conforming to …
Jan 25, 2018
9fc96f8
Minor changes to the title and code comments to change language to sh…
Jan 25, 2018
00abaca
Post ID is now retrieved from redux store, instead of from GET params
Jan 25, 2018
3646f61
Injects custom css and js that might be needed by iframe
Jan 27, 2018
2681b28
Checks shortcode content type and fetches custom css/js (if any)
Jan 27, 2018
d7971cb
JS and CSS fixes to enable rendering of shortcode previews
Jan 27, 2018
3e5c6b4
Merge remote-tracking branch 'upstream/master'
Jan 27, 2018
80800ed
fixes warnings
Jan 27, 2018
63549b4
fixes warnings
Jan 27, 2018
9997daf
fixes warnings
Jan 27, 2018
4095bca
fixes warnings
Jan 27, 2018
aa57071
fixes warnings
Jan 27, 2018
0e71158
Bug fix : [playlist] shortcode now renders in the preview
Jan 28, 2018
4871b73
Fixes jest Snapshot which caused the tests to fail
Jan 30, 2018
7f00de6
Merge remote-tracking branch 'upstream/master'
Feb 2, 2018
a6d250a
Enhancement: Implements caching of results
niranjan-uma-shankar Feb 2, 2018
3a55c5a
lint fixes
niranjan-uma-shankar Feb 2, 2018
7fdad34
Fix: Don't save in transients if result is empty
niranjan-uma-shankar Feb 2, 2018
a486b44
Fix: Handles better empty shortcode output scenario
niranjan-uma-shankar Feb 2, 2018
c9f11b5
Minor fix: Translatable function for a string was missing, fixed it
niranjan-uma-shankar Feb 3, 2018
5bf4ea3
Added some null checks
niranjan-uma-shankar Feb 3, 2018
861dd1c
Unit tests for the Shortcode preview rendering REST API.
niranjan-uma-shankar Feb 3, 2018
bc9a96a
Added some error messages
niranjan-uma-shankar Feb 6, 2018
fc05936
Refactored code & breaking down to components
niranjan-uma-shankar Feb 6, 2018
d2143a5
Updated tests to reflect new refactor changes
niranjan-uma-shankar Feb 6, 2018
6c31a5f
Code refactor
niranjan-uma-shankar Feb 6, 2018
f6d525f
Adding a comment
niranjan-uma-shankar Feb 6, 2018
6aacd6e
Added encodeURIcomponent() to encode the shortcode content on the fro…
niranjan-uma-shankar Feb 12, 2018
54f2fb3
Refactored code
niranjan-uma-shankar Feb 15, 2018
e4bbdb6
Removed these lines - they were added as a fix for an earlier observe…
niranjan-uma-shankar Feb 15, 2018
63cfafd
Merge remote-tracking branch 'upstream/master'
niranjan-uma-shankar Feb 15, 2018
2ce2fef
Drop the focus/setFocus props from block edit functions (#4872)
niranjan-uma-shankar Feb 15, 2018
3797ce8
Drop the focus/setFocus props from block edit functions (#4872)
niranjan-uma-shankar Feb 15, 2018
65efa0b
[embed] shortcode previews are rendered with oembed endpoint
niranjan-uma-shankar Feb 17, 2018
1259bc9
Moved connect HOC to ShortcodePreview component, so that jest tests c…
niranjan-uma-shankar Feb 19, 2018
3b506ed
Avoiding the selector, since it creates an issue with bundle size due…
niranjan-uma-shankar Feb 24, 2018
9230d75
rebase master
niranjan-uma-shankar Feb 24, 2018
f837d0a
Variable name changes
niranjan-uma-shankar Feb 25, 2018
8237a66
Refactoring changes
niranjan-uma-shankar Feb 25, 2018
0ae8100
Modifications to the tests in line with the REST API changes
niranjan-uma-shankar Feb 25, 2018
d8ed5b2
Merge remote-tracking branch 'upstream/master'
niranjan-uma-shankar Feb 25, 2018
49b2e85
Undo logging changes
niranjan-uma-shankar Feb 25, 2018
4595fb4
Updated schema, and fixed lint
niranjan-uma-shankar Feb 26, 2018
777b304
Reverting API changes to do_shortcode/run_shortcode method
niranjan-uma-shankar Mar 6, 2018
80ae62a
Merge
niranjan-uma-shankar Apr 15, 2018
d81a308
Merge
niranjan-uma-shankar Apr 15, 2018
12d83a0
Merge remote-tracking branch 'upstream/master'
niranjan-uma-shankar Apr 15, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions blocks/library/shortcode/block.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/**
* WordPress dependencies
*/
import { withInstanceId, Dashicon } from '@wordpress/components';
import { Component } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import ShortcodePreview from './preview';
import BlockControls from '../../block-controls';
import PlainText from '../../plain-text';

export class Shortcode extends Component {
constructor() {
super();
this.state = {
preview: false,
};
}

render() {
const { preview } = this.state;
const { instanceId, postId, setAttributes, attributes, isSelected } = this.props;
const inputId = `blocks-shortcode-input-${ instanceId }`;
const shortcodeContent = ( attributes.text || '' ).trim();

const controls = isSelected && (
<BlockControls key="controls">
<div className="components-toolbar">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very similar to the Tabs in the HTML block, maybe not in this PR but it would be nice to extract those to a reusable Tabs component.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree!

<button
className={ `components-tab-button ${ ! preview ? 'is-active' : '' }` }
onClick={ () => this.setState( { preview: false } ) }>
<span>{ __( 'Shortcode' ) }</span>
</button>
<button
className={ `components-tab-button ${ preview ? 'is-active' : '' }` }
onClick={ () => shortcodeContent.length && this.setState( { preview: true } ) } >
<span>{ __( 'Preview' ) }</span>
</button>
</div>
</BlockControls>
);

if ( preview ) {
return [
controls,
<ShortcodePreview key="preview"
shortcode={ shortcodeContent }
postId={ postId }
/>,
];
}

return [
controls,
<div className="wp-block-shortcode" key="placeholder">
<label htmlFor={ inputId }>
<Dashicon icon="editor-code" />
{ __( 'Shortcode' ) }
</label>
<PlainText
id={ inputId }
value={ attributes.text }
placeholder={ __( 'Write shortcode here…' ) }
onChange={ ( text ) => setAttributes( { text } ) }
/>
</div>,
];
}
}

export default withInstanceId( Shortcode );
24 changes: 2 additions & 22 deletions blocks/library/shortcode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
*/
import { RawHTML } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { withInstanceId, Dashicon } from '@wordpress/components';

/**
* Internal dependencies
*/
import './editor.scss';
import PlainText from '../../plain-text';
import Shortcode from './block';

export const name = 'core/shortcode';

Expand Down Expand Up @@ -59,26 +58,7 @@ export const settings = {
html: false,
},

edit: withInstanceId(
( { attributes, setAttributes, instanceId } ) => {
const inputId = `blocks-shortcode-input-${ instanceId }`;

return (
<div className="wp-block-shortcode">
<label htmlFor={ inputId }>
<Dashicon icon="editor-code" />
{ __( 'Shortcode' ) }
</label>
<PlainText
id={ inputId }
value={ attributes.text }
placeholder={ __( 'Write shortcode here…' ) }
onChange={ ( text ) => setAttributes( { text } ) }
/>
</div>
);
}
),
edit: Shortcode,

save( { attributes } ) {
return <RawHTML>{ attributes.text }</RawHTML>;
Expand Down
53 changes: 53 additions & 0 deletions blocks/library/shortcode/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* External dependencies
*/
import { connect } from 'react-redux';

/**
* WordPress dependencies
*/
import { withAPIData, Spinner, SandBox } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { compose } from '@wordpress/element';

function ShortcodePreview( { response } ) {
if ( response.isLoading || ! response.data ) {
return (
<div key="loading" className="wp-block-embed is-loading">
<Spinner />
<p>{ __( 'Loading...' ) }</p>
</div>
);
}

const html = response.data.head_scripts_styles + ' ' + response.data.html + ' ' + response.data.footer_scripts_styles;
return (
<figure className="wp-block-embed" key="embed">
<SandBox
html={ html }
title="Preview"
type={ response.data.type }
/>
</figure>
);
}

const applyConnect = connect(
( state ) => {
return {
postId: state.currentPost.id,
};
},
);

const applyWithAPIData = withAPIData( ( props ) => {
const { shortcode, postId } = props;
return {
response: `/gutenberg/v1/shortcodes?shortcode=${ encodeURIComponent( shortcode ) }&postId=${ postId }`,
};
} );

export default compose( [
applyConnect,
applyWithAPIData,
] )( ShortcodePreview );
1 change: 0 additions & 1 deletion blocks/library/shortcode/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { blockEditRender } from 'blocks/test/helpers';
describe( 'core/shortcode', () => {
test( 'block edit matches snapshot', () => {
const wrapper = blockEditRender( name, settings );

expect( wrapper ).toMatchSnapshot();
} );
} );
9 changes: 8 additions & 1 deletion components/sandbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,18 @@ export default class Sandbox extends Component {
body {
margin: 0;
}

body.html {
width: 100%;
}

body.video,
body.video > div,
body.video > div > iframe {
width: 100%;
height: 100%;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it going to harm anyone to apply height: 100% in all cases? I'm using it on my branch based upon your work where everything has {"type":"html"}. It works for videos & audio & I've not had any issues.

Copy link
Author

@niranjan-uma-shankar niranjan-uma-shankar Feb 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lewiscowles1986 Regarding changes done to Sandbox component - have you verified if it doesn't affect the embed block? This is because the embed block uses this component too. Check here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it with oEmbeds by typing a youtube URL into the shortcode block. Seemed to work

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbf I changed height: 100%; to min-height: 100%;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lewiscowles1986 I was referring to the embed block - not embeds in the shortcode block.

screen shot 2018-02-24 at 11 54 34 pm

Copy link
Contributor

@Lewiscowles1986 Lewiscowles1986 Feb 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works in embed block still 😉
screenshot capture - 2018-02-24 - 20-24-54
screenshot capture - 2018-02-24 - 20-24-45

I have found a problem with the embed block though. It seems intended to only render the block once without an editor like shortcode block has
gutenberg.zip

I can share my commit once I push to github, it's mostly your code.

}

body > div > * {
margin-top: 0 !important; /* has to have !important to override inline styles */
margin-bottom: 0 !important;
Expand All @@ -163,8 +169,9 @@ export default class Sandbox extends Component {
<style dangerouslySetInnerHTML={ { __html: style } } />
</head>
<body data-resizable-iframe-connected="data-resizable-iframe-connected" className={ this.props.type }>
<div dangerouslySetInnerHTML={ { __html: this.props.html } } />
<div id="content" dangerouslySetInnerHTML={ { __html: this.props.html } } />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need a separate div for the html, js and styles can't we just concat everything when passing the html prop?

<script type="text/javascript" dangerouslySetInnerHTML={ { __html: observeAndResizeJS } } />

</body>
</html>
);
Expand Down
186 changes: 186 additions & 0 deletions lib/class-wp-rest-shortcodes-controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
<?php
/**
* Shortcode Blocks REST API: WP_REST_Shortcodes_Controller class
*
* @package gutenberg
* @since 2.0.0
*/

/**
* Controller which provides a REST endpoint for Gutenberg to preview shortcode blocks.
*
* @since 2.0.0
*
* @see WP_REST_Controller
*/
class WP_REST_Shortcodes_Controller extends WP_REST_Controller {
/**
* Constructs the controller.
*
* @since 2.0.0
* @access public
*/
public function __construct() {
// @codingStandardsIgnoreLine - PHPCS mistakes $this->namespace for the namespace keyword
$this->namespace = 'gutenberg/v1';
$this->rest_base = 'shortcodes';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be better named shortcode-renderer

}

/**
* Registers the necessary REST API routes.
*
* @since 0.10.0
* @access public
*/
public function register_routes() {
// @codingStandardsIgnoreLine - PHPCS mistakes $this->namespace for the namespace keyword
$namespace = $this->namespace;

register_rest_route( $namespace, '/' . $this->rest_base, array(
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_shortcode_output' ),
'permission_callback' => array( $this, 'get_shortcode_output_permissions_check' ),
),
'schema' => array( $this, 'get_public_item_schema' ),
) );
}

/**
* Checks if a given request has access to read shortcode blocks.
*
* @since 2.0.0
* @access public
*
* @param WP_REST_Request $request Full details about the request.
* @return true|WP_Error True if the request has read access, WP_Error object otherwise.
*/
public function get_shortcode_output_permissions_check( $request ) {
if ( ! current_user_can( 'edit_posts' ) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If $args['postId'] is not empty, then it should also check if current_user_can( 'edit_post', $args['postId'] ).

return new WP_Error( 'gutenberg_shortcode_block_cannot_read', __( 'Sorry, you are not allowed to read shortcode blocks as this user.', 'gutenberg' ), array(
'status' => rest_authorization_required_code(),
) );
}

return true;
}

/**
* Filters shortcode content through their hooks.
*
* @since 2.0.0
* @access public
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/
public function get_shortcode_output( $request ) {
global $post;
global $wp_embed;
$head_scripts_styles = '';
$footer_scripts_styles = '';
$type = 'html';
$output = '';
$args = $request->get_params();
$post = isset( $args['postId'] ) ? get_post( $args['postId'] ) : null;
$shortcode = isset( $args['shortcode'] ) ? trim( $args['shortcode'] ) : '';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These args don't seem to be defined in the schema, so they aren't getting sanitized/validated. The postId should be validated to be an integer and refer to an existing post. The shortcode should be validated to actually only contain a shortcode.


// Initialize $data.
$data = array(
'html' => $output,
'type' => $type,
);

if ( empty( $shortcode ) ) {
$data['html'] = __( 'Enter something to preview', 'gutenberg' );
return rest_ensure_response( $data );
}

if ( ! empty( $post ) ) {
setup_postdata( $post );
}

$output = trim( apply_filters( 'the_content', $shortcode ) );

if ( empty( $output ) ) {
$data['html'] = __( 'Sorry, couldn\'t render a preview', 'gutenberg' );
return rest_ensure_response( $data );
}

ob_start();
wp_head();
$head_scripts_styles = ob_get_clean();

ob_start();
wp_footer();
$footer_scripts_styles = ob_get_clean();

// Check if shortcode is returning a video. The video type will be used by the frontend to maintain 16:9 aspect ratio.
Copy link
Contributor

@Lewiscowles1986 Lewiscowles1986 Feb 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why this is still here, but it doesn't seem to offer anything over applying the the_content filter. Can you tell me about why you prefer to retain this method and having a "type"?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lewiscowles1986 Are you referring to why I'm determining the type? I'm finding out the type since sandboxing video content sets the height, as mentioned here. I see that you're always returning the type value as html - so this condition is never met?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That condition isn't for shortcode component though. You're correct that condition of the sandbox component isn't met, because there is no certainty the front-end will enforce a 16:9 aspect ratio. For me it's all about trying to get as close to 1:1 expectations

if ( has_shortcode( $shortcode, 'video' ) ) {
$type = 'video';
} elseif ( has_shortcode( $shortcode, 'embed' ) ) {
$embed_request = new WP_REST_Request( 'GET', '/oembed/1.0/proxy' );
$pattern = get_shortcode_regex();
if ( preg_match_all( '/' . $pattern . '/s', $shortcode, $matches ) ) {
$embed_request['url'] = $matches[5][0];
$embed_response = rest_do_request( $embed_request );
if ( $embed_response->is_error() ) {
// Convert to a WP_Error object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error handling here won't work. Also, why are we wp_die()ing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBF I had hoped that the REST API handled this as I glanced at it yesterday

$error = $embed_response->as_error();
$message = $embed_response->get_error_message();
$error_data = $embed_response->get_error_data();
$status = isset( $error_data['status'] ) ? $error_data['status'] : 500;
wp_die( printf( '<p>An error occurred: %s (%d)</p>', $message, $error_data ) );
}
$embed_data = $embed_response->get_data();
}
$type = $embed_data->type;
}
$data = array(
'html' => $output,
'head_scripts_styles' => $head_scripts_styles,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great but the schema at the bottom of the file is still reflecting style and js names

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the schema, thanks.

'footer_scripts_styles' => $footer_scripts_styles,
'type' => $type,
);

return rest_ensure_response( $data );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function seems a bit complex, I'm not confident in reviewing this code personally, might be good if someone else could take a look but can I ask how did you come up with the logic here and all the specific cases? don't we have a generic way to render all shortcodes?

Copy link
Author

@niranjan-uma-shankar niranjan-uma-shankar Feb 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's what I've done:

  • The crux of this API is exactly what you've mentioned - it makes use of do_shortcode() as a generic way to render all shortcodes. There are a few issues and edge cases that I've additionally handled.
  • [embed] shortcode being a "special" one that needs to be run before all other shortcodes, so do_shortcode wouldn't directly work with [embed]. So, I use the oembed proxy endpoint (same as that used by the embed block).
  • postId is needed since some shortcodes such as [gallery] expect the context (reference comment and gallery shortcode performing a get_post in the core source file.). So I'm sending the postId to the REST API to set the global post variable.
  • When [playlist] is run through do_shortcode(), a script element is returned in the response that contains a data structure. This shortcode needs additional styles and scripts to act on the data structure. Following this shortcode in the core source files, I landed upon the need to include wp_footer() in the response sent by the API. Pl check this comment discussion too.
  • [gallery] too had its own quirk of needing styles to be returned in the response.
  • So, the function determines if the shortcode is a gallery or playlist to return the appropriate styles and scripts.
  • Implements caching via transients. Though this might be redundant with the new withAPIData change which handles caching on the front end.
  • Finally, I determine if the type of the shortcode is video. Since videos need a 16:9 aspect ratio for responsive render (reference here).

Happy to provide more clarity if needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing something special for embed, you could instead apply_filters( 'the_content', $shortcode ).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, I think that all of this function could be replaced with something that does the following:

global $post;
$post = get_post( $args['postId'] );
setup_postdata();
ob_start();
?>
<!DOCTYPE html>
<html>
	<head>
		<?php wp_head(); ?>
	</head>
	<body>
		<?php echo apply_filters( 'the_content', $args['shortcode'] ); ?>
		<?php wp_footer(); ?>
	</body>
</html>
<?php
$output = ob_get_clean();

This entire output could then be passed into the Sandbox component, though I realize that the component is expecting the supplied html to be in the body. This could reduce the special cases needing to be accounted for.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing and providing your feedback @westonruter . I will implement your suggestion and test it thoroughly.

Copy link
Author

@niranjan-uma-shankar niranjan-uma-shankar Feb 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@westonruter I just took a closer look at this method :

  • The Sandbox component (which is also used by the embed block) expects the type parameter (if content is a video or otherwise), based on which it explicitly sets the height based on a 16:9 ratio for responsive content.

The method you've outlined doesn't determine type of content as video or otherwise, which means that 16:9 aspect ratio will never be set if user is trying to embed from TED or funnyordie etc. I will check if there's another way to determine the type. Will be happy to hear your take on this too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I altered the rest endpoint to only return 'html' type and this seems to work with embed or shortcode

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also not using this rest endpoint (maybe why it has not affected the embed)

}

/**
* Retrieves a shortcode block's schema, conforming to JSON Schema.
*
* @since 0.10.0
* @access public
*
* @return array Item schema data.
*/
public function get_item_schema() {
return array(
'$schema' => 'http://json-schema.org/schema#',
'title' => 'shortcode-block',
'type' => 'object',
'properties' => array(
'html' => array(
'description' => __( 'The block\'s content with shortcodes filtered through hooks.', 'gutenberg' ),
'type' => 'string',
'required' => true,
),
'type' => array(
'description' => __( 'The filtered content type - video or otherwise', 'gutenberg' ),
'type' => 'string',
'required' => true,
),
'head_scripts_styles' => array(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this will contain not just scripts and styles but anything that is output by wp_head (and wp_footer) below. I think this would be better named just html_head and html_footer, and maybe html_body instead of html.

'description' => __( 'Links to style sheets and scripts to render the shortcode', 'gutenberg' ),
'type' => 'string',
'required' => true,
),
'footer_scripts_styles' => array(
'description' => __( 'Links to style sheets and scripts to render the shortcode', 'gutenberg' ),
'type' => 'string',
'required' => true,
),
),
);
}
}
Loading