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
| <?php | |
| /** | |
| * Migrate Woo Sell Services -> WP Sell Services | |
| * ------------------------------------------------- | |
| * Moves your existing WooCommerce-based "services" (Woo Sell Services) into the | |
| * new standalone WP Sell Services. The focus is your SERVICES and their REVIEWS | |
| * (the reviews are the reason to migrate). A product -> service ID map is kept so | |
| * every review lands on the right service and re-running never duplicates anything. | |
| * | |
| * WHAT MAPS TO WHAT |
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
| /** | |
| * BuddyBoss Theme - WooCommerce product gallery thumbnails fix | |
| * | |
| * Problem: BuddyBoss hides .flex-control-thumbs via CSS and only shows them | |
| * once its Slick carousel adds .slick-initialized. The theme runs that Slick | |
| * init a single time on document ready + setTimeout(0), which can fire BEFORE | |
| * WooCommerce's FlexSlider has created the thumbnail list on script-heavy | |
| * pages. Result: the thumbnail strip below the product image never appears. | |
| * | |
| * Fix: re-run the theme's own Slick init at the moment WooCommerce finishes |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <style> | |
| * { margin: 0; padding: 0; box-sizing: border-box; } | |
| body { | |
| width: 1200px; | |
| height: 630px; | |
| overflow: hidden; |
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
| # Clone wordpress-develop | |
| git clone https://github.com/WordPress/wordpress-develop.git | |
| cd wordpress-develop | |
| # Install Node dependencies | |
| npm install | |
| # Start wp-env (requires Docker) | |
| npx wp-env start |
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
| <?php | |
| /** | |
| * save_post_{$post_type} dynamic hook — basic usage | |
| * | |
| * The hook fires only when the specified post type is saved. | |
| * Avoids the post_type check you would need on save_post. | |
| * | |
| * Tutorial: https://tweakswp.com/wordpress-dynamic-hooks-save-post-type/ | |
| */ |
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
| <?php | |
| /** | |
| * Common gotchas when using the WordPress shutdown action | |
| * | |
| * Covers: headers-already-sent, object cache availability, | |
| * timeout behavior, and output buffer state. | |
| * | |
| * Tutorial: https://tweakswp.com/ | |
| */ |
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
| <?php | |
| /** | |
| * Capture fatal errors on WordPress shutdown | |
| * | |
| * WordPress catches many errors through WP_Error and wp_die(), but PHP-level | |
| * fatal errors (E_ERROR, E_PARSE) kill the script before any WordPress handler | |
| * can run. register_shutdown_function() is the only way to intercept them. | |
| * | |
| * Tutorial: https://tweakswp.com/ | |
| */ |
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
| <?php | |
| /** | |
| * fastcgi_finish_request() in WordPress: correct usage pattern | |
| * | |
| * Demonstrates how to use fastcgi_finish_request() to close the HTTP | |
| * connection and continue background work, with the checks needed to | |
| * avoid common pitfalls. | |
| * | |
| * Tutorial: https://tweakswp.com/ | |
| */ |
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
| <?php | |
| /** | |
| * Sending data to an external API after the response is complete | |
| * | |
| * Uses fastcgi_finish_request() to flush output to the browser, then | |
| * fires the WordPress 'shutdown' action to POST data to an external | |
| * endpoint without blocking the user's page load. | |
| * | |
| * Tutorial: https://tweakswp.com/ | |
| */ |
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
| <?php | |
| /** | |
| * Deferred event logging on the WordPress shutdown action | |
| * | |
| * Buffers log entries during the request and writes them all to the database | |
| * in a single batch on shutdown. Avoids per-event DB writes in hot paths. | |
| * | |
| * Tutorial: https://tweakswp.com/ | |
| */ |
NewerOlder