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

learn more… | top users | synonyms (2)

0
votes
1answer
57 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
49 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
72 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
523 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
1answer
164 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
85 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
2answers
82 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
121 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
63 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
59 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
337 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
242 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 ...
1
vote
0answers
129 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
1answer
37 views

Updating User Profile on Registration

I am having trouble getting WP to update a custom profile field when a user registers. Adding the fields works fine. Nothing is inserted into the depositAddress profile field when a user registers. ...
0
votes
1answer
124 views

How to use add_action for multiple instances of the same class

I'm writing a plugin which defines a class that is meant to be called multiple times. The class uses add_action to register it's own methods as callbacks. class MyClass { __construct($foo) { ...
0
votes
0answers
73 views

Displaying Single Future Posts in a specific Category or Taxonomy

I want posts that are tagged with a certain term and scheduled to be posted some time in the future to be publicly available. So if I create a post, assign it a special term (category, tag, custom ...
0
votes
1answer
28 views

Is this correct usage of filters in WordPress [closed]

I am building a plugin and I'm getting doubts whether the code I am using is the correct way of doing things with regards to WordPress hooks and filters. The scenario is that the code at a particular ...
4
votes
3answers
166 views

How to restrict actions and filters “properly” by conditions

Which one is correct when adding actions/filters/etc.... Both methods work fine and I've seen people do things both ways, but I'm assuming one is correct. My gut tells me that wrapping the if ...
0
votes
1answer
91 views

Add custom action in post type

I use the http://www.deluxeblogtips.com/meta-box Metabox plugin and I want to add a custom action in a post type like the publish button ? when admin click on this button I want to send an email to ...
0
votes
0answers
80 views

How would I remove an inline googleAPI font script in the the parent theme header.php?

Is there any way to remove the function call to the googlefontapi font in the parent header.php file besides copying the parent header.php file to the child theme and then overriding it and delete the ...
0
votes
1answer
48 views

How do I amend form data before it is saved for a custom post type

I have a custom post type for clinics which has 3 fields; a textarea for the address of a the clinic and two textboxes for latitude and longitude. I want the user to enter the address in the textarea ...
1
vote
1answer
26 views

Preventing frontpage to be deleted/moved to trash

I want to prevent my frontpage to be deleted/moved to trash using this: add_action( 'wp_trash_post', 'tcb_page_delete_check' ); add_action( 'before_delete_post', 'tcb_page_delete_check' ); ...
0
votes
0answers
13 views

Add_action not updating user_meta when trashing multiple checked posts

I have a point system to my wordpress theme. I've recently added a function that removes one point from the member if I remove their post. However, when I check and remove multiple posts in the ...
0
votes
1answer
123 views

Remove action plugin

i have installed the theme-my-login plugin and i want change the password_fields function: this is the code of custom-password.php of the plugin: /** * Loads the module * * @since 6.0 * ...
0
votes
0answers
59 views

OOP - add_action

I'm making a simple theme framework for personal use and I'm try to set up various options in a class. Basically, I want to use add_action within my class but the function doesn't seem to be firing ...
3
votes
1answer
164 views

Check php version before theme activation

I've got theme that requires php 5.3+ version. If older - fatal error occurs with it. So what I need to do when user try to activate this theme is to check php version before going into theme code ...
0
votes
1answer
59 views

How do I remove an action hook by s2member

I noticed that my plugin doesnt work when s2member is activated but unfortunately it is needed for the site functionality, i did some research if I comment out this line on hooks.inc.php then my ...
0
votes
1answer
74 views

How can I get some of a posts meta data whilst it is still inserting?

I'm trying to make a function where a child post of a certain post type inherits the same title and slug as its parent. I'm using WP Types to define my post types and their relationships. But I'm ...
0
votes
1answer
57 views

What is the action or filter for adding information under the Permalink in Edit Post/Page?

I would like to add some HTML under the "Permalink:" in the Edit Post/Page page. Under here: So what is the action or filter?
0
votes
1answer
215 views

add_action 'init' from inside a class for custom post types

I'm trying to create archive pages for my custom post type. I create custom post types from within custom classes: functions.php include_once(get_template_directory() . '/admin/admin_init.php'); ...
0
votes
1answer
23 views

Removing this filter added by a plugin

I found the action I'd like to remove in the plugin php file: add_action('init', array($user_hooks, "doAutoLogout")); yet, when I add this: remove_action('init', array($user_hooks, ...
0
votes
1answer
67 views

Removing action from template class

I'd like to replace an action in a theme with my own version in a child. In this case, the theme hooks into wp_head to add it's own links. My own functions.php resides in the child theme and looks ...
1
vote
1answer
144 views

Filter or action hook to insert content on admin pages before </body> tag

I am developing an administrator plugin and want to be able to write some HTML content just before the last body tag . This content will initially be hidden then displayed with javascript when a user ...
0
votes
2answers
70 views

What hook can I use to modify custom post data before it is displayed on the page?

I need to check if a certain value is true in the post_meta right after the wp fetches a custom post from database, If it's false I need to modify/add some data to the post and then display the ...
0
votes
0answers
107 views

Redirect to custom post type admin page after wp_trash_post

I currently have a custom post type (enquiries) with a custom metabox which displays the date(s) for that enquiry, these are saved as metakey key value pairs, there can be one or more. the metabox ...
1
vote
1answer
72 views

Redirect logged in users if they are on a specific page

I'm trying to prevent a user access besides the admin to the registeration page and reset password page if they are already logged in. I have the following: function redirect_loggedin_users() { // ...
0
votes
1answer
114 views

Proper after_setup_theme and wp_head cleanup

Im trying to clean up code in my theme a little bit, remove some of the code that is not used and basically do things the right way, to decrease load time etc. Currently I have this code: ...
2
votes
0answers
81 views

Content hooks vs User hooks

This is more of a theory question than a question with a direct answer. I've been working with different actions for firing functions when a post is updated or deleted and when users are updated or ...
0
votes
1answer
49 views

Which hook should I use for this scenario regarding the registration process and account/profile update?

I would like to run a PHP script "ONLY" when a user successfully fills out the WordPress Registration form and submits it as well as when a user updates their profile. Here's what I have so far, ...
0
votes
1answer
457 views

WooCommerce wp_insert_post action firing on every save

function initial_product_data ( $post_id ) { // lets get out of here if this is not a new product if ( 'product' != $_POST['post_type'] ) return; // make sure the post isn't automagically ...
0
votes
2answers
66 views

Content won't load when using action the_content

When I use add_action( 'the_content'... The content of the page just won't load. Also the content I am trying appears in all kinds of places in the page. Why? Is there a way to force it to only ...
1
vote
0answers
78 views

I have 2 plugins using the same wp_login action hook and one is not working

so this is after a few hours investigating, I have s2member plugin and a custom plugin what happens is they are both using wp_login hook in this manner, s2member: add_action("wp_login", ...
0
votes
0answers
154 views

inline script : prettyPhoto setting deeplinking to false not working

This is suppose to be simple but I can not figure it out. I'm using WordPress prettyPhoto plugin for my project and I'm trying to set deeplinking to false (deeplinking:false). In the Chrome console, I ...
0
votes
0answers
41 views

how to perform wordpress bulk actions using table inherited from wordpress list table

In my plugin which shows a table of business listings from database, I wanted to add the option for bulk actions. Besides the checkboxes I displayed the control for bulk actions, but when I click ...
0
votes
0answers
63 views

Unsure how to add simple checkboxes that write to a small table to admin

I've been doing a lot of reading on the add_meta_boxes...but there's so much information that I'm confused about when to use them. I have a little plugin that writes out some checkboxes and then when ...
0
votes
2answers
50 views

Plugin Scripts no loading on options page

I've got this in my main php file, but the scripts aren't loading function class_table_scripts() { wp_register_script( 'JavaScript1', plugins_url('js/wcs.js'), array() ); wp_register_script( ...
-1
votes
1answer
477 views

what is the action hook code to supporting product category condition in single product page of woocommerce?

I want to display product attributes of 2 different product category with the help of conditional tags. But the condition was not working This is the condition that i given ...
0
votes
1answer
47 views

Display taxonomy with a maximum number of letters

I'm looking for a function which displays a post's taxonomy with a maximum number of letters. I've achieved with title (How to limit the max number of characteres in the title that are displayed), but ...
0
votes
2answers
136 views

do_action in header, add action later?

I want to include the facebook JSSDK only on pages where I want to use it. On the facebook dev site it sais that ideally its included right after the opening body tag, which sits in header.php My ...
1
vote
2answers
101 views

How can i do something after head like adding a hook for after head but before post

What i mean is i am trying to add breadcrumbs to my blog and i thought of adding it before content or after title but there's an issue with that - on archive pages or category pages the breadcrumbs ...