Submit
Path:
~
/
home
/
getwphos
/
public_html
/
bubrupamjcb.com
/
wp-content
/
plugins
/
canvas
/
layouts
/
admin-list
/
utils
/
File Content:
export.js
/** * External dependencies */ const { kebabCase, } = window.lodash; /** * WordPress dependencies */ const { apiFetch, } = wp; /** * Internal dependencies */ import { download } from './file'; /** * Export a layout block as a JSON file. * * @param {number} id */ async function exportLayoutBlock( id ) { const postType = await apiFetch( { path: `/wp/v2/types/canvas_layout` } ); const post = await apiFetch( { path: `/wp/v2/${ postType.rest_base }/${ id }?context=edit` } ); const title = post.title.raw; const content = post.content.raw; const fileContent = JSON.stringify( { __file: 'canvas_layout', title, content, }, null, 2 ); const fileName = kebabCase( title ) + '.json'; download( fileName, fileContent, 'application/json' ); } export default exportLayoutBlock;
Submit
FILE
FOLDER
Name
Size
Permission
Action
export.js
801 bytes
0644
file.js
1093 bytes
0644
import.js
1177 bytes
0644
N4ST4R_ID | Naxtarrr