Skip to content

Commit

Permalink
Docs: fix minor typos in Build your first block tutorial (#64961)
Browse files Browse the repository at this point in the history
* Docs: minor changes under Prerequisites in Build first block tutorial

* Docs: fix minor typos in Build first block tutorial
  • Loading branch information
farid-hadi committed Sep 17, 2024
1 parent c114b25 commit 6b7345f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/getting-started/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To complete this tutorial, you will need:
If you don't have one or more of these items, the [Block Development Environment](https://developer.wordpress.org/block-editor/getting-started/devenv/) documentation will help you get started. Come back here once you are all set up.

<div class="callout callout-info">
This tutorial uses <a href="https://developer.wordpress.org/block-editor/getting-started/devenv/get-started-with-wp-env/"><code>wp-env</code></a> to create a local WordPress development environment. However, feel free to use alternate local development tools if you already have one that you prefer.
This tutorial uses <a href="https://developer.wordpress.org/block-editor/getting-started/devenv/get-started-with-wp-env/"><code>wp-env</code></a> to create a local WordPress development environment. However, feel free to use any development environment that meets the abovementioned prerequisites.
</div>

## Scaffolding the block
Expand Down Expand Up @@ -250,7 +250,7 @@ At this point, the block's icon and description are correct, and block supports

### Updating edit.js

The [`edit.js`](https://developer.wordpress.org/block-editor/getting-started/fundamentals/file-structure-of-a-block/#edit-js) file controls how the block functions and appears in the Editor. Right now, the user sees the message " Copyright Date Block – hello from the editor!". Let's change that.
The [`edit.js`](https://developer.wordpress.org/block-editor/getting-started/fundamentals/file-structure-of-a-block/#edit-js) file controls how the block functions and appears in the Editor. Right now, the user sees the message "Copyright Date Block – hello from the editor!". Let's change that.

Open the file and see that the `Edit()` function returns a paragraph tag with the default message.

Expand Down Expand Up @@ -647,10 +647,10 @@ While the Editor looks great, the starting year functionality has yet to be adde
Start by adding a variable called `$display_date` and replicate what you did in the `Edit()` function above.
This variable should display the value of the `startingYear` attribute and the `$current_year` variable separated by an em dash, or just the `$current_year` is the `showStartingYear` attribute is `false`.
This variable should display the value of the `startingYear` attribute and the `$current_year` variable separated by an em dash, or just the `$current_year` if the `showStartingYear` attribute is `false`.
<div class="callout callout-tip">
<p>Three variables are exposed in the <code>render.php</code>, which you can use to customize the block's output:</p>
<p>Three variables are exposed in <code>render.php</code>, which you can use to customize the block's output:</p>
<ul>
<li><code>$attributes</code> (array): The block attributes.</li>
<li><code>$content</code> (string): The block default content.</li>
Expand Down

0 comments on commit 6b7345f

Please sign in to comment.