Skip to content

Instantly share code, notes, and snippets.

View matteo-greco's full-sized avatar

Matteo Greco matteo-greco

View GitHub Profile
@matteo-greco
matteo-greco / override-acss-settings.php
Created November 15, 2022 18:44
Override ACSS settings
<?php
$metabox_group_id = 50;
add_action( "rwmb_{$metabox_group_id}_after_save_post", function( $object_id ) {
// STEP: get the variables we want to override from the settings page.
$primary = rwmb_meta( 'test_primary_color', ['object_type' => 'setting'], 'test_client_dashboard');
error_log( sprintf( '%s: primary %s', 'my action handler', $primary ) );
$new_vars = array(
'color-primary' => $primary
);