Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
// Once the post has been submitted for review this button
// is not needed for the contributor role.
if (! hasPublishAction && isPending) {
return null;
}
const label = isPending ? __('Save as Pending') : __('Save Draft');
if (! isLargeViewport) {
return (
);
}
return (
<button>
{ label }
</button>
);
}
}
// Once the post has been submitted for review this button
// is not needed for the contributor role.
if ( ! hasPublishAction && isPending ) {
return null;
}
const label = isPending ? __( 'Save as Pending' ) : __( 'Save Draft' );
if ( ! isLargeViewport ) {
return (
onSave() }
shortcut={ displayShortcut.primary( 's' ) }
icon="cloud-upload"
/>
);
}
return (
<button> onSave() }
shortcut={ displayShortcut.primary( 's' ) }
isTertiary
>
{ label }
</button>
);
}
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { displayShortcut } from '@wordpress/keycodes';
export const FORMATTING_CONTROLS = [
{
icon: 'editor-bold',
title: __( 'Bold' ),
shortcut: displayShortcut.primary( 'b' ),
format: 'bold',
},
{
icon: 'editor-italic',
title: __( 'Italic' ),
shortcut: displayShortcut.primary( 'i' ),
format: 'italic',
},
{
icon: 'admin-links',
title: __( 'Link' ),
shortcut: displayShortcut.primary( 'k' ),
format: 'link',
},
{
icon: 'editor-strikethrough',
title: __( 'Strikethrough' ),
shortcut: displayShortcut.access( 'd' ),
format: 'strikethrough',
},
];
{
icon: 'editor-bold',
title: __( 'Bold' ),
shortcut: displayShortcut.primary( 'b' ),
format: 'bold',
},
{
icon: 'editor-italic',
title: __( 'Italic' ),
shortcut: displayShortcut.primary( 'i' ),
format: 'italic',
},
{
icon: 'admin-links',
title: __( 'Link' ),
shortcut: displayShortcut.primary( 'k' ),
format: 'link',
},
{
icon: 'editor-strikethrough',
title: __( 'Strikethrough' ),
shortcut: displayShortcut.access( 'd' ),
format: 'strikethrough',
},
];
if ( forceSavedMessage || ( ! isNew && ! isDirty ) ) {
return (
<span>
{ __( 'Saved' ) }
</span>
);
}
return (
{ __( 'Save Draft' ) }
);
}
}
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { displayShortcut } from '@wordpress/keycodes';
export const FORMATTING_CONTROLS = [
{
icon: 'editor-bold',
title: __( 'Bold' ),
shortcut: displayShortcut.primary( 'b' ),
format: 'bold',
},
{
icon: 'editor-italic',
title: __( 'Italic' ),
shortcut: displayShortcut.primary( 'i' ),
format: 'italic',
},
{
icon: 'admin-links',
title: __( 'Link' ),
shortcut: displayShortcut.primary( 'k' ),
format: 'link',
},
{
icon: 'editor-strikethrough',
if ( forceSavedMessage || ( ! isNew && ! isDirty ) ) {
return (
<span>
{ __( 'Saved' ) }
</span>
);
}
return (
{ __( 'Save Draft' ) }
);
}
}