You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/basics/basics-intro.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,8 @@ id: basics-intro
3
3
title: Basics
4
4
---
5
5
6
-
Before WordPress 5.0 release, the themes were mostly PHP based on some JavaScript and CSS. Now it's a bit different because we have PHP in the core, JavaScript (specifically React.js) in the block editor, and some styles in the editor and the theme parts of the website.
6
+
Prior to WordPress 5.0, themes were mostly PHP-based, with JavaScript used only to provide interactive functionality on the website.
7
+
Now it's a bit different because we have PHP in the core, JavaScript (specifically React.js) in the block editor, and some styles in the editor and the theme parts of the website.
7
8
8
9
Now that everything is different, we must adapt to the changes as well.
We have already mentioned the WP-CLI feature of Eightshift Boilerplate. Now, let's dig a little deeper into this awesome feature. We took our time to set up a bunch of WP-CLI commands that will help you set everything up and use all our features without worrying about correct names, files, and organization.
8
+
Eightshift Development Kit provides extensive [WP-CLI](https://wp-cli.org/) tooling, allowing you to automate bootstrapping of common code, adding blocks from the Frontend Libs library to your projects and more using `wp boilerplate`.
9
9
10
10
## How it works
11
11
12
-
In your project's entry point, you have something like this:
12
+
In your project's entry point (usually `functions.php`), you'll find something along these lines:
13
13
14
14
```php
15
15
/**
@@ -20,13 +20,13 @@ if (class_exists(Cli::class)) {
20
20
}
21
21
```
22
22
23
-
This code loads WP-CLI class from Eightshift Libs responsible for registering all of our custom commands. Keep in mind that, since WP-CLI code loads inside the theme/plugin, that same theme/plugin **must** be activated in the WordPress admin.
23
+
This code loads the WP-CLI class from Eightshift Libs, which handles command registration for all of our commands. As this command registration is part of the theme/plugin code, this means that the same theme/plugin **must be activated** for `wp boilerplate` to work.
24
24
25
25
To run the WP-CLI command and see what you can use, run this command in your terminal:
26
26
27
27
`wp boilerplate --help`
28
28
29
-
> By default, your project's WP-CLI commands run under the parent name `boilerplate`defined in the upper code.
29
+
> By default, your project's WP-CLI commands run under the parent name `boilerplate`, as defined above.
30
30
31
31
You can change that by simply replacing the string inside the load method like this:
32
32
@@ -39,23 +39,22 @@ if (class_exists(Cli::class)) {
39
39
}
40
40
```
41
41
42
-
Now, your project's WP-CLI loads like this:
42
+
Now, your project's WP-CLI commands are available using:
43
43
44
44
`wp superCoolTheme --help`.
45
45
46
46
This is especially handy when you have multiple Eightshift Boilerplate powered themes or plugins installed. In that case, you should change the WP-CLI parent name on each of the projects.
47
47
48
48
## Options and commands
49
49
50
-
When you type each command in the terminal, it will do some action. Some commands will ask you for additional parameters. You can see them if you run the `command name` and `--help` like this:
50
+
To get to know which commands are available and what do they do, run `wp boilerplate --help`.
51
+
The `--help` argument is available on all of our commands and provides a description of the command and a list of required and optional parameters for the command.
51
52
52
53
`wp boilerplate create_config --help`
53
54
54
-
Under the `OPTIONS`, you can see all required and optional parameters you can pass to the command to fine-tune your output.
55
-
56
55
### Commands
57
56
58
-
We have defined a few command prefixes:
57
+
We use these common prefixes for commands:
59
58
60
59
-**create** - services classes that will be copied to your project.
61
60
-**init** - additional functions, methods and helpers that will be copied to your project.
@@ -65,16 +64,15 @@ We have defined a few command prefixes:
65
64
66
65
> **Make WP-CLI your best friend, and your coding life will be much more comfortable, trust us.**
67
66
68
-
We will explain some classes that we think are necessary in more detail in the next chapter. For the rest of the classes, you can find the descriptions by running `--help` after each command.
69
-
67
+
While we might go into more details about some of these commands, we won't be documenting all of them here - use the built-in manuals for more information about particular commands and to discover what's available. Don't gloss over them, as using `wp boilerplate` is a particularly useful tool when building projects with Eightshift Development Kit.
70
68
## Running commands in multisite
71
69
72
-
When you are running a multisite setup you must always provide the additional `--url` parameter because without that parameter WordPress will always run the code from the current primary domain set in the `wp-config.php`.
70
+
When you are running a multisite setup, you should always provide the additional `--url` parameter. Otherwise, WP-CLI will always run the command on the main site.
73
71
74
-
Here is an example for command running from the primary domain:
72
+
Here is an example for command running on the primary site:
75
73
76
74
`wp boilerplate create_config`
77
75
78
-
and here is an example for command running in the sub site:
76
+
and here is an example for command running on the subsite:
This library is meant to bring the modern front-end development tools to the [Eightshift Boilerplate](https://github.com/infinum/eightshift-boilerplate) or [Eightshift Boilerplate Plugin](https://github.com/infinum/eightshift-boilerplate-plugin), but you can use it on any WordPress project.
8
+
This library is meant to bring modern front-end development tools to the [Eightshift Boilerplate](https://github.com/infinum/eightshift-boilerplate) or [Eightshift Boilerplate Plugin](https://github.com/infinum/eightshift-boilerplate-plugin), but you can use it on any WordPress project.
9
9
10
10
## Prerequisites
11
11
12
12
The knowledge of the core editor components and React.js is recommended, since this library is focused on working with the new block editor and contains custom blocks. If you want to create your custom blocks, that knowledge will come in handy.
13
13
14
-
The library can be used for pure Webpack/JS/Scss functionality, but if you want to use our blocks, [Eightshift Libs](https://github.com/infinum/eightshift-libs/) must be used in tandem because they handle block registration, etc.
14
+
The library can be used for pure Webpack/JS/SCSS functionality, but if you want to use our blocks, [Eightshift Libs](https://github.com/infinum/eightshift-libs/) must be used in tandem because they handle block registration, attribute handling and more.
15
15
16
16
### The library contains:
17
17
18
18
- All JS packages required for the Webpack build
19
19
- ESLint ruleset
20
-
-StyleLint ruleset
20
+
-Stylelint ruleset
21
21
- Babel ruleset
22
22
- A collection of useful front-end utility modules
23
23
- The complete storybook of over 30+ useful blocks and components
24
-
- Block editor block example
25
-
- Block editor blocks initial setup for the [Eightshift Boilerplate](https://github.com/infinum/eightshift-boilerplate)
26
-
- Some cool custom components for block editor
24
+
- Block editor block examples
25
+
- A growing collection of blocks and components
27
26
- The complete Webpack build for [Eightshift Boilerplate](https://github.com/infinum/eightshift-boilerplate)
28
27
- Helpers for creating dynamic block editor blocks
Copy file name to clipboardExpand all lines: website/docs/theme.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,14 @@ All additional steps after the initial setup are done using WP_CLI commands, so
22
22
23
23
## Specify version to create
24
24
25
-
In order to be able to test boilerplate with different library versions you can provide 2 additions attributes to this command and specify library versions.
25
+
If you want to specify a version of Eightshift Libs or Frontend Libs to use, you can use add two additional attributes to this command to specify a branch or release to use:
26
26
27
27
*`--eightshiftLibsBranch`
28
28
*`--eightshiftFrontendLibsBranch`
29
29
30
30
#### Example:
31
31
32
-
If you want to pull a`develop` branch for the Eightshift frontend libs and a specific branch of the Eightshift libs your command will look like this:
32
+
If you want to pull the`develop` branch of the Eightshift Frontend libs and a specific release of the Eightshift Libs:
> You can specify both libraries at once or only one.
51
51
52
52
## What is next?
53
-
Now that we have the theme set on your local environment, let's do something with it.
53
+
Now that we've set the theme up on your local environment, let's do something with it.
54
54
55
55
Please make sure you read the [Basics chapter](basics/basics-intro) to understand better how the project is set and what is included to make your developing experience as smooth as possible.
Copy file name to clipboardExpand all lines: website/docs/versions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ id: versions
3
3
title: Versions
4
4
---
5
5
6
-
Now that you understand what makes Eightshift tick, here is a quick reminder about what library versions this documentation refers to.
6
+
Now that you understand what makes the Eightshift Development Kit tick, here is a quick reminder about what library versions this documentation refers to.
0 commit comments