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

learn more… | top users | synonyms (2)

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 ...
0
votes
1answer
264 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 ...
2
votes
3answers
2k views

A Post is saved twice or more during add_action(save_post)

I have added a custom meta box for advanced information for a specific post category, to my create new post page. Now I recognize, that if I save the post, it writes 2 entries in the db with 2 ...
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
326 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 ...
1
vote
2answers
5k views

How can I edit post data before it is saved?

I have a plugin and I would like to be able to run the post content through some filters before it is saved to the database. From looking at the plugin api, I see that two hooks that look like they ...
0
votes
2answers
316 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 ...
2
votes
2answers
1k views

add_action for saving a custom menu

Say you have custom menus enabled with your WP theme. Is there any action associated with saving a menu once you've arranged it accordingly? To further clarify: say you've arranged a menu with some ...
1
vote
1answer
130 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 ...
-2
votes
3answers
149 views

Apply function on all action hooks?

Is there an easy way to apply a function on all action hooks? I want to apply esc_attr() to every action hook (in a way that would work from functions.php or a plugin). I figure I would need ...
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" ...
1
vote
1answer
503 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 ...
2
votes
1answer
461 views

PHP5, Inheritance, Singleton - action & filter hook limitations

I'm currently working on a plugin, which uses the builtin cron functionality of wordpress. Instead of using PHP4, I want to use PHP5 with inheritance and the singleton design pattern. I run in some ...
0
votes
1answer
485 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 ...
2
votes
1answer
162 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
4answers
279 views

Remove action from shortcode

There is add_action() function inside function which is callback for add_shortcode(). Any idea how to remove this action with the help of custom plugin? Should I hook to any action which is called ...
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: ...
1
vote
1answer
476 views

Does BuddyPress Have An Action Hook for remove_user? [closed]

BuddyPress has a behavior for removing users that does not run through WP's deleted_user action. I have a hook in my plugin for add_action('deleted_user', 'myScript'); but it only works for ...
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 ...
0
votes
1answer
128 views

An action that runs after each post in the loop on index/archive page?

Is there an Action/a Filter that runs just after each post/post excerpt is displayed on these 2 pages? I use the_content and get_the_excerpt currently, but the_content causes a conflict with some ...
1
vote
1answer
186 views

Combining action and filter?

I tried to set up different video oembed size for content and sidebar. I can set up video size with embed_defaults filter. But this filter works for the whole site and I need to have smaller video ...
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
2answers
466 views

What would cause the 'wp' action to fire twice per page (but only once per post) in Firefox only?

I'm using add_action( 'wp', 'do_something_once_per_page' ); and, well, it's not doing it just once but twice. What's interesting is that within do_something_once_per_page( $wp ){ } I'm globalizing ...
2
votes
1answer
679 views

Better way to enforce category hierarchy in post_categories_metabox?

The objective is to ensure that when editing a post, the metabox that lists a hierarchical taxonomy doesn't reorder itself upon Update to put checked items on top. Right now, edit-form-advanced.php ...
0
votes
1answer
192 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: ...
3
votes
3answers
2k views

How to correctly get post type in a the_title filter

I want to prepend text to the post titles of a specific custom post type, but the filter below didn't work. Instead of changing only that CPT's post titles, it changed all titles on the given CPT's ...
1
vote
2answers
318 views

WP_cron won't trigger my action

I'm in a dead end with a schedualed task in a wordpress plugin for a multisite. Somehow the action I added don't get triggered. The task is getting schedualed and returns a timestamp when I run ...
0
votes
1answer
980 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 ...
4
votes
1answer
775 views

How to change “Draft” string for status of custom post type to “Unavailable”?

ANSWER MOD: just an important mod to the chosen answer: // check if you actually have drafts; also avoids extra '|' separator if (isset($views['draft'])) { // 'Drafts' should be added (and come ...
0
votes
1answer
207 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?
1
vote
2answers
99 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 ...
0
votes
1answer
121 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 ...
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?
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 ...
2
votes
1answer
2k views

How can I remove “Proudly powered by WordPress” from twentyeleven without modifying footer.php?

How can I remove "Proudly powered by WordPress" from twentyeleven without modifying footer.php, and without creating a child theme? I'm looking for a php command, such as add_action, remove_action, ...
1
vote
1answer
2k views

WordPress custom form action url

Is there any way to replace standard WordPress comments form action, which usually looks like this: <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" ...
1
vote
1answer
358 views

Looking for a hook for post.php

First time posting here... I am trying to figure out if there is a hook or action that I can use when a user goes to wp-admin/post.php... Basically when the user goes to post.php I want to check if ...
0
votes
1answer
74 views

Wordpress Plugin Receive a Link

I'm writing a Wordpress plugin. The plugin should allow every user to rate posts (1 to 5 stars). What actually works is to read the rating from storage and show the stars. So there are five <a> ...
0
votes
1answer
266 views

do add_action on condition

This snippet for example will email on EVERY post: function email_friends( $post_ID ) { $friends = 'bob@example.org, susie@example.org'; wp_mail( $friends, "sally's blog updated", 'I just put ...
0
votes
1answer
59 views

Running a function with args in add_action()

I've created a plugin, and it has a function that takes two args, like so: process($tokens, $payloads); ... would this work? : add_action ( 'publish_post', process($tokens, $payloads) ); Many ...
1
vote
1answer
108 views

Valid filenames for add_action's first parameter

Some examples in WordPress' docs pass a filename to add_action rather than an action name. For example, add_action( 'load-post.php', 'callback' ); add_action( 'load-post-new.php', 'callback' ); ...
4
votes
3answers
5k views

Perform an action when post is updated/published

I'd like to run a custom query using some meta data whenever a post is updated or published. Is there something I can put in functions.php to fire when those events occur?
3
votes
2answers
354 views

Add new column to sites page

I'm trying to get info into my network sites page in a column. Below works great to grab the network site ID for each site. How can I make it display the option_value for the item (blog_expire) in ...
-1
votes
1answer
474 views

publish_post action doesn't work

i'm developing a small plugin which will send email to users when a new magazine is published. i made a post type name "magazine" on the theme functions.php. and i wrote a plugin for email ...
2
votes
1answer
835 views

Appending meta value onto post content in WordPress during save_post

The problem seems pretty straight forward: Once the save_post action is fired, I would like to append the value of a meta key onto the end of the post_content if it's not already found within the post ...
1
vote
1answer
305 views

Which action does wp_update_user triggers?

I am working modifying an ecommerce plugin, and it makes uses of wp_update_user() function, and everytime the function runs another table (created by the plugin), gets updated too. The problem is that ...
-1
votes
1answer
89 views

Action while post is being published

I modified the wordpress admin with a plugin I wrote, and my last problem is that there's no action anymore while the post is being updated or published in the admin. I looked around for a function or ...
5
votes
2answers
2k views

Earliest hook to reliably get $post/$posts

What's the earliest possible action I can hook into where I'll be able to access the global $post/$posts variables on both the front and back ends? I've tried looking through the Codex reference, Adam ...
0
votes
1answer
41 views

Create WordPress taxonomies based on theme settings

Is it possible to create taxonomies based on theme settings? That is, are theme settings actions run before taxonomies / post types are initialized?