Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kellenmace/b375f624404ed2f0cdfea328e7ce8a39 to your computer and use it in GitHub Desktop.
Save kellenmace/b375f624404ed2f0cdfea328e7ce8a39 to your computer and use it in GitHub Desktop.
WordPress Hook After Options Page Save
<?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