WP calendar summary attribute validation error

Update to 3.2.2. The summary attribute has been removed. See line 1149 \wp-includes\general-template.php WP v3.1.4: $calendar_output=”<table id=”wp-calendar” summary=”” . esc_attr__(‘Calendar’) . ‘”> WP v3.2.2: $calendar_output=”<table id=”wp-calendar”> Alternatives… To modify the output of the widget, you can duplicate it and rename it. When I did that, I also needed to duplicate the get_calendar() function and adjust … Read more

W3C validation errors (trailing slashes)

Use a HTML5 document declaration: <!Doctype html> XML self closing slashes are allowed in HTML5. In an attempt to turn this into a WordPress question (really, it isn’t): WordPress spits out hard coded XHTML style in many places. Since most people will not send real XHTML, HTML5 is the best option to deal with WordPress’ … Read more

How to do more than one verify_nonce in one function?

Nonce generated is product of: user ID time $action argument The action is important part and needs to precisely describe what kind of event you are verifying. So if your actions are create something and delete something, your nonces should be generated for example like my_prefix_create and my_prefix_delete and verified accordingly.

WordPress live, custom text box validation, how to?

If you are looking for a shortcode like this: [question text=”What has four legs?” answer=”Horse” message=”Right answer!” messageid=”message1″ ] with output like this: then here is a very simple non-jQuery skeleton version: add_shortcode(‘question’,’question_func_wpse_88192′); function question_func_wpse_88192($atts, $content = null ){ extract( shortcode_atts( array( ‘text’ => ”, ‘answer’ => ”, ‘message’ => ‘Right answer!’, ‘messageid’ => ‘message’, … Read more

How do I sanitize the str_replace function in javascript variables

esc_js() is intended for escaping data for use within an HTML attribute. If you want to escape data for use within an inline script, wp_json_encode() should be sufficient. For example: var disabledDays = <?php echo wp_json_encode( $iva_disable_days ); ?>; This outputs: var disabledDays = [“4\/7\/2018″,”11\/18\/2017”]; If you check the variable in your dev tools console, … Read more