Created
April 28, 2016 21:32
-
-
Save kellenmace/b375f624404ed2f0cdfea328e7ce8a39 to your computer and use it in GitHub Desktop.
WordPress Hook After Options Page Save
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 | |
/** | |
* Hook into options page after save. | |
*/ | |
public function km_hook_into_options_page_after_save( $old_value, $new_value ) { | |
if ( $old_value['some_option'] != $new_value['some_option'] ) { | |
// This value has been changed. Insert code here. | |
} | |
} | |
add_action( 'update_option_km_my_cool_options', 'km_hook_into_options_page_after_save', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment