[WordPress] creating PHP patches for WordPress Make Core and setting it up

By.

min read

Share

Do you want to contribute your PHP skills to WordPress Core?

Use this manual to get started !

# For to make PHP patches 😛 To make children happy
# https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/

# Download
svn co https://develop.svn.wordpress.org/trunk wordpress_make
cd wordpress_make

# JS and CSS
npm install
npm run build
npm run dev

copy wp-config-sample.php to wp-config.php and edit accordingly (do not forget to create a new DB !)

#WARNING: you need node 16 to run this !
Also if you have NPM higher than version X, just edit the package.json

# Install and do your coding

NPM versions, install specific
nvm –version
nvm ls-remote
nvm install v14.20.0 (VERSION)
force NVM default
nvm list
nvm alias default 14.20.0
default -> 14.20.0 (-> v14.20.0)

# PHP unit test
# https://make.wordpress.org/core/handbook/testing/automated-testing/phpunit/

#WARNING: You might need to install an older version
sudo apt install phpunit
copy wp-tests-config-sample.php to wp-tests-config.php and edit accordingly (do not forget to create a *new* DB !)

phpunit
or

# Patch and submit to trac
# https://make.wordpress.org/core/handbook/tutorials/trac/submitting-a-patch/
svn diff filename.php > filename.diff

Leave a Reply

Your email address will not be published. Required fields are marked *