Skip to content

Instantly share code, notes, and snippets.

@hcoohb
hcoohb / docker-compose.yaml
Last active July 30, 2021 07:22
Wordpress - Softaculous backup to local docker
version: "3.8"
services:
db:
image: mariadb
container_name: ${SUBFOLDER}_db
restart: always
volumes:
- ./database:/var/lib/mysql
- ./database/initdb.d:/docker-entrypoint-initdb.d
environment:
@hcoohb
hcoohb / spec.json
Created July 20, 2022 05:58
Vega-Lite bar with params - deneb issue
{
"data": {
"values": [
{"a": "A", "b": 28},
{"a": "B", "b": 55},
{"a": "C", "b": 43},
{"a": "D", "b": 91},
{"a": "E", "b": 81},
{"a": "F", "b": 53},
{"a": "G", "b": 19},
@hcoohb
hcoohb / functions.php
Created April 3, 2023 11:58
Remove neve copyright
function remove_neve_copyright() {
// Need to first get the HeaderFooterGrid Object to get the footer builder that added the hook to the action.
// error_log("Getting Footer Object");
if ( class_exists( '\\HFG\\Main' ) ) {
$hfg = HFG\Main::get_instance();
// error_log( print_r($hfg->get_builder('footer'), true) );
remove_action( 'neve_after_slot_component', [ $hfg->get_builder('footer'), 'add_footer_component' ], 10 );
}
}
@hcoohb
hcoohb / remove_filters_with_method_and_class_name.php
Created April 3, 2023 13:37
remove_filters_with_method_and_class_name
function remove_filters_with_method_and_class_name( $hook_name, $class_name,$method_name, $priority = 0 ) {
global $wp_filter;
// Take only filters on right hook name and priority
if ( ! isset( $wp_filter[ $hook_name ][ $priority ] ) || ! is_array( $wp_filter[ $hook_name ][ $priority ] ) ) {
return false;
}
// Loop on filters registered
foreach ( (array) $wp_filter[ $hook_name ][ $priority ] as $unique_id => $filter_array ) {
// Test if filter is an array ! (always for class/method)
if ( isset( $filter_array['function'] ) && is_array( $filter_array['function']) ) {