Skip to content

Commit

Permalink
Add a "Write your story" filter. (#5549)
Browse files Browse the repository at this point in the history
fixes #5466
  • Loading branch information
markjaquith authored and aduth committed Mar 10, 2018
1 parent b5cdec9 commit 8a4d644
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions editor/components/default-block-appender/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ import BlockDropZone from '../block-drop-zone';
import { insertDefaultBlock, startTyping } from '../../store/actions';
import { getBlock, getBlockCount } from '../../store/selectors';

export function DefaultBlockAppender( { isLocked, isVisible, onAppend, showPrompt } ) {
export function DefaultBlockAppender( { isLocked, isVisible, onAppend, showPrompt, placeholder } ) {
if ( isLocked || ! isVisible ) {
return null;
}

const value = placeholder || __( 'Write your story' );

return (
<div className="editor-default-block-appender">
<BlockDropZone />
Expand All @@ -34,7 +36,7 @@ export function DefaultBlockAppender( { isLocked, isVisible, onAppend, showPromp
onFocus={ onAppend }
onClick={ onAppend }
onKeyDown={ onAppend }
value={ showPrompt ? __( 'Write your story' ) : '' }
value={ showPrompt ? value : '' }
/>
</div>
);
Expand Down Expand Up @@ -66,10 +68,11 @@ export default compose(
} )
),
withContext( 'editor' )( ( settings ) => {
const { templateLock } = settings;
const { templateLock, bodyPlaceholder } = settings;

return {
isLocked: !! templateLock,
placeholder: bodyPlaceholder,
};
} ),
)( DefaultBlockAppender );
1 change: 1 addition & 0 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
'disableCustomColors' => get_theme_support( 'disable-custom-colors' ),
'disablePostFormats' => ! current_theme_supports( 'post-formats' ),
'titlePlaceholder' => apply_filters( 'enter_title_here', __( 'Add title', 'gutenberg' ), $post ),
'bodyPlaceholder' => apply_filters( 'write_your_story', __( 'Write your story', 'gutenberg' ), $post ),
);

if ( ! empty( $color_palette ) ) {
Expand Down

0 comments on commit 8a4d644

Please sign in to comment.