Last active
December 14, 2015 15:29
-
-
Save markoheijnen/5108283 to your computer and use it in GitHub Desktop.
How to escape this? I'm now using sanitize_text_field(). Was first esc_attr().
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 | |
| function ajax_save_columns() { | |
| global $wp_registered_sidebars; | |
| header( "Content-Type: application/json" ); | |
| if( isset( $_POST['sidebar'], $_POST['amount_columns'] ) && ! empty( $wp_registered_sidebars[ $_POST['sidebar'] ] ) ) { | |
| $options = get_option( 'horizontal_sidebar_columns', array() ); | |
| $options[ $_POST['sidebar'] ] = absint( $_POST['amount_columns'] ); | |
| update_option( 'horizontal_sidebar_columns', $options ); | |
| echo json_encode( array( 'success' => true ) ); | |
| } | |
| else { | |
| echo json_encode( array( 'success' => false ) ); | |
| } | |
| die(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment