Created
October 1, 2013 18:20
-
-
Save RadGH/6782757 to your computer and use it in GitHub Desktop.
Remove sanitization filters from the Options Framework plugin by Devin Price
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 | |
// Disable sanitization of specific fields by removing the sanitization filter hooks | |
// Note that at least one filter must exist for the field to be saved. | |
function optionsframework_remove_sanitization() { | |
// Text areas | |
remove_filter( 'of_sanitize_textarea', 'of_sanitize_textarea' ); | |
add_filter( 'of_sanitize_textarea', function ($input) { return $input; }); | |
// TinyMCE Editors | |
remove_filter( 'of_sanitize_editor', 'of_sanitize_editor' ); | |
add_filter( 'of_sanitize_editor', function ($input) { return $input; }); | |
// Info | |
remove_filter( 'of_sanitize_info', 'of_sanitize_allowedposttags' ); | |
add_filter( 'of_sanitize_info', function ($input) { return $input; }); | |
// See options-sanitize.php for more filters | |
} | |
add_action('admin_init', 'optionsframework_remove_sanitization', 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment