This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
doAction, | |
applyFilters, | |
addAction, | |
addFilter, | |
doingAction, | |
doingFilter, | |
didAction, | |
didFilter, | |
hasAction, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp.api.init({ | |
'versionString': '/custom/v1/' | |
} | |
).done( function( mySchema ) { | |
// mySchema contains your namespace models/collections | |
... | |
} ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 20170908135703 | |
// http://developwordpress.localhost/wp-json/wp/v2/posts/40018 | |
{ | |
"content": { | |
"id": 40018, | |
"date": "2017-09-04T19:21:42", | |
"date_gmt": "2017-09-04T19:21:42", | |
"guid": { | |
"rendered": "http://developwordpress.localhost/?p=40018" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 20180102142527 | |
// http://developwordpress.localhost/wp-json/wp/v2/posts/336 | |
{ | |
"id": 336, | |
"date": "2018-01-02T14:24:26", | |
"date_gmt": "2018-01-02T19:24:26", | |
"guid": { | |
"rendered": "http://developwordpress.localhost/?p=336" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// do not save revision on post_updated since the meta fields are not saved yet. | |
remove_action( 'post_updated', 'wp_save_post_revision', 10 ); | |
// readd wp_save_post_revision on save_post if needed. | |
add_action( 'post_updated', 'save_post_revision_on_save_post', 10 ); | |
function save_post_revision_on_save_post() { | |
$mycustomfieldsplugin_save_post_priority = 10; | |
// wp_save_post_revision has to be executed after the plugin saves its meta fields (higher priority on save_post hook). | |
add_action( 'save_post', 'wp_save_post_revision', $mycustomfieldsplugin_save_post_priority + 1, 1 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wp_heartbeat_settings_3242( $settings ) { | |
$settings['interval'] = 15; //Anything between 15-120 | |
return $settings; | |
} | |
add_filter( 'heartbeat_settings', 'wp_heartbeat_settings_3242' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'nonce_life', function () { return 25; } ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in {1..100} | |
do | |
wp site create --slug=site-$i | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
╰─$ ./vendor/bin/phpcs src/*.php src/**/*.php --standard=WordPress --sniffs=WordPress.WP.I18n --report=summary | |
PHP CODE SNIFFER REPORT SUMMARY | |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
FILE ERRORS WARNINGS | |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
develop.wordpress/src/wp-login.php 1 0 | |
develop.wordpress/src/wp-admin/admin-footer.php 1 0 | |
develop.wordpress/src/wp-admin/admin.php 1 0 | |
develop.wordpress/src/wp-admi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
╰─$ ./vendor/bin/phpcs src/*.php src/**/*.php --standard=WordPress --sniffs=WordPress.WP.I18n | |
FILE: develop.wordpress/src/wp-login.php | |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
FOUND 1 ERROR AFFECTING 1 LINE | |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
434 | ERROR | A gettext call containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders. | |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |