PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 1.8.2
GenerateBlocks v1.8.2
trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.3.0
generateblocks / src / extend / dynamic-content / inspector-controls / ExcerptControl.js
generateblocks / src / extend / dynamic-content / inspector-controls Last commit date
AuthorMetaControl.js 3 years ago CommentsControl.js 4 years ago ContentTypeControl.js 4 years ago DynamicSourceControl.js 3 years ago ExcerptControl.js 4 years ago LinkTypeControl.js 3 years ago PostDateControl.js 4 years ago PostMetaControl.js 3 years ago TermsControl.js 4 years ago
ExcerptControl.js
43 lines
1 import { ToggleControl } from '@wordpress/components';
2 import { __ } from '@wordpress/i18n';
3 import NumberControl from '../../../components/number-control';
4 import DebouncedTextControl from '../../../components/debounced-text-control';
5
6 export default function ExcerptControl( props ) {
7 const {
8 isActive,
9 useDefaultMoreLink,
10 customMoreLinkText,
11 setAttributes,
12 } = props;
13
14 return (
15 <>
16 { isActive &&
17 <>
18 <NumberControl
19 { ...props }
20 label={ __( 'Excerpt length', 'generateblocks' ) }
21 attributeName="excerptLength"
22 min="0"
23 />
24
25 <ToggleControl
26 label={ __( 'Use default more link', 'generateblocks' ) }
27 checked={ !! useDefaultMoreLink }
28 onChange={ ( value ) => setAttributes( { useDefaultMoreLink: value } ) }
29 />
30
31 { ! useDefaultMoreLink &&
32 <DebouncedTextControl
33 label={ __( 'Custom more link text', 'generateblocks' ) }
34 value={ customMoreLinkText }
35 onChange={ ( value ) => setAttributes( { customMoreLinkText: value } ) }
36 />
37 }
38 </>
39 }
40 </>
41 );
42 }
43