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

What is the difference between strip_tags and wp_filter_nohtml_kses?

Technical difference is kinda obvious. PHP one is single function, using logic in PHP code. WP one is one of family of functions, based on third party KSES library. Is there practical difference between these two specific functions? I think the important point is that strip_tags() was made for utility, while KSES was made for … Read more

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