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

learn more… | top users | synonyms (2)

0
votes
0answers
11 views

Wordpress upload file action hook

I have a custom post type called "Magazine" shown in the admin interface. Everytime a user uploads a file in the wp-admin to my custom post type "Magazine", I want to fire a hook because I have to ...
1
vote
0answers
13 views

array of objects to do_action, callback gets singular object?

So I was passing an array of objects through an action today, no biggy, and things were working fine. Until I was iterating over one of the arguments to a callback and started getting errors. The only ...
0
votes
1answer
12 views

When is get_currentuserinfo() needed?

I know you usually call it inside functions after global $current_user, but sometimes it works whether you have it or not. So what are the conditions where is it needed? Sample code: function ...
0
votes
1answer
16 views

Redirect after post deleted

On the single template, I am using a delete post link generated by the get_delete_post_link function. When I use the link to delete the post I am currently on, it adds a query string of ...
0
votes
2answers
64 views

jQuery does not work

I am working on a project where I need jQuery for. I added this to my functions, and the scripts are loaded in my header if I watch my page source, but jQuery doesn't work. What am I doing wrong? ...
0
votes
0answers
27 views

post_content not parsed using save_post action hook

A site I'm building for a client has to be able to download Vine's to a server when they've been posted using a shortcode ([vine id="..."]). This works fine for my local install (it's a Multisite ...
0
votes
1answer
39 views

add_action before theme setup

I have a class which loads the image sliders on some add_action. There is a function/method "render_slider" which renders the sliders on the page based on the slider selected. The theme tries to get ...
0
votes
0answers
25 views

Post Rating System with wordpress

I'm using a Post Rating System with wordpress and jQuery, i followed this tutorial for that. ` jQuery(document).ready(function(){ jQuery("a.like:not('.voted')").live("click",function(){ ...
0
votes
1answer
30 views

the_posts filter been called multiple time

I have create an endpoint so I can do some checkout processing of my cart. Everything is working fine in sense that every thing is hooked up properly. Though I am having issue that to serve the ...
0
votes
0answers
17 views

action that only applies when certain item is in cart

I am using a function to automatically apply a coupon for certain products.The coupon only applies to a single category and is for a one-time event where those customers are only presented this ...
0
votes
2answers
49 views

action init hook and get_post_types

Why if I register a custom post type by add_action( 'init', 'custom_post_type' ) hook it doesn't show in returned array by get_post_types function? Example: function test(){ $args = array( ...
0
votes
0answers
52 views

Contact Form 7 to web service

I wonder if anyone can help me with something that's driving me crazy. I'm trying to implement a series of forms that will write to a CRM and the data must be passed as XML. I'm not particularly ...
0
votes
1answer
28 views

Show error message after exception handled

I have a plugin that updates a user profile, and I want to handle a date exception and show a error message when it fails, but I can't make it work. Here is part of the class: private function ...
0
votes
1answer
16 views

Custom registration field to SQL database

I have created new columns in a SQL table called wp_users. Those fields are "giodo", "handel" and "regulamin". What I want to do is to add '1' to each column when a user registers and selects ...
0
votes
0answers
35 views

Inserting into database from form issue

