wp_mail script with jQuery post

Basically, you can use JavaScript to post to a WordPress function, then the WordPress function can invoke wp_mail() to send the message. A great place to start would be the useful AJAX in Plugins article on the Codex. It walks you through all the steps required to add your JavaScript on the front-end, your PHP … Read more

Check if jquery library exist

scripts and styles should never be embedded directly in themes or templates because of potential conflicts between plugins and themes. To use jQuery in a plugin or theme it should be enqueued with wp enqueue script. This will make sure it’s added only once, and any scripts that define it as a dependency will load … Read more

Require featured image

I would do this by hooking into the save_post action, not by javascript. The main idea is to check if both values are there (Your Radiobutton is selected AND the post_thumbnail is present), and set the post to draft if they are not, as well as displaying an Information if the user does not fulfill … Read more

Add custom shortcode button to Editor

I found it, WordPress made changes and you can now add buttons through a simple API if( !function_exists(‘_add_my_quicktags’) ){ function _add_my_quicktags() { ?> <script type=”text/javascript”> /* Add custom Quicktag buttons to the editor WordPress ver. 3.3 and above only * * Params for this are: * string id Required. Button HTML ID * string display … Read more

How to overwrite a JavaScript core function?

You can’t. While manipulation of JS and HTML is possible, it is not adviceable as a long term strategy unless it was explicitly document as “the right way” in the codex, code comment, or some other core document. In addition to the theoretical objection, right now it is hard or almost impossible to override specific … Read more

Lightbox popup on WooCommerce add_to_cart action

The following works for me for product archive pages (these include both the main shop page as well as archive pages for product categories, for example). It will show the current cart contents in a thickbox. I chose to show this for this example just because that’s the data that one gets back through Ajax … Read more

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