Skip to content

Instantly share code, notes, and snippets.

@chrismccoy
chrismccoy / gutenberg.txt
Last active March 13, 2025 19:11
Gutenberg Resources
Eliminate All Blocks from Editor
wp.data.dispatch( 'core/block-editor' ).resetBlocks([]);
How to disable and lock Gutenberg blocks
https://kinsta.com/blog/disable-gutenberg-blocks/
Convert group of file blocks to ACF block
https://bdwm.be/gutenberg-case-study-convert-group-of-file-blocks-to-acf-block/
Enabling Gutenberg-Based Custom Post Types and Taxonomies
@chrismccoy
chrismccoy / restapi.txt
Last active October 28, 2024 06:18
WordPress REST API Resources
Disable REST Api without Plugins
https://rudrastyh.com/wordpress/disable-rest-api.html
Add featured image & alt text to WP REST API
https://allisontarr.com/2021/10/13/add-featured-image-alt-text-to-wp-rest-api/
Allow ALL cross origin requests to WordPress REST API
https://github.com/Shelob9/rest-all-cors
WordPress theme using Rest API and Vue.js
@chrismccoy
chrismccoy / gitcheats.txt
Last active February 27, 2025 15:51
git cheats
# alias to edit commit messages without using rebase interactive
# example: git reword commithash message
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f"
# aliases to change a git repo from private to public, and public to private using gh-cli
alias gitpublic="gh repo edit --accept-visibility-change-consequences --visibility public"
alias gitprivate="gh repo edit --accept-visibility-change-consequences --visibility private"
# delete all your repos using gh-cli (please do not run this unless you want to delete all your repos)
gh repo list --limit 300 --json url -q '.[].url' | xargs -n1 gh repo delete --yes