Skip to content

Instantly share code, notes, and snippets.

View crimann's full-sized avatar

Claudio Rimann crimann

View GitHub Profile
@crimann
crimann / gutenberg.txt
Created May 5, 2022 06:21 — forked from chrismccoy/gutenberg.txt
Gutenberg Resources
Turning Off Reusable Blocks
https://tomjn.com/2021/04/05/turning-off-reusable-blocks/
Turning Off The Block Directory
https://tomjn.com/2021/03/31/turning-off-the-block-directory/
How to Disable the WordPress Block Directory
https://typewheel.xyz/disable-wordpress-block-directory/
Custom previews for ACF Gutenberg Blocks
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@crimann
crimann / readme.md
Created November 5, 2021 18:20 — forked from wpmark/readme.md
An example of caching data using a WordPress transient

Caching WordPress data using Transients - Example

In this simple example we create a function for obtaining data from an external source and caching it for 24 hours. You can use the function hd_get_external_data() to get the data and work with it in your site.

If you want to force a refresh of the cache, you can pass a value of true into the function.

You can place the code into your themes functions.php file or better still in a plugin. If you are placing it in a plugin, remember to use function_exists() when using this. This ensures that the code will fail correctly if the plugin is not active.

@crimann
crimann / wp-config.php
Created August 5, 2021 21:50 — forked from MikeNGarrett/wp-config.php
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url