Skip to content

Commit

Permalink
Lowercase Block Editor to block editor as per the core spelling Best …
Browse files Browse the repository at this point in the history
…Practices (#14205)

## Description
I've updated all references to Block Editor to be lowercase as they aren't proper nouns. This conforms to the core spelling Best Practices;
“block editor” or “block-based editor” | “Block Editor” or “Gutenberg” | When referring to the new editor.
Reference - https://make.wordpress.org/core/handbook/best-practices/spelling/

Also ties back to the original discussion around the capitalization convention here;
#12856

Previously opened #14203 to handle the Classic Editor changes.

## How has this been tested?
Only tested that it didn't break anything.

## Types of changes
Mostly comment changes, there was one string change and a couple translator comment changes.

## Checklist:
- [x] My code is tested.
- [x] My code follows the WordPress code style. <!-- Check code: `npm run lint`, Guidelines: https://make.wordpress.org/core/handbook/best-practices/coding-standards/javascript/ -->
- [x] My code follows the accessibility standards. <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/coding-standards/accessibility-coding-standards/ -->
- [x] My code has proper inline documentation. <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/ -->
- [x] I've included developer documentation if appropriate. <!-- Handbook: https://wordpress.org/gutenberg/handbook/designers-developers/ -->
  • Loading branch information
Garrett Hyder authored and jorgefilipecosta committed Mar 4, 2019
1 parent e67de72 commit 00454e4
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/designers-developers/designers/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Designer Documentation

For those designing blocks and other Block Editor integrations, this documentation will provide resources for creating beautiful and intuitive layouts.
For those designing blocks and other block editor integrations, this documentation will provide resources for creating beautiful and intuitive layouts.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The last argument in the `wp_enqueue_script()` function is an array of dependenc

See [Packages](/docs/designers-developers/developers/packages.md) for list of available packages and what objects they export.

After you have updated both JavaScript and PHP files, go to the Block Editor and create a new post.
After you have updated both JavaScript and PHP files, go to the block editor and create a new post.

Add a quote block, and in the right sidebar under Styles, you will see your new Fancy Quote style listed. Click the Fancy Quote to select and apply that style to your quote block.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If your code is registered and enqueued correctly, you should see a message in y

![Console Log Message Success](https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/assets/js-tutorial-console-log-success.png)

**Note for Theme Developers:** The above method of enqueing is used for plugins. If you are extending the Block Editor for your theme there is a minor difference, you will use the `get_template_directory_uri()` function instead of `plugins_url()`. So for a theme, the enqueue example is:
**Note for Theme Developers:** The above method of enqueing is used for plugins. If you are extending the block editor for your theme there is a minor difference, you will use the `get_template_directory_uri()` function instead of `plugins_url()`. So for a theme, the enqueue example is:

```php
function myguten_enqueue() {
Expand All @@ -46,4 +46,4 @@ add_action( 'enqueue_block_editor_assets', 'myguten_enqueue' );

At this point, you have a plugin in the directory `wp-content/plugins/myguten-plugin` with two files: the PHP server-side code in `myguten-plugin.php`, and the JavaScript which runs in the browser in `myguten.js`.

This puts all the initial pieces in place for you to start extending the Block Editor.
This puts all the initial pieces in place for you to start extending the block editor.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Getting Started with JavaScript

The purpose of this tutorial is to step through getting started with JavaScript and WordPress, specifically around the new Block Editor. The Gutenberg Handbook documentation contains information on the APIs available for working with the block editor. The goal of this tutorial is get you comfortable on how to use the API reference and snippets of code found within.
The purpose of this tutorial is to step through getting started with JavaScript and WordPress, specifically around the new block editor. The Gutenberg Handbook documentation contains information on the APIs available for working with the block editor. The goal of this tutorial is get you comfortable on how to use the API reference and snippets of code found within.

### What is JavaScript

JavaScript is a programming language which is loaded and executed in your web browser; compared to PHP which is run by a web server with the results sent to the browser, typically as HTML.

The Block Editor introduced in WordPress 5.0 is written entirely in JavaScript, with the code run in the browser, and not on the server, this allows for a richer and more dynamic user experience. It also requires to learn how to use JavaScript to extend and enhance the Block Editor.
The block editor introduced in WordPress 5.0 is written entirely in JavaScript, with the code run in the browser, and not on the server, this allows for a richer and more dynamic user experience. It also requires to learn how to use JavaScript to extend and enhance the block editor.


### Table of Contents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A post meta field is a WordPress object used to store extra data about a post. You need to first register a new meta field prior to use. See Managing [Post Metadata](https://developer.wordpress.org/plugins/metadata/managing-post-metadata/) to learn more about post meta.

When registering the field, note the `show_in_rest` parameter. This ensures the data will be included in the REST API, which the Block Editor uses to load and save meta data. See the [`register_meta`](https://developer.wordpress.org/reference/functions/register_meta/) function definition for extra information.
When registering the field, note the `show_in_rest` parameter. This ensures the data will be included in the REST API, which the block editor uses to load and save meta data. See the [`register_meta`](https://developer.wordpress.org/reference/functions/register_meta/) function definition for extra information.

To register the field, create a PHP plugin file called `myguten-meta-block.php` including:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ For this block, you will use the TextControl component, which is similar to an H

Attributes are the information displayed in blocks. As shown in the block tutorial, the source of attributes come from the text or HTML a user writes in the editor. For your meta block, the attribute will come from the post meta field.

By specifying the source of the attributes as `meta`, the Block Editor automatically handles the loading and storing of the data; no REST API or data functions are needed.
By specifying the source of the attributes as `meta`, the block editor automatically handles the loading and storing of the data; no REST API or data functions are needed.

Add this code to your JavaScript file (this tutorial will call the file `myguten.js`):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Prior to the block editor, custom meta boxes were used to extend the editor. Wit

The new block editor does support most existing meta boxes, see [this backward compatibility article](/docs/designers-developers/developers/backward-compatibility/meta-box.md) for more support details .

Here are two mini-tutorials for creating similar functionality to meta boxes in the Block Editor.
Here are two mini-tutorials for creating similar functionality to meta boxes in the block editor.

## Use Blocks to Store Meta

Expand Down
18 changes: 9 additions & 9 deletions docs/designers-developers/developers/tutorials/notices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Notices are informational UI displayed near the top of admin pages. WordPress core, themes, and plugins all use notices to indicate the result of an action, or to draw the user's attention to necessary information.

In the Classic Editor, notices hooked onto the `admin_notices` action can render whatever HTML they'd like. In the Block Editor, notices are restricted to a more formal API.
In the Classic Editor, notices hooked onto the `admin_notices` action can render whatever HTML they'd like. In the block editor, notices are restricted to a more formal API.

## Notices in the Classic Editor

Expand Down Expand Up @@ -33,13 +33,13 @@ function myguten_admin_notice() {
add_action( 'admin_notices', 'myguten_admin_notice' );
```

Importantly, the `admin_notices` hook allows a developer to render whatever HTML they'd like. One advantage is that the developer has a great amount of flexibility. The key disadvantage is that arbitrary HTML makes future iterations on notices more difficult, if not possible, because the iterations need to accommodate for arbitrary HTML. This is why the Block Editor has a formal API.
Importantly, the `admin_notices` hook allows a developer to render whatever HTML they'd like. One advantage is that the developer has a great amount of flexibility. The key disadvantage is that arbitrary HTML makes future iterations on notices more difficult, if not possible, because the iterations need to accommodate for arbitrary HTML. This is why the block editor has a formal API.

## Notices in the Block Editor

In the Block Editor, here's an example of the "Post published" notice:
In the block editor, here's an example of the "Post published" notice:

![Post published in the Block Editor](https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/notices/block-editor-notice.png)
![Post published in the block editor](https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/developers/tutorials/notices/block-editor-notice.png)

Producing an equivalent "Post published" notice would require code like this:

Expand Down Expand Up @@ -67,14 +67,14 @@ You'll want to use this _Notices Data API_ when producing a notice from within t
To better understand the specific code example above:

* `wp` is WordPress global window variable.
* `wp.data` is an object provided by the Block Editor for accessing the Block Editor data store.
* `wp.data.dispatch('core/notices')` accesses functionality registered to the Block Editor data store by the Notices package.
* `createNotice()` is a function offered by the Notices package to register a new notice. The Block Editor reads from the notice data store in order to know which notices to display.
* `wp.data` is an object provided by the block editor for accessing the block editor data store.
* `wp.data.dispatch('core/notices')` accesses functionality registered to the block editor data store by the Notices package.
* `createNotice()` is a function offered by the Notices package to register a new notice. The block editor reads from the notice data store in order to know which notices to display.

Check out the [_Loading JavaScript_](/docs/designers-developers/developers/tutorials/javascript/loading-javascript.md) tutorial for a primer on how to load your custom JavaScript into the Block Editor.
Check out the [_Loading JavaScript_](/docs/designers-developers/developers/tutorials/javascript/loading-javascript.md) tutorial for a primer on how to load your custom JavaScript into the block editor.

## Learn More

The Block Editor offers a complete API for generating notices. The official documentation is a great place to review what's possible.
The block editor offers a complete API for generating notices. The official documentation is a great place to review what's possible.

For a full list of the available actions and selectors, refer to the [Notices Data Handbook](/docs/designers-developers/developers/data/data-core-notices.md) page.
2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function the_gutenberg_project() {
<?php
printf(
/* translators: %s: https://wordpress.org/plugins/classic-editor/ */
__( 'The Block Editor requires JavaScript. Please try the <a href="%s">Classic Editor plugin</a>.', 'gutenberg' ),
__( 'The block editor requires JavaScript. Please try the <a href="%s">Classic Editor plugin</a>.', 'gutenberg' ),
__( 'https://wordpress.org/plugins/classic-editor/', 'gutenberg' )
);
?>
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Block Editor

Generic Block Editor Module.
Generic block editor module.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@wordpress/block-editor",
"version": "1.0.0-alpha.0",
"description": "Generic Block Editor.",
"description": "Generic block editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"keywords": [
Expand Down

0 comments on commit 00454e4

Please sign in to comment.