Last active
November 1, 2018 22:47
-
-
Save beaverbuilder/8d6f500179673c841fc453d4a3a2f18d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
class FLExampleModule extends FLBuilderModule { | |
public function __construct() { | |
parent::__construct( array( | |
'name' => 'Example', | |
) ); | |
} | |
public function filter_settings( $settings ) { | |
/** | |
* Convert an old setting to a new setting. | |
* Don't forget to unset the old setting! | |
*/ | |
if ( isset( $settings->old_setting ) ) { | |
$settings->new_setting = do_something_with_old_setting( $settings->old_setting ); | |
unset( $settings->old_setting ); | |
} | |
/** | |
* Change an existing setting. | |
*/ | |
if ( isset( $settings->existing_setting ) ) { | |
$settings->existing_setting = do_something( $settings->existing_setting ); | |
} | |
/** | |
* Always return the settings when you are done. | |
*/ | |
return $settings; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment