5 real-world deprecation patterns that cover most cases when maintaining custom Gutenberg blocks.
When only the rendered HTML changed but attributes stayed the same. No migrate() needed.
// Current version (v2) - saves A pattern for building personal knowledge bases using LLMs.
This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.
Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.
| /* | |
| Copy this into the console of any web page that is interactive and doesn't | |
| do hard reloads. You will hear your DOM changes as different pitches of | |
| audio. | |
| I have found this interesting for debugging, but also fun to hear web pages | |
| render like UIs do in movies. | |
| */ | |
| const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
| // License: GPLv2+ | |
| var el = wp.element.createElement, | |
| registerBlockType = wp.blocks.registerBlockType, | |
| ServerSideRender = wp.components.ServerSideRender, | |
| TextControl = wp.components.TextControl, | |
| InspectorControls = wp.editor.InspectorControls; | |
| /* | |
| * Here's where we register the block in JavaScript. |
| <?php | |
| /* | |
| * Plugin Name: WooCommerce Add Taxonomy to Export | |
| * Plugin URI: https://gist.github.com/helgatheviking/114c8df50cabb7119b3c895b1d854533/ | |
| * Description: Add a custom taxonomy to WooCommerce import/export. | |
| * Version: 1.0.1 | |
| * Author: Kathy Darling | |
| * Author URI: https://kathyisawesome.com/ | |
| * | |
| * Woo: 18716:fbca839929aaddc78797a5b511c14da9 |
| <?php | |
| /** | |
| * Plugin name: WP Trac #42573: Fix for theme template file caching. | |
| * Description: Flush the theme file cache each time the admin screens are loaded which uses the file list. | |
| * Plugin URI: https://core.trac.wordpress.org/ticket/42573 | |
| * Author: Weston Ruter, XWP. | |
| * Author URI: https://weston.ruter.net | |
| */ | |
| function wp_42573_fix_template_caching( WP_Screen $current_screen ) { |
| <?php | |
| /* | |
| Use this just like `add_filter()`, and then run something that calls the filter (like | |
| `new WP_Query`, maybe). | |
| That's it. If the filter gets called again, your callback will not be. | |
| This works around the common "filter sandwich" pattern where you have to remember to | |
| call `remove_filter` again after your call. |
| <?php | |
| /** | |
| * Searches the database for transients stored there that match a specific prefix. | |
| * | |
| * @author Brad Parbs, Kellen Mace | |
| * @param string $prefix prefix to search for. | |
| * @return array nested array response for wpdb->get_results. | |
| */ | |
| function wds_campbell_search_database_for_transients_by_prefix( $prefix ) { |
| <?php | |
| /* | |
| Plugin Name: Bot For WP | |
| Description: Messenger bot for WordPress | |
| Plugin URI: http://snypd.com/ | |
| Author: Sunny Luthra | |
| Author URI: http://# | |
| Version: 1.0 | |
| License: GPL2 | |
| */ |