Why is save_post hook not running?

Try this in your theme’s functions.php file, or a .php file of a plugin that you may be writing: add_action(‘save_post’, ‘xxx_save_meta_box’); function xxx_meta_box_callback() { add_meta_box(‘xxx-meta’,’xxx Details’,’xxx_meta_box’,’xxx-post-type’,’side’,’default’); error_log(‘meta box cb’); } function xxx_save_meta_box($post_id, $post) { error_log(‘running …’); die(‘OK!!!’); }

Why does the custom HTML block not preserve the HTML characters?

This is caused by wptexturize and the use of a standard <div> to contain your code. See https://developer.wordpress.org/reference/functions/wptexturize/ Instead, markup code as code: Text enclosed in the tags <pre>, <code>, <kbd>, <style>, <script>, and <tt> will be skipped. This list of tags can be changed with the no_texturize_tags filter. Note that the HTML block just … Read more

Forgot password not working

Probably you dont have any mail server installed/enabled (like sendmail/qmail/postfix) in your local machine. You can still reset your admin password from database. The table “wp_users” stores the password in the “user_pass” field You can just replace the value with a md5 hash value of your desired password for the admin user. Note: This is … Read more

How do I change the description of the same image which is to be found in multiple instances?

Plugin idea #1 When we insert an image into the editor, the plugin automatically modifies the caption and the alt attribute to: Then on the front-end the image caption is fetched for the corresponding image attachment, based on the attachment_729 string and replaces the ###ALT### and ###CAPTION### dummy values. So when we want to modify … Read more

How to solve a conflict between a plugin and a theme?

If the theme was coded using Theme Development Standards, then you can use the function wp_deregister_script to remove conflicting scripts from the page where the slider is being used. [update] The original solution (at the bottom) worked in a specific plugin situation (with WP Touch). I think this is the proper one: add_action( ‘wp_enqueue_scripts’, ‘wpse_77772_remove_theme_enqueues’, … Read more

W3 Total Cache active but not working [closed]

mod_deflate: Not detected (required for Page Cache (enhanced mode) and Browser Cache) mod_env: Not detected (required for Page Cache (enhanced mode) and Browser Cache) mod_expires: Not detected (required for Page Cache (enhanced mode) and Browser Cache) mod_headers: Not detected (required for Page Cache (enhanced mode) and Browser Cache) mod_mime: Not detected (required for Page Cache … Read more

get_template_directory_uri() and other URL tags not working in theme

What you have: <link rel=”stylesheet” href=”https://wordpress.stackexchange.com/questions/46261/<?php echo get_template_directory_uri(); ?>/css/style.css”> should work fine. I’ve copied and pasted into my header.php and it worked. But this is not how you should be including css or javascript files. The proper way is to use the wp_enqueue_scripts hook. For instance, say you have javascript file you wish to load … Read more

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