wp_sanitize_redirect strips out @ signs (even from parameters) — why?

Question why does wp_sanitize_redirect strip out @ signs, exactly? Anybody could anyway try to load a url with an @ sign in it – is there some security issue I’m not thinking about? Just take a look at the source: function wp_sanitize_redirect($location) { $location = preg_replace(‘|[^a-z0-9-~+_.?#=&;,/:%!]|i’, ”, $location); $location = wp_kses_no_null($location); // remove %0d and … Read more

How to get input_attrs in the sanitize function?

Your control is named custom_num but your setting is named my_custom_num. Modify your setting’s sanitize function to use the former: $input_attrs = $setting->manager->get_control( ‘custom_num’ )->input_attrs; See also the Customize Input Validity Constraints plugin, where you can see how to obtain the control for a given setting without having to hard-code it: $controls = array(); foreach … Read more

Remove tinyMCE from admin and replace with textarea

No need to reinvent the wheel – put your editor support back and tweak the settings: function wpse_199918_wp_editor_settings( $settings, $editor_id ) { if ( $editor_id === ‘content’ && get_current_screen()->post_type === ‘custom_post_type’ ) { $settings[‘tinymce’] = false; $settings[‘quicktags’] = false; $settings[‘media_buttons’] = false; } return $settings; } add_filter( ‘wp_editor_settings’, ‘wpse_199918_wp_editor_settings’, 10, 2 );

how to sanitize checkbox input?

Be sure to set the value in your markup. You should have. <input type=”checkbox” name=”changeposition” value=”yes” /> Then, I’d suggest using sanitize_key() to sanitize. Keys are used as internal identifiers. Lowercase alphanumeric characters, dashes and underscores are allowed. Think of the word yes, as a key. That’s what you’re expecting is a lowercase alphanumeric value. … Read more

Importing JSON feed should the content be sanitized?

There are two aspects here obviously all input should be sanitized JSON is just a wrapper no different then any other type of container which is used to aggregate data for transmission. You almost never sanitize the container as usually in case of an error you will just not be able to extract the data … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)