save_post action not firing when save

You have some errors in your code. For example, you unset a not defined variable. Some lines bellow you try to use again a not defined variable….maybe this is what is causing the problems. Can you try this? (Edited, I think is better get_posts than new WP_Query in this case) function wpse_update_postmeta($post_id) { if (defined(‘DOING_AUTOSAVE’) … Read more

add_media_page function not creating submenu

Whenever you would use a class method within add_action function, then within the array parameter, you have to pass an instance of that class as the first value and then you the method name as the second value of the array. In your code, you did not pass any instance actually. And that’s why it … Read more

Using actions, hooks and filters in a non-WordPress page

It’s catch 22 – you need WordPress to use the hook system, but init will have already fired during load (wp-settings.php to be exact). I would create a MU “Must Use” plugin (wp-content/mu-plugins/any-filename.php) for all your “outside of WordPress” functionality, with something like this at the start: if ( ! defined( ‘LOADED_EXTERNAL’ ) || ! … Read more

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