The actions tag has no wiki summary.
-1
votes
1answer
226 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 ...
1
vote
1answer
172 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
68 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 ...
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?
4
votes
1answer
69 views
Getting the action's tag name within the action
There's a function attached to a set of actions, like this:
add_action('some_tag', 'the_function');
function the_function($maybe_some_vars){
// ...
}
Is it possible to find out the action name ...
1
vote
3answers
249 views
Is there a recover_post hook to go with trash_post hook?
I'm using the trash_post hook to set a flag in a custom table to indicate that this item is "deleted", but when the user chooses to restore that post, what hook can I use for that? I couldn't find ...
0
votes
2answers
231 views
How to get post ID with hooks publish_post, new_to_publish, etc
I have two plugins, one uses the function wp_insert_post(), the other has a code like this:
add_action('future_to_publish', 'myFunc', 10, 1);
add_action('new_to_publish', 'myFunc', 10, 1);
...
8
votes
4answers
609 views
after_setup_theme always runs
I am setting up a child theme for some of my faculty members, and as a part of the theme, I would like a handful of plugins to be activated at the time that the theme is activated. So, naturally, I ...
0
votes
1answer
34 views
How do i know which action / filters are called when i call get_option()
I need to know which action / filters are called when i do a get_option() call, how can i do that?
5
votes
1answer
501 views
Difference between do_action('admin_enqueue_scripts', $hook_suffix) and do_action(“admin_print_styles-$hook_suffix”) syntax
Source ref:
do_action('admin_enqueue_scripts', $hook_suffix);
do_action("admin_print_styles-$hook_suffix");
Laying aside the obvious difference in base action ( admin_enqueue_scripts vs ...
1
vote
1answer
368 views
Get the post_id of a new post
There are several ways to get the id of a post after it has been saved (auto, etc.), but is there a way to get the post id immediately after you create a new post?
I am trying to create a directory ...
0
votes
1answer
381 views
When is admin_init Action ran?
I have this function below that is called with the admin_init Action
function my_flush_rewrites() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
Like this
...
2
votes
1answer
1k 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
2answers
196 views
action lifecycle
I'm looking for a documentation page where wordpress action lifecycle is explained. Does it exist?
I can't understand if init is called before admin_head or viceversa (even if the name is ...
7
votes
1answer
1k views
Passing a parameter to filter and action functions
Is a way to pass my own parameters to the function in add_filter or add_action.
For example take a look in the following code:
function my_content($content, $my_param)
{
do something...
using ...
1
vote
0answers
55 views
Selectively applying action based on role
I've added an action to my functions.php file that forces a plugin (Content Scheduler) to act on posts, even when it wasn't explicitly enabled by the person writing the post.
I've got that working, ...
3
votes
1answer
68 views
How do I know if author field was changed on post save?
I'm writing a plugin that sends notifications on various post events.
One of the notifications should be sent when a post is assigned to a different author.
How can I know that the post author was ...
0
votes
1answer
199 views
Adding tables to dashboard pages programmatically?
I think that is not possible with some actions or filters, I know that I can do it just with html and using right css styles, and of course php to achieve what I need, or to write some minde actions. ...
3
votes
3answers
998 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?
2
votes
2answers
406 views
Can an action callback prevent the parent from continuing execution?
I'm working on a plugin that interacts with Gravity Forms, and under certain conditions I want to prevent a form from being deleted. Here's the method in Gravity Forms that handles deleting a form:
...
2
votes
2answers
83 views
What's the best action to use when you want to do something only once per theme setup?
I'm writing a theme which has it's own set of database tables.
I'm wondering what is the best action for me to use when I want my install function to be invoked only once when the theme is activated ...
4
votes
1answer
514 views
How to override existing plugin action with new action
I'm using a plugin. It has an action like this.
add_action('publish_post', 'old_action');
function old_action($pid) {
"code goes here"
}
}
I'm writing a module for this plugin. So i need to ...
0
votes
1answer
407 views
Getting admin notices working for plugin errors
I'm beginning with creating plugins and I don't quite understand the process of displaying error messages. e.g. I use the php readfile function to download a file from a hidden location. If something ...
0
votes
1answer
132 views
action wp_set_comment_status never gets fired when i change the comment status [closed]
I want to run some code on comment status change so using the action wp_set_comment_status but it seem to never fired when comment status gets changed. I am using wordpress 3.3.1.
Here is a simple ...
1
vote
1answer
914 views
Hook to get image filename when it is uploaded
I want to get the full local filename of an uploaded image so that I can copy it to a new directory and process it with my own image processing scripts. Which hooks/actions should I look into to ...
1
vote
2answers
120 views
how to determine how many and what kind of arguments are passed to hooks
I am not able to understand a very logic behind add_action / add_filter
Consider following example:
function SearchFilter($query) {
if ($query->is_search) {
$query->set('post_type', ...
2
votes
2answers
242 views
Run javascript code after wp_login hook?
after using the wp_login hook, is it possible to add a snippet of javascript code to the page seen immediately after the login in wordpress?
I want to use this top implement a notification system ...
0
votes
2answers
393 views
Get post id in wordpress action?
I have this code
add_action( 'delete_post', 'my_delete_function' );
function my_delete_function() {
global $wpdb;
$wpdb->query("
DELETE FROM wp_votes WHERE post=".$thePostID."
;);
}
...
2
votes
1answer
78 views
Which to use to execute code during the saving of a plugin settings page?
I'm writing a plugin with a settings/option page and I want some php code to be executed whenever someone saves the settings on that page and that page alone. Which actions do I need to hook into to ...
0
votes
1answer
189 views
save_post action doesn't passing post id to my function as argument
I'm adding a box to add / update post screen.
add_action( 'save_post', 'psd_upload_kaydet' );
add_action( 'add_meta_boxes', 'psd_upload' );
function psd_upload()
{
add_meta_box("psd-upload", "Bir ...
0
votes
1answer
162 views
Setting post_id for single.php based on URL without a redirect
I'm migrating a Joomla! database to Wordpress and the website has to remain exact regarding URLs. The Joomla site has its posts with .html extensions, and the importer I created maps the Joomla file ...
1
vote
1answer
555 views
When to load auto-login code?
I'm using this (simplified) code to automatically login users via a plugin for a single sign-on system:
$user_info = get_userdatabylogin( $username );
$user_id = $user_info->ID;
...
0
votes
1answer
101 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 ...
8
votes
4answers
1k views
remove_action or remove_filter with external classes?
In a situation where a plugin has encapsulated its methods within a class and then registered a filter or action against one of those methods, how do you remove the action or the filter if you no ...
0
votes
2answers
1k 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
1answer
168 views
How can I override one post and make it display content for another post?
I have two pages on my Wordpress site:
mysite.com/?p=100
mysite.com/?p=200
I think I should be able to hook into Wordpress' actions somewhere and re-query the post, so that content for ...
3
votes
2answers
339 views
How can I log a user out of Wordpress before the page loads?
I would am using the code below so that on my wordpress site if ?logout is appended to the end of the URL the user will be logged out. This works well - if the user visits a page such as ...
0
votes
1answer
102 views
Change status of page after an event (Looking for best practice advice)
I'm looking for a best practice/ideas for modifying the status/data of a page after an event.
Here's an example of what I'm trying to accomplish - This WordPress site would allow users to sponsor ...
1
vote
1answer
517 views
How can I see all the actions attached to an “add_action” hook?
I'm working with the admin bar and trying to debug some of the menus and their priorities.
I know several callbacks get bound to actions, such as this one:
add_action( 'admin_bar_menu', ...
0
votes
1answer
48 views
Create categories on blog creation? [closed]
I hav ea wordpress network running, what I'd like to do is create a plugin which detects when a new blog is created in the network then automatically adds a set of predefined categories to the blog.
...
0
votes
1answer
312 views
How to Trigger comment_form_after action if comment_form() not used
A plugin I want to use has a filter like so:
add_action('comment_form_after','yoast_track_comment_form');
The theme I'm using doesn't use the comment_form() call and I believe that this means ...
0
votes
3answers
349 views
Run a plugin just 'once' per page reload
I'm making a plugin that counts the number of times a visitor visits my site. I want to run the code in the plugin once per page load. What's a good action hook I can use ?
1
vote
1answer
138 views
Can taxonomies of custom post types be used with category actions?
I need to create a hook after the creation, edit and deletion of a taxonomy organizing a custom post type I have. I've noticed though that I can't use the following actions with those taxonomies:
...
3
votes
2answers
51 views
How can I limit functionality in one version of a plugin?
I am busy writing a plugin with a free version and a paid, Pro version. For our initial release of both versions, I want to keep things as simple as possible, so I would rather defer using a strategy ...
0
votes
1answer
403 views
Hook for page Request?
I want to run a function that looks at the current url params of the page that is requested and sets a cookie based on those params.
So, I guess I'm looking for:
The Wordpress Hook that allows me ...
1
vote
2answers
254 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 ...
-2
votes
3answers
102 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 ...
2
votes
1answer
406 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 ...
6
votes
2answers
3k views
Is there a hook that runs after a user logs in?
I am writing a plugin that fetches some extended user info from a remote service and I need it to execute its function each time a user logs in.
Is there a hook that gets fired after login that I can ...
1
vote
2answers
62 views
Same Conditionals Not Working on Two Different Hooks
Everyone!
I am new to WP and trying to build a plugin. I have the following codes working properly:
add_filter('the_content', 'say_hello');
function say_hello($content){
if(is_single() || ...