Simple way to alert error messages in Javascript

Thank you Jacob Peattie for suggesting. It is very simple to use confirm() to replace alert() although confirm() has two options for users to select: OK and Cancel. When users click OK or Cancel button, I use function focus() to direct users where to correct that empty Content. Here are my working sample codes: if(content … Read more

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

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