芝麻web文件管理V1.00
编辑当前文件:/var/www/cognitio.in/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/editor-components/page-selector/index.js
/** * External dependencies */ import { __ } from '@wordpress/i18n'; import { PanelBody, SelectControl } from '@wordpress/components'; import { useSelect } from '@wordpress/data'; /** * Internal dependencies */ import { formatTitle } from '../utils'; const PageSelector = ( { setPageId, pageId, labels } ) => { const pages = useSelect( ( select ) => { return select( 'core' ).getEntityRecords( 'postType', 'page', { status: 'publish', orderby: 'title', order: 'asc', per_page: 100, } ); }, [] ) || null; if ( pages ) { return (
{ return { label: formatTitle( page, pages ), value: parseInt( page.id, 10 ), }; } ), ] } onChange={ ( value ) => setPageId( parseInt( value, 10 ) ) } />
); } return null; }; export default PageSelector;