Articles of hooks

Are there action hooks for comments?

This is for a personal-use plugin I’m trying to make. I want to submit a comment from site A to my blog (sort of like sending trackbacks/pingbacks but a full comment). For instance, on site A I have a form with a name, url, and comment field. The data I enter in site A, I […]

INSERT in table row fatal error

I just discovered this wonderful message board 🙂 Hopefully someone can help me with a WordPress issue I can’t figure out.. I added a hook to my plugin file to insert the post id of the immediate posts I publish, in a table named “post_votes” – used to keep track of up & down votes […]

Hide one specific woocoomerce product

I would like to hide one specific product for all not logged in users. Suppose $post is that post. I used the hooks: add_action( ‘wp’, ‘WC_Query::remove_product_query’ ) ; and remove_action( ‘pre_get_posts’, ‘WC_Query::pre_get_posts’ ); but none of them seem to be working. global $post; if( get_post_type() == “product” ) { if(is_user_logged_in()){ return; } add_action( ‘wp’, ‘WC_Query::remove_product_query’ […]

Display Plugin Panels Outside of Admin Areas

I’m trying to find a way to display the work area content of different plugins on pages/posts/areas aside from the admin backend. For example, how would I display the options panel for a certain plugin in a page instead of it’s default location? If the plugin also has an output view, like Google Analytics dashboard, […]

Help me to understand wp_header() and wp_footer() functions

hi everyone please help me to understand the hook functions wp_header() and wp_footer() What does it mean hook functions and what to do

Defining hooks within (php)classes?

I have been trying to write a reusable modular options class and I am stuck at this specific point. How do i define hooks within php classes? Try 1 : class super_options { // …………………….. function render_options_page () { //……………….. $this->top_page_hook(); //……………….. } // …………………….. function top_page_hook() { do_action( array( &$this, ‘top_page_hook’) ); } } […]

run script on publish

I am trying to run a script when a user publishes / updates a post. I am using the filter: wp_insert_post_data The problem I am having is the script is a php file outside of WordPress but on the same site (It works fine if i go direct to it) that just needs to be […]

Prepending character(s) to a custom <!–more–> tag title?

I’m hacking around with a blog using Cordobo Green Park and I’ve noticed when I specify a custom title, instead of it beginning with a » symbol (as it does for the standard “» Read more: [POSTTITLE]“) the custom message is simply shown without any prepended character. It’s a shame, because the » character would […]

Action hook for new pending posts?

I’m looking for an action hook to link my function to when a completely new post is created with a status of pending? I’m aware of ‘save_post’ and others but want to target specifically when a post is new. Found this on a previous question: add_action(‘new_to_publish’, ‘your_function’); add_action(‘draft_to_publish’, ‘your_function’); add_action(‘pending_to_publish’, ‘your_function’); but could do with […]

How do I override the search template in a plugin?

How do I override the search template i.e. used inside a theme with a custom search page inside a plugin? Please point our any relevant action/filter hooks which can be used to do this. Any help is highly appreciated.