Disclaimer: documentations are created based on ubuntu 20.04 with lampp (xampp). Please adjust this docs with your own environtment.
- Create virtual host with name
efod.fortidigitalstudio.local
- Create folder
efodneve.fortidigitalstudio.local
for the root dev project. cd
to root folder and run commandwp core download
- Change folder owner with command
sudo chown www-data:apache ./efod.fortidigitalstudio.local
- Run wordpress installation
- On root folder clone repo:
git clone https://github.com/Forti-Digital-Studio/Efod-Neve-Plugin.git
cd
to development folderefod-neve-plugin
then runnpm install
andcomposer install
After you clone the folder structures will be look like this:
efodneve.fortidigitalstudio.com
└─── efod-plugin-src
│ │ readme.md
└─── wp-admin
└─── wp-content
└─── wp-includes
| index.php
| wp-config.php
| ... all basic wordpress files
-
What we do here:
- Register custom post type & views
- Custom elementor widget
Because our development folder are not in the wordpress folder, thats why every changes we need to compile and copy our theme & plugin into wordpress folder. To do that run command npm run deploy
-
Useful command:
composer lint:wpcs
to find all non standard code, fix all ERRORcomposer lint:fix
sometimes you can use fix automatically with this command usingphpcbf
. You need to install it first with commandsudo apt install php-codesniffer
composer lint:php
- Install
phpcs
- Don't forget we want to run
phpcbf
in our directory not global, so we need tocd
toefod-theme
directory then call./vendor/bin/phpcbf
-
Faq:
- If you found invalid text domain. Then you need to add property to rule
WordPress.WP.I18n
- If you found invalid text domain. Then you need to add property to rule
- Function
wp_localize_script()
allow us to pass global parameter to javascript files. - But when you run
npm run lint:js
it will throw error variable is undefined. To get rid of this, you need to declare the variable as global parameter in javascript file, so lint will ignore your global variable. Please refer here