I'm trying to insert some data into a database before email sent with contact form 7. Currently it doesn't seem to be doing anything. My code is: add_action( 'wpcf7_before_send_mail', 'my_conversion' ...
0
votes
1answer
27 views

get_term and get_term_by returning null or false eventhough the term exists

I am trying to use the action hook delete_term, delete_$taxonomy, among other hooks that delete a term but they are presenting the same issue. For example: 1234 is an existing term in the favorite ...
0
votes
2answers
22 views

What is the action hook that deletes a taxonomy term from the backend? And how to retireve the term id before deleting it?

I need to delete some postmeta when deleting taxonomy terms from the backend. Before deleting the term, I need to retrieve the postmeta's meka_key and the term id that is going to be deleted. Use the ...
0
votes
1answer
47 views

How to check if single.php has already called the_post_thumbnail function

I am creating a front end plugin to upload images and adding filter in the_content() to display post thumbnail but some templates already have the_post_thumbnail in single.php or loop.php. Is there ...
-1
votes
1answer
31 views

How can I get the term_id from the action hook 'set_object_terms'?

I have the following code and I want to use the term_id inside that function. I aware that the variable $terms contains the term; however, I do not know how to get the term id from it. ...
1
vote
3answers
113 views

What are the benefit in adding hook in the init() hook?

I see a lot of plugins using this approach to add a new hook, e.g. add_action('init', function() { add_action('SOME_LATER_HOOK', xxx); add_filter('SOME_LATER_FILTER', yyy); }); Why they don't ...
0
votes
0answers
33 views

Custom login errors and redirect

I am working on a custom login page in Wordpress and found these 2 functions for a redirect back to the custom login pages to show errors there and nog on the Wordpress default login page. The first ...
0
votes
0answers
15 views

adding access to a specific post in the wordpress admin left menu

I've added a custom post type on my wordpess called "Perso". here is the code : // Register Custom Post Type function custom_post_type() { $labels = array( 'name' => ...
0
votes
1answer
49 views

Delete user from frontend

Hi I am working on a frontend admin where a user must be able to delete his account. current_user() is a custom made function of me that retrieves the user meta data. Does anyone know how I can make ...
5
votes
2answers
62 views

Remove Actions/Filters added via Anonymous Functions

That's a freaking bad practice I must say. Spent last two hours finding a solution to remove actions and filters added via Anonymous functions. This is the code used on a Parent Theme, and I need ...
0
votes
1answer
62 views

How to add custom content under plugin row in WordPress admin plugin list?

I'm looking to add a custom message under my plugin in the "Plugins" page, much like the following screenshot: What action or filter should I use? Thank you!
0
votes
1answer
40 views

change order of add_action hooks for jquery to be loaded first

a slider plugin puts its javascript “right before the closing body-tag” using an add_action() hook like this: protected static function addAction($action,$eventFunction){ add_action( $action, ...
0
votes
1answer
28 views

change output location of plugin function using a custom hook

I'm running the YouTube Video Fetcher plugin and it fetches youtube videos and displays it on your website. However, instead of displaying the video after the post, I want to hook the code into a ...
0
votes
1answer
76 views

add_action into another add_action not working

I have this little php code for wordpress. It doesn't work. I want to make one add_action under another add_action. But the add_action that is under, is not working! function no_reminder() { ...
0
votes
1answer
25 views

Odd behaviour with submenu link creation

I'm trying to develop a plugin that needs to add two pages to the dashboard side-bar menu. One of these being a main category. Everything is fine, except for the second submenu item for the settings ...
0
votes
1answer
31 views

admin_notices on runtime in function

I have a function that is called at a post updated, inside of this function I am doing something and if this went wrong I want to display an admin_notices. Inside of my function I tried the ...
0
votes
1answer
28 views

How can I get the user that publishes a post?

I have multiple users. Some are writers, others are editors. Is there a way to get the editor (id) that publish the post? I am able to get the author id but the not the editor's id that publish the ...
0
votes
0answers
17 views

Save automatically data to user profile once or twice a day [duplicate]

The main goal : I am working on a panel which will display statistics of my user websites (external website). For that, I use the Google Analytics API. I save the Google Analytics profile number in a ...
1
vote
1answer
63 views

Custom bulk actions in WP 3.7.1

So I am trying to get a custom bulk action to work in Wordpress 3.7.1 and so far no luck. The basis I am using is http://www.skyverge.com/blog/add-custom-bulk-action, and it goes wrong here: ...
0
votes
4answers
99 views

remove meta robots tag from wp_head

I am in need to remove just this line from wp_head but can't find the right hook to use it with remove_action(). <meta name=robots content="noindex,follow"/> Basically what I want to achieve ...
0
votes
1answer
23 views

Action inside another action not working

I am trying to load content before the end body tag on admin pages that have a TinyMCE editor on them. To do this I am trying to leverage two action hooks 'before_wp_tiny_mce' and 'admin_footer' but ...
0
votes
0answers
29 views

remove_action(“wp_ajax_function”, “function”); not working

I have the following code in a file called contact-form.php. The file lives here: wp-content/themes/NAMEOFTHEME/ (premium theme) function theme_contact_form() { // some code here (send mail when ...
-1
votes
2answers
42 views

How to add a new link to the default register form's footer links?

I would like to add a custom link to the footer section of the register form. How can I do this? I am using the login_footer hook: add_action( 'login_footer',array($this, 'add_forum_menu'), 50, 2 ...
1
vote
2answers
57 views

Registration and Profile custom field

How to add custom field in wordpress registration form and view it in user profile in the backend? I've already google it but just find how to add it in user profile but not in registration process.
0
votes
0answers
16 views

Adding custom Bulk Actions

I have been looking around for ways to add custom Bulk Actions to the categories page. Most of them say that it is impossible to do it in a clean way, because of the lack of a hook for this. Most of ...
1
vote
0answers
47 views

How can I register a hook for all Custom Post Types that are published?

I'm developing a plugin. I want that when every Custom Post Type is published, a hook is called (where I send an email notification to the administrator). I know I can use: ...
0
votes
0answers
28 views

Cart Discount when applied to the cart doesn't show the correct amount in Order Total using Woocommerce in wordpress [on hold]

I have being creating a new woocommerce plugin that will provide an option to the apply discount on top of the cart page. Now when there are products in the cart, the user will click on the Apply ...
0
votes
0answers
42 views

Woocommerce reviews outside tabs [on hold]

Can anyone tell me if this is possible and if yes how can achieve this? I need to use the review comments and review comment form outside the woocommerce tabs, so far i only find this way, on my ...
0
votes
2answers
30 views

Override the Wordpress core function wp_referer_field

I'd like to override the core Wordpress function wp_referer_field to change the value of $referer_field variable inside of it. I've found that wp_referer_field is not pluggable and that I need to ...
1
vote
2answers
61 views

Check if do_action('custom_action') is hooked into?

Is there a way to check if a custom hook gets called upon? I would like to display a placeholder if no output will be passed to it.
0
votes
2answers
38 views

Basic function call on init failing

I've been banging my head against this for a while. I have this very straight-forward code in my plugin: add_action('init', 'register_shortcodes'); $shortcodeRegistrationRan = False; function ...
0
votes
1answer
40 views

Is there a way to prevent a function/method from being called outside a specific hook?

I would like to make function only callable by a specific action, in this case the register_activation_hook() function. How can I do this?
0
votes
2answers
63 views

what is correct way to hook when update post

i try to hook when post is updated but all hook i try never executed except updated_post_meta add_action('updated_post_meta', 'my_function'); function my_function($post_id) { echo 'This is ...
0
votes
1answer
49 views

Which hook to add action on specific page?

I tried to remove action added by a plugin only for specific posts. But I can't find the hook to get the page ID currently edited (wp-admin/post.php?post=112) and add action conditionnally. Here's ...
0
votes
0answers
39 views

GET form action. Redirect to self

I'm writing filter for posts by category on author page. I send category name in $_GET array in this form: <form action="" accept-charset="UTF-8" method="get" id="form1"> <select ...
0
votes
0answers
14 views

Scheduling a function to change meta value for every post within query

I am trying to check if a post (custom post type) is equal to or more than 14 days old. If it is, I want to change the meta value 'listing_status' from 'active' to 'inactive'. I want Wordpress to ...