Last active
December 5, 2018 19:28
-
-
Save fastlinemedia/fe9b58af76ac93b37d3ccfd91e4f14c6 to your computer and use it in GitHub Desktop.
This file contains 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 | |
function filter_bb_layout_data( $nodes ) { | |
// Loop through the nodes. | |
foreach ( $nodes as $node_id => $node ) { | |
// Update row settings. | |
if ( 'row' === $node->type ) { | |
// Check for the old setting to update. | |
if ( isset( $node->settings->old_setting ) ) { | |
// Change an old setting to a new setting. | |
$node->settings->new_setting = $node->settings->old_setting; | |
// Make sure to unset the old setting so this doesn't run again. | |
unset( $node->settings->old_setting ); | |
} | |
// Save the update settings. | |
$nodes[ $node_id ]->settings = $node->settings; | |
} | |
} | |
// Don't forget to return the settings when you're done! | |
return $nodes; | |
} | |
add_filter( 'fl_builder_get_layout_metadata', 'filter_bb_layout_data' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment