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

learn more… | top users | synonyms (2)

0
votes
1answer
96 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
54 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 ...
2
votes
1answer
126 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
53 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
69 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
48 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
175 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
19 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
62 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
116 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
63 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
89 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
66 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
96 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
80 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
46 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
374 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
59 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
63 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
117 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
38 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
59 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
47 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( ...
0
votes
1answer
421 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
44 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
107 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
79 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 ...
0
votes
1answer
69 views

Wordpress' work or execution flow manipulating $wpdb

I have read about overwriting global variable $wpdb and connecting to a second database this way ( Search another database with wp_query using new wpdb ) so one could e.g. use WP_Query on 2nd DB. ...
0
votes
1answer
62 views

How To Make Sure That My Action Hook Executes Last

How can I make sure that my_function action hook on 'wp_head' is executing last? One hack, that I'm using, is to give 999999 (a big number) as the third argument. But maybe some other hook on ...
1
vote
1answer
1k views

update_post_meta() whenever custom post type is updated

I need the following functionality. Whenever my custom post type is updated or saved I need to overwrite certain custom post metas. I need to make sure this only affects posts of the post type ...
0
votes
0answers
25 views

Filter for modifying image on upload

So I'm working on building a new WordPress plugin for massive PNG compression, and I'm having a hard time finding the right filter to hook in to. I need to access the entire image so that I can open ...
0
votes
0answers
20 views

How can I update the role of a newly added user when displaying the registration form with a shortcode?

Basically I have a shortcode that includes a registration form(among other things). The custom form itself is also included on wp-login.php and user-new.php if the default role is set to ...
0
votes
0answers
60 views

Suppress the_content filter in a nested loop

I have some layout changes that are being applied to the_content. I need to do one of two things, but neither is working as expected... either: Pass data to the filter so that it knows if it is a ...
0
votes
1answer
69 views

Is it possible to track down Actions and Filters?

As far as I know using Actions and Filters hooks is the best approach for developing on WordPress. I have just to ask if there is any way to track down which Actions and Filters are applied on ...
0
votes
0answers
78 views

Ajax Request not coming back to class

I'm struggling with an ajax request. It's executed but not returning back to my class. My PHP: ... public function __construct() { add_action( 'admin_print_styles', ...
0
votes
1answer
62 views

Making an add_filter() call from within an add_filter() call

I am creating a plugin where I am checking for parameters passed in the url for a page, then using the values of those parameters to change the Title, meta tags and make some other SEO changes. But I ...
0
votes
1answer
48 views

add_action insert html

I know I am missing something simple. I am trying to use html to log to footer to learn wp. In theme functions.php: function myLog() { echo 'test'; } In theme footer within the .siteInfo ...
0
votes
0answers
35 views

Action after saving/publishing a post

I want to create a small newsletter plugin, which can send mails out of the edit post page. I will add a metabox, and don't know how to create a button in this metabox which will start my function. ...
0
votes
1answer
58 views

How to enable/disable a hook with theme options

I am trying to use this function to add maintenance mode feature by adding this in my theme's functions.php and I am trying to use my theme options to enable/disable it. I realized when i ...
0
votes
0answers
58 views

How do I turn off local pickup for a specific shipping category?

Can anybody provide me with some code that would help? I need to be able to offer flat rate shipping AND local pickup for all product categories apart from 2, which I have assigned to a separate ...
0
votes
1answer
690 views

Plugin custom Action Hook not working

I am trying to create one basic plugin where I want to create my own action hook. Here is the code for the same. <?php /* Plugin Name: Demo Plugin Version: 1.0 */ do_action('basic_action_demo'); ...
0
votes
1answer
73 views

cant output grayscaled ive created using add_image_size

I am trying to create a gray scaled image of the image i upload. I have been able to upload the image and create the gray scaled version by using this code: ...
0
votes
1answer
2k views

Add “add to cart” button in WooCommerce [closed]

I use the Mystile WooCommerce theme, where the "add to cart" buttons is removed by this code: remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10); That ...
0
votes
0answers
36 views

Custom meta boxes for different custom post type on multisite WP

I have two custom post type defined ('acting' and 'voiceover') and custom met boxes defined for both of them. I'm able to save, update and delete on the acting custom post type. But if I add the ...
0
votes
1answer
33 views

Plugin default settings hook

I am writing a plugin where I want it's default settings to change in accordance to the theme that is selected. I have it working, but would rather provide an action hook for this instead of writing ...
0
votes
1answer
201 views

Is it possible to create an action hook using do_action() within add_action()?

Is it possible to create a new action hook like do_action('my-hook-name'); inside a call to add_action();? I'm aware this code doesn't work, but I was thinking something along the lines of... ...
0
votes
3answers
233 views

adding multiple custom columns to users.php

I'm trying to add two columns to the users.php file. I'm not sure how to add both $total_time_display and $logged_in_amount_display. How could I return both values? Here is my code: ...
0
votes
1answer
183 views

Add content after get_header

I'd like to add content directly after the div#main (end of header.php) and before /div#main (beginning of footer.php). I'm using an own child-template (of twentythirteen), that contains only ...
2
votes
2answers
929 views

add action only on post publish - not update

I have action which adds meta field with value on post publish. Problem is that when I update post meta field is reset to default value. I already tried 'new_to_publish' instead of 'publish_post' ...
0
votes
1answer
41 views

How can I unhook this action that was added via $this?

This is in regards to the plugin Theme My Login, although the question may relate to any plugin. The author says he no longer uses the support forum, so I've come here. I'm trying to unhook the ...