This assunmes you're running wp in lando with php >= 8
services:
appserver:
build_as_root:
<?php | |
namespace DeliciousBrains\Admin; | |
use DeliciousBrains\DBI; | |
class ACF { | |
public function init() { | |
add_filter( 'acf/settings/save_json', array( $this, 'get_local_json_path' ) ); |
<?php | |
/* | |
* Disable Gutenberg globally | |
* use this if you prefer one-liner | |
* add_filter('use_block_editor_for_post', '__return_false'); | |
*/ | |
function _thz_filter_disable_block_editor(){ | |
return false; | |
} | |
add_filter( 'use_block_editor_for_post', '_thz_filter_disable_block_editor' ); |
/** | |
* Title: Get gists | |
* Author: Mattias Ghodsian | |
* Description: List any users public gists | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
*/ | |
$profile_url = "https://api.github.com/users/mattiasghodsian/gists"; | |
$options = array('http' => array('user_agent'=> $_SERVER['HTTP_USER_AGENT'])); |
<?php | |
// this snippet requires PHP 5.3+ | |
add_action( 'wp_enqueue_scripts', function() { | |
wp_register_style( 'atomic-blocks/ab-cta', '/path/to/atomic-blocks/css/ab-cta.css', array(), 1.0.0 ); | |
} ); | |
add_filter( 'render_block', function( $block_content, $block ) { | |
if ( 'atomic-blocks/ab-cta' === $block['blockName'] ) { | |
ob_start(); | |
wp_print_styles( $block['blockName'] ); |
<?php | |
/** | |
* Function to resolve assets url with attached content hash. | |
* | |
* Browser cache mechanism is used to store locally once downloaded assets. This | |
* improves website performance and saves network bandwidth. It may be also creating | |
* a problem when a user visits your website and do not see the newest changes in assets | |
* because the browser is serving an old file from cache. | |
* |