Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const { items_created, last_created_at } = response;
const date = momentUtils.toDate( momentUtils.toMoment( last_created_at ) );
// Show editing notice
yield call(
[ wpDispatch( 'core/editor' ), 'createSuccessNotice' ],
NOTICES[ NOTICE_EDITING_SERIES ],
{ id: NOTICE_EDITING_SERIES, isDismissible: false }
);
// Show progress notice
yield call(
[ wpDispatch( 'core/editor' ), 'createSuccessNotice' ],
`${ sprintf( NOTICES[ NOTICE_PROGRESS_ON_SERIES_CREATION_COUNT ], items_created ) } ${ sprintf( NOTICES[ NOTICE_PROGRESS_ON_SERIES_CREATION ], date ) }`,
{ id: NOTICE_PROGRESS_ON_SERIES_CREATION, isDismissible: true }
);
}
if ( yield select( selectors.isCompleted ) ) {
yield put( allowEdits() ); // Allow datetime block to be editable again
// Remove editing notice
yield call(
[ wpDispatch( 'core/editor' ), 'removeNotice' ],
NOTICE_EDITING_SERIES
);
yield call(
[ wpDispatch( 'core/editor' ), 'removeNotice' ],
NOTICE_PROGRESS_ON_SERIES_CREATION
);
break; // We done
componentDidUpdate( prevProps, prevState ) {
const searchResults = this.searchItems( this.props.items );
// Announce the search results to screen readers.
if ( this.state.filterValue && !! searchResults.length ) {
this.props.debouncedSpeak( sprintf( _n(
'%d result found',
'%d results found',
searchResults.length
), searchResults.length ), 'assertive' );
} else if ( this.state.filterValue ) {
this.props.debouncedSpeak( __( 'No results.' ), 'assertive' );
}
if ( this.state.tab !== prevState.tab ) {
this.tabContainer.scrollTop = this.tabScrollTop[ this.state.tab ];
}
}
focusedBorderColor,
borderStyle,
} = this.props;
const decodedPlaceholder = decodeEntities( placeholder );
const borderColor = this.props.isSelected ? focusedBorderColor : 'transparent';
return (
function PostPublishModalPrepublish( {
hasPublishAction,
publishDate,
isFloating,
visibility,
children,
postType,
} ) {
const postLabel = get( postType, [ 'labels', 'singular_name' ] );
let prePublishBodyText,
prePublishDateText;
if ( ! hasPublishAction ) {
prePublishBodyText = __( 'When you’re ready, submit your work for review, and an Editor will be able to approve it for you.' );
} else {
prePublishBodyText = sprintf(
/* translators: %s: post type singular name */
__( 'Double-check your settings, then publish your %s.' ), postLabel
);
}
if ( isFloating ) {
prePublishDateText = __( 'Your work will be published right now.' );
} else if ( new Date( publishDate ) < new Date() ) {
prePublishDateText = __( 'Your work will be published right now and back-dated.' );
} else {
prePublishDateText = __( 'Your work will be published at the specified date and time.' );
}
const getVisibilityInfo = () => find( visibilityOptions, { value: visibility } ).info;
return (
selected: ( n ) =>
sprintf(
_n(
'%d attribute selected',
'%d attributes selected',
n,
'woocommerce'
),
n
),
updated: __(
addFilter( 'carbon-fields.association.validate', 'carbon-fields/core', ( field, value ) => {
const { min, required } = field;
if ( required && isEmpty( value ) ) {
return __( 'This field is required.', 'carbon-fields-ui' );
}
if ( min > 0 && value.length < min ) {
return sprintf( __( 'Minimum number of items not reached (%s items)', 'carbon-fields-ui' ), [ field.min ] );
}
return null;
} );
return null;
}
const { loading, availableTerms, selectedTerms } = this.state;
const termNames = availableTerms.map( ( term ) => term.name );
const newTermLabel = get(
taxonomy,
[ 'labels', 'add_new_item' ],
slug === 'post_tag' ? __( 'Add New Tag' ) : __( 'Add New Term' )
);
const singularName = get(
taxonomy,
[ 'labels', 'singular_name' ],
slug === 'post_tag' ? __( 'Tag' ) : __( 'Term' )
);
const termAddedLabel = sprintf( _x( '%s added', 'term' ), singularName );
const termRemovedLabel = sprintf( _x( '%s removed', 'term' ), singularName );
const removeTermLabel = sprintf( _x( 'Remove %s', 'term' ), singularName );
return (
<div>
<textarea rows="{" for="" placeholder="{" maxlength="{" disabled="{" value="{" id="{"> <div className={ characterCountClass }>
{ sprintf(
_n(
'%d character remaining',
'%d characters remaining',
charactersRemaining,
'jetpack'
),
charactersRemaining
) }
</div>
</div>
</Fragment>
) }
</div>
);
}
}</textarea></div>
{ __( 'Update Key' ) }
<button type="button">
{ __( 'Remove Key' ) }
</button>
);
const placholderAPIStateLoading = (
);
const getAPIInstructions = sprintf(
"This is your first map block. You need to get a Google Maps API key. <a href="%s">Here's how to do it</a>.",
'https://developers.google.com/maps/documentation/javascript/get-api-key'
);
const placeholderAPIStateFailure = (
<div>
{ getAPIInstructions }
</div>
if ( errors.length === 1 ) {
if ( errors[ 0 ] && errors[ 0 ].email ) {
return sprintf( __( '%s is not a valid email address.' ), errors[ 0 ].email );
}
return errors[ 0 ];
}
if ( errors.length === 2 ) {
return sprintf(
__( '%s and %s are not a valid email address.' ),
errors[ 0 ].email,
errors[ 1 ].email
);
}
const inValidEmails = errors.map( error => error.email );
return sprintf( __( '%s are not a valid email address.' ), inValidEmails.join( ', ' ) );
}
return null;
}