Tag Info

Hot answers tagged

4

The function checks your version of WP for possible updates. It appears that there is a transient in the database named 'update_core', so it's stored in the $wpdb->options table as '_site_transient_update_core'. The value of that transient is a serialized object that has information, I'm not an expert on wp_version_check, but it uses that transient to keep ...


3

Looking at your code you are calling the function ghoolo_mango() by using the the wp actoin hook. This is fine but be aware that it will add your post everytime a page loads. The problem is that you are also calling the function ghoolo_mango() within the function itself - i.e. it will keep calling it over and over. To fix the problem, remove the line ...


2

publish_post doesn't work for custom post types, the correct hook (action hook) is publish_{$custom_post_type}. You should use add_action() as this is an action hook. I also tend to make use of the transition_post_status hook which is a much more universal hook as it fires everytime a post's status is changed regardless. You can use $old_status and ...


1

get_stylesheet_directory_uri() returns an URL. The requested file is called like any other publicly available resource: without the context of the include statement. This is like opening the PHP file in a browser directly. There is no WordPress context, and the functions add_action() or add_filter() are not defined. Use get_template_directory() in parent ...


1

Once a fucntion has been hooked to an action, the function will be executed every time the action is called (with do_action). To stop this, the action should be removed. See remove_action: function do_entry() { if ( get_the_title() ) { add_action('loop_entry_before', 'function_that_adds_h2_structure'); } else { ...



Only top voted, non community-wiki answers of a minimum length are eligible