A name for an event that is executed at specific points throughout the WordPress core.

learn more… | top users | synonyms (2)

0
votes
1answer
159 views

create 2 custom columns in page edit in Admin panel

Hey all i have this code here: if ( !function_exists('AddThumbColumn') && function_exists('add_theme_support') ) { // for post and page add_theme_support('post-thumbnails', array( ...
0
votes
2answers
88 views

Action hook for editing post

I'm looking for the add_action() hook for when a current post is edited and saved. I know there's edit_post and save_post, but I'm looking for something that ONLY fires when a current post is edited, ...
0
votes
1answer
278 views

Redirect user if they are not logged in

If user enters the url www.abc.com in the browser and he is not logged in, then we want to redirect him to www.abc.com/de. How can I do this within WordPress?
1
vote
2answers
416 views

My plugin class doesn't work! [closed]

Long story short; I'm writing a plugin in OOP. The constructor is run, but the callback of my add_action does not run. I just can't find out why. I have added echo's on different spots to see what ...
1
vote
1answer
145 views

How to call bind function in wordpress actions or hooks

I have made a class file in my plugin folder. Then I wrote, class Sample{ function footer_content(){ echo "show any data"; } } Then I added the function footer_content to wordpress ...
0
votes
1answer
314 views

Custom action on comment post

Whenever a user posts a comment, I'd like to basically have a copy of the post sent to another database for a separate site. The database part is simple, but I can't seem to find the right action hook ...
6
votes
2answers
115 views

Valid characters for actions, hooks and filters

I haven't ever seen a tag such as do_action('something_10'). Is it invalid if I use numbers? If the method is valid, how can I write different numbers in the tag string conditionally? For example, is ...
0
votes
1answer
759 views

Using auth_redirect returns cannot modify header information

I'm hooking auth_redirect to wp_head, but it's returning cannot modify header information. Do I have to hook it to a different action? Something that loads before wp_head? I tried hooking it to ...
1
vote
2answers
612 views

do_action pass array argument as reference not copy

I have successive hooks to an action which are passed an associative array like: do_action($array) I am trying to update the values in this array in the multiple add_action calls, however each ...
1
vote
1answer
2k views

add_action in functions.php, do_action in plugin?

I am trying to set an add_action function in my currently active WordPress theme functions.php file, for a defined do_action function within an activated WordPress plugin. The add_action function in ...
3
votes
1answer
394 views

Do I need to call do_action in my plugin?

Do I need to call do_action function every time I add_action something?
1
vote
0answers
84 views

Copy post to separate database with “add_action(…)”

I'm basically trying to have a copy of a post be sent to another database's table when it's published. I've gotten it to add a new row in the new table, with my own static arguments, but I'm not sure ...
1
vote
4answers
5k views

Change which sidebar get_sidebar() gets from functions.php

I have this code in a template file, which loads sidebar-sidebar_a.php: get_sidebar('sidebar_a'); I would like to add a function to sidebar.php which has the effect of changing that to this if some ...
1
vote
2answers
3k views

Woocommerce Change placement with wrapper

I am trying to change placement of Price from top to beside the Add to Cart button and want to wrap Price and Add to cart button (form) both with one div. I dont know either it is bad way or correct ...
0
votes
2answers
133 views

need help looping add_action in wp

i would like to know the proper way to do this $dynValue=5;//loop this many times //start of my loop for ($num=1; $num <= $dynValue; $num++){ //note the incremented number ($num) in the call back ...
0
votes
1answer
258 views

Is there any action/filter hook to use when an image gets edited in the editor?

I can't find a specific hook. If I already have added an image to an article via editor and then I edit it, I'd like to intercept the code just before it is sent again to the editor. I already use ...
0
votes
0answers
74 views

Add new template file in plugin [duplicate]

Possible Duplicate: Create custom page templates with plugins? I create a plugin and a template file but I do not know how to include the template file in the plugin For the moment, I use ...
-1
votes
3answers
444 views

Proper method to restrict non logged users into certain pages

I was wondering which is the correct method to do this and which action hook should i use. I have custom login/register pages so if the user try to go to a forbidden page and its not logged in i ...
0
votes
1answer
49 views

How Can I Add Code To A Preexisting Function Without Editing it

This is what I am trying to do: Lets say I have a parent plugin, Plugin X, and a child plugin (an extension, whose purpose is to enhance X) Y. There is a function in plugin X that I wish to add ...
2
votes
2answers
338 views

add_action in class and use it in theme

I'm programming a plugin in Wordpress and want to access some database functions with in my theme with the do_action feature. First I just included $fdb-> get_finaboo_footer(1); on my page for example ...
0
votes
2answers
339 views

Divs appearing everywhere in post content

Whenever somebody writes a post on our site, the Paly Voice (http://palyvoice.com) there are automatically a lot of <div> elements created. This is bad for layout, since we have a style that ...
0
votes
1answer
281 views

What filter or action hook to use in order to load some code before the template begins printing in BuddyPress? [closed]

I would like to load some code before the template begins printing in BuddyPress. What filter or action hook should I use? I tried a number of them (such as bp_head, bp_include, bp_init), but none of ...
1
vote
1answer
497 views

Get list of registered or enqued styles? looking for filters or actions

Where can I get the list of styles about to be printed? What i want is to either filter the list, doing what i want with each, then return empty list. Or do an action that recieves the list, then i ...
0
votes
3answers
144 views

About Hooks and Filters

Well, am having a very hard time understanding the difference between Actions and Filters. I do use actions in my code, but am a rookie and I don't know even a slightest bit of Filters. I have been ...
1
vote
1answer
575 views

wp_get_attachment_metadata returns false with add_action() 'add_attachment' hook

With the following code in functions.php - wp_get_attachment_metadata() returns false and or empty. Perhaps I am attempting to use wp_get_attachment_metadata() before it's ready? As some tests have ...
0
votes
1answer
57 views

Running a wordpress action when a custom post type term (taxonomy category) is changed

Trying to make a system whereby a function is called upon an admin changing the taxonomy category (term - if i understand correcrtly) of a custom post type. I thought the action tag "edit_category" ...
0
votes
1answer
503 views

How to display message (with switch_theme hook) after deactivating My theme?

I'm able to display a message by activation of my theme with the 'new' after_switch_theme hook this way: function themeActivationFunction($oldname, $oldtheme=false) { $msg = ' <div ...
3
votes
1answer
249 views

Looking for a hook to add attachment information to the media library tab

I would like to be able to determine if an image has been attached to a post by looking at the collapsed viewmedia library tab. Is there's a hook I can use to add that data to this view of the Media ...
2
votes
1answer
169 views

How to update feed only 2-3 times a week (for Feedburner email)?

So many of you know that Feedburner is a great (free) tool for sending out newsletters. The problem is that if you add content everyday, everyday emails will be sent out. I'd like to control on ...
1
vote
1answer
133 views

Stop loading “collaborators” users on add new post or page?

So our website has about 20k "collaborators" type of users and we'd like to stop loading all of them on the select box on the "add new post" or "add new page" PAGE. Maybe load only authors and above ...
0
votes
1answer
1k views

Custom post_type search's $wp_query->query_vars do not correspond

I have been having this issue, with integrating events manager among my other post types, where the other custom post types show up in the $wp_query->query_vars array, except for the event manager ...
1
vote
2answers
1k views

How do I hook a sidebar via add_action?

On one of my templates I have an action hook 'do_xyz' I want to attach a custom sidebar to the action hook do_xyz Here is what I am trying in my theme functions.php file, does not work: ...
3
votes
1answer
1k views

Using action hooks inside of a shortcode

I am trying to create a modular plugin that includes action hooks for developers to add content before and after the main shortcode content. I'm having some trouble because anything I do in the ...
1
vote
0answers
67 views

Submit custom form from post content and execute in plugin

I have prepared custom form (quiz plugin) with embedding in custom posts via {{QUIZ_ID}} placeholder. My form is displayed in post correctly but bigger problem is what form action should I create (and ...
2
votes
1answer
1k views

How to use filter hook 'post_updated_messages' in coherence with action hook 'save_post'

I am trying to send out e-mail, SMS and IM notifications to group members of this WordPress website, whenever a WordPress page in their user group has been published/updated. I figured using the ...
0
votes
1answer
97 views

Plugin that generates a page of post content

My script is generating a duplicate post even after I explicitly state that the post_type should be a page. It also ignores the $post_title, which I do not want to create a duplicate post if the title ...
0
votes
1answer
287 views

Redirect back to origin page after using get_delete_post_link()

I need to implement frontend and backend redirection after delete specific post using get_delete_post_link(). Which hook i can use? Any advice would be appreciated. Something similar to : <?php ...
1
vote
1answer
36 views

How to select a page within admin?

How does one apply an action to one particular page within admin? I've added a bunch of wysiwyg editors to one page ("Home") and now I don't need the main editor. But the function below - of course - ...
0
votes
1answer
190 views

template_redirect action only firing if logged in

add_action('template_redirect', 'add_header_redirect', 0, 0); function add_header_redirect(){ if( is_page(array(8, 'testimonials', 'Testimonials')) ){ $default_testimonial = get_permalink( ...
0
votes
1answer
196 views

add_action() in switch statement

I'm using the approach of having all of my single-views in one loop-single.php and thus have a simple switch statement that will render each single-view based on the post type: ...
0
votes
1answer
331 views

Create action running on trashed_post hook to modify post_meta value

I have a custom post type that always do math operation to its post_meta and other custom post type post_meta. For example: post-type 1 = cpt_product_order post-type 1 post_meta = ...
1
vote
2answers
1k views

How to only hook on Single.php after content?

I am currently hooking on the_content() but that goes through the Wordpress loop too. How can I only hook on the Single.php page? Also, is there a way to only look on the first X posts in the ...
3
votes
1answer
595 views

Check if post is being published for the first time, or is an already published post being updated

I am building an add-on to an events module that checks for availability, since there wasn't a function for that in that module. Now that I have built the logic, there are three emails I will need to ...
0
votes
1answer
212 views

OOP Plugin: Where should I place the action hooks in the class?

Where in my admin class should I place the action hooks for adding css, scripts and the add menu page? In the __construct? Or should they be placed in a method?
0
votes
1answer
129 views

delay function on publish?

I have this function where I call a custom function through the add_action hook: add_action('publish_post', 'custom_function'); ... now it works perfectly, but the I want the custom_function to be ...
1
vote
2answers
101 views

Too many actions/filters!

New to wordpress here. The concept of actions/filters in and of itself is not too difficult to grasp. What I am overwhelmed by is the HUGE amount of actions and filters available. When I am looking at ...
4
votes
3answers
1k views

How can I find out what functions are assigned to actions?

Is there any way to know what functions are added to actions on a certain page in WordPress?
3
votes
2answers
302 views

How to modify wp_ajax function?

I want to modify wp_ajax_find_posts function. It receives search string from find-posts form and delivers search results by ajax. Part of the function looks like this: function wp_ajax_find_posts() { ...
4
votes
2answers
9k views

When to use add_action('init') vs add_action('wp_enqueue_scripts')

In my theme's functions.php, I'm calling an add_action in order to gain a measure of control on where jquery is loaded (in the footer along with my theme's other scripts). The problem I'm having is ...
3
votes
3answers
759 views

How can I remove the WP menu from the admin bar?

I never use the WP menu (the logo and its child items) except when I click it accidentally. And it is wasting my time when I navigate per keyboard. Plus, the support page is not our site. How can I ...