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

learn more… | top users | synonyms (2)

0
votes
1answer
255 views

Custom login modal page action

I have a modal login and I also have a custom login page as well. modal login page is mostly being used for login, register, forgot password. The problem is whenever you login by modal login page, ...
1
vote
2answers
245 views

How do I print a notice only on certain admin pages?

I'm writing a plugin which would print a notice, but only on the media page. I found the admin_notices and all_admin_notices actions, but these are fired on all admin pages. Is there any way to find ...
0
votes
1answer
555 views

'wp' hook supposed to trigger when editing a post?

I'm trying to figure out if this is by design, a bug or a feature I should try to request. I created a plugin and added the following code: function test_wp() { echo '<div style="position: ...
0
votes
2answers
103 views

Print shortcode in custom action hook not where the shortcode is entered

I have added a custom action hook into my theme. I want to be able to enter a shortcode anywhere in the_content() and have the shortcode print were the custom action hook is rather then the point from ...
0
votes
1answer
66 views

changing variable through filters or action hooks

it appears i have a problem with understanding how add_action,add_filter and apply_filters work. somewhat abbreviated, i have the following scenario: in a template file i have this while ( ...
2
votes
1answer
67 views

Making a class available via actions filters

I'm creating a plugin which displays a tabbed view. The way it currently works is when the user clicks a tab class Loader reads the $_GET parameter and creates an instance of the class specific to ...
1
vote
1answer
122 views

How are Dynamic Sidebar Widgets rendered

I have been reading through the Wordpress Source, trying to get a better understanding of how dynamic sidebars are rendered. However, I am hitting a sticking point... 894 | do_action( ...
0
votes
2answers
80 views

add_action which contains first argument admin_print_scripts-$page

Here I am not getting whats the meaning passing $page with admin_print_scripts ? My code is like : $page = add_submenu_page('edit.php?post_type=' . $post_type, __('text', 'plugin-dir-name'), ...
0
votes
2answers
70 views

Do something when user creates post (that's pending)

How do i do something when a (normal) user creates a post (that is submitted for approval) I currently have: function emailinvestment( $new_status, $old_status, $post_id ) { if ( ...
0
votes
1answer
52 views

How would I use a filter to remove header banner on certain post types

I am using a child theme of twenty-twelve, and want to remove the huge banner image in the header for certain post types. How can I use add_filter() or add_action() to do this? I don't want to mess ...
2
votes
2answers
425 views

Custom function for “Submit for Review” hook

So I manage a blog of about 15 contributors and 5 editors. I wanted to implement a system so that each time a contributor hits the 'Submit for Review' button, and email is sent to the editors to ...
-1
votes
1answer
563 views

Call to undefined add_action() in theme's functions.php

Once done validating a form with ajax, I use php within my functions.php to actually send the form. <?php $name = $_POST['fname']; $lname = $_POST['lname']; $subject_line = $_POST['subject']; ...
0
votes
1answer
104 views

Add html to cpt main page / admin edit.php

I want to add some html under the title of a custom post type I created. See area in image here: http://i.stack.imgur.com/rpkV3.png I tried using different methods including post_row_actions ...
0
votes
1answer
55 views

What hook to use to redirect based on $post

Trying to add an action to redirect based on if user is not logged in and is accessing certain post types. Problem is, during template_redirect, $post is NULL and other ones the headers seem to have ...
0
votes
1answer
190 views

register_post_type not working in wordpress 3.6

I am using WP3.6 and am having trouble adding a new post type. I have put echo statements in the code and know that a) the function calling register_post_type gets called b) the post type name i am ...
0
votes
1answer
406 views

Insert new user with form submit 'init' hook

I'm posting a form to insert a new user and hooking my function to 'init'. This code is in my mu-plugins folder. The user gets inserted fine, but the page is not loaded after wards. My form action ...
1
vote
1answer
318 views

Get user's ID on logout

Is it at all possible to get a user's ID in a function right at the point of log out? I tried to hook it to wp_logout, but it just returns null when trying to get the user's info. I'm wondering if ...
1
vote
2answers
713 views

How to pass arguments to add_action() [duplicate]

I declared an action for a single event in Wordpress which accepts an array as an argument: $asins = array(); //I had to declare this since I'm getting a notice of undefined variable if I don't ...
0
votes
0answers
119 views

add_action not working in header?

i need to enable the session variables to my theme , so i have the following code in my theme functions.php function session_manager() { if (!session_id()) { session_start(); // Get ...
0
votes
1answer
181 views

Capture post content before page renders

I'm trying to mesh Mustache Templating Engine with WordPress. So far, I have been very successful using the_content as a filter to parse my template tags e.g. {{ something }}. However, if let’s say, ...
0
votes
2answers
281 views

Passing arguments in add_action inside search template

I'm trying to pass a argument to the function. But it is not transmitted. var_dump produces string'' (length = 0) What am I doing wrong? $map_vars = 'Test'; function map_data($data) { ...
0
votes
2answers
740 views

remove custom post type permalink

I've registered post type with following -- $holidayLabels = array( 'name' => __( 'Holidays'), 'singular_name' => __( 'Holidays'), 'all_items' => __( 'All Holidays'), ...
0
votes
1answer
74 views

Is it possible to cancel a post status transition?

Question I want to cancel pending_to_published actions: Posts that match certain criteria should that go from pending to published should stay pending. (Alternatively, I need a to make add an ...
0
votes
2answers
125 views

How to remove the option data of a theme when that theme is removed?

I developed a theme which stores some options to the database. I want to delete the option data from the database while the user removes the theme. But I don't know there is any action hook for doing ...
0
votes
1answer
101 views

What is the proper way implement a global $wp_rewrite?

The below code works correctly, but I don't know if it is proper coding. Can anyone confirm or comment on the code? add_action('init', 'news_rewrite'); function news_rewrite() { global ...
0
votes
1answer
43 views

Activity feed on admin dashboard

Is it possible to create an activity feed for a user on the WordPress admin dashboard for the activity on that blog? e.g. "Admin published a post - 12:00 Jan 12, 2013" "User2 updated page 'xyz' - ...
1
vote
1answer
254 views

Restrict post edit/delete based on user ID and custom field

I've been able to prevent deletion and editing of posts based on user ID and page ID however, I need to restrict access to editing and deleting based on a custom field. Not sure how to go about doing ...
2
votes
3answers
3k views

Using Ajax with a Class file

At the moment I have an ajax that works (I get a success [200] response), but having an issue with the action hooks on the response. The JSON object is not coming back, instead I'm getting a 0. I ...
0
votes
1answer
2k views

How do I find the code executed when wp_head() is called?

I am working on editing the header.php file and I am a bit confused. I am editing the header.php file and I see a call in it to wp_head(); I know that it calls a "callback function" with something ...
0
votes
1answer
30 views

Which filters or actions involve with index page for plugin?

I decide to manipulate index page or all pages except admin page with plugin but I don't know which filters or actions control index page. for example if I want write plugin that shows a link to admin ...
2
votes
1answer
96 views

Is there an action/filter called when WP_Query->query is finished and assigns posts

I took a look at the WP_Query->get_posts() function and couldn't see any action/filter that is called AFTER a query finishes. I want to be able to manipulate the results once they are sent, rather ...
1
vote
1answer
280 views

When is it too late to call the action wp_enqueue_scripts?

I'm creating a plugin that always enqueues a script in the footer. I also have a function that if called would enqueue an additional script that depends on the other one. Here is the basic format of ...
2
votes
1answer
658 views

get a list of all registered actions

i'm trying to debug a plugin which i didn't create and i want to list all registered actions. i read this ...
0
votes
1answer
108 views

An action hook where a comment meta is updated

By analogy to the hook on post meta update, I use the following code for hooking when comment meta value is updated. My comment meta key is "consider" and can have 2 values: 0 and 1. My Goal is to ...
0
votes
1answer
153 views

add_action does not work when instance multiple tab-containers via template-file

I wrote my first class in functions.php which I want to use to create multiple tabs with a simple call all over my template files. When I create a new instance directly in functions.php everything is ...
1
vote
2answers
28 views

Is it possible to add an action to the currently running action?

My question is very simple but I haven't found this answer yet. Here's an example: class MyClass { public function __construct(){ add_action('init', array($this, 'init')); ...
1
vote
1answer
201 views

Cron jobs in a class

Having: pluginname.php // If this file is called directly, abort. if ( ! defined( 'ABSPATH' ) ) { die(); } define('PLUGINNAME_PLUGIN_URL', plugin_dir_url( __FILE__ )); ...
0
votes
1answer
2k views

add_action and wp_head not display content in head section

I have a big problem. In a Wordpress page I've a function that generate og meta tags. I want to "append" that generated meta in the head section. So, I write this code: add_action('wp_head', ...
0
votes
0answers
52 views

Highlight posts currently being edited on multiple editor site?

I have a custom page that uses the Cleverness To-Do List plugin to display multiple posts on a page. My site has multiple editors, and if a post is currently being edited on the custom page (not the ...
1
vote
1answer
56 views

Prioritizing wp enqueue scripts error

I wanted to load the following two scripts before any other script so I added priority 1 and 2, however I am getting an error. I read it on a tutorial that this is how to prioritize ...
0
votes
2answers
148 views

save post running twice and creating two database entries - how do I disable this?

I am developing a job tracking database for my utility engineering company and am having an issue when running a save hook. I have a task_types db table that tasks are created off of and using a ...
0
votes
1answer
22 views

Is there a author_update action?

Is there an action you can tie into whenever an authors information is updated. (ie they update their display name). If not is there any way to tie into this?
0
votes
1answer
410 views

How to create Admin Notice from Plugin with argument? [duplicate]

I'm coding a custom plugin to perform some actions at specific times. I'm playing with add_action and add_filter but the current task I'm working on is posting the post url to Twitter account. ...
0
votes
1answer
119 views

How to load several hierarchical categories from functions.php

I need to insert several categories (about 400) into my site. The categories are hierarchical. I would like to load them from functions.php but now I can add one category at time, like this: ...
0
votes
1answer
143 views

Call a function with href

Is there any way to call a function inside plugin with <a href='plugin-function'> tag? I need this to show user details which will not be bound to any action hook.
0
votes
1answer
340 views

Correct method of redirecting user login

The popular membership plugin 's2Member' uses the wp_login action hook to wp_redirect a logged in user to where s2 deems appropriate. This causes a conflict with other plugins, in that other plugins ...
0
votes
1answer
2k views

wp_login action hook not working

I have spent many time looking for a solution to my issue, but in vain. Your help is invaluable. I am creating a simplified badge system. The goal is to increment the number of badges for a user if ...
0
votes
0answers
53 views

How To Add My Domain before the external image link

I want to add my domain link before the link image. For example, I'd like <img src="http://picasa.com/example.jpg /> to be : <img src="http://mydomain.com/http://picasa.com/example.jpg /> ...
2
votes
1answer
70 views

Why do filters/actions require an argument count?

I was just looking at plugin.php trying to answer the above question and I couldn't work it out. The actual code that calls filters is this: do { foreach( (array) current($wp_filter[$tag]) as ...
0
votes
0answers
156 views

Can't update an option when the publish_post action is fired.

I'm using Tom McFarlin's Plugin Boilerplate, and I'm facing this huge problem where I can't update an option when the publish_post action is fired. I have a function that hooks into the publish post ...