-1
votes
0answers
8 views

replace a function added in external class

I'm using wp 3.9, bp 2.0.1 and the bp-groupblog plugin 1.8.5. In the 'create_screen'-function in BP_Groupblog_Extension-class (extending the BP_Group_Extension-class) the plugin adds an action: ...
0
votes
1answer
22 views

override function from my plugin

can anyone guide me how can I override following function from my plugin. I know how to use add_action but I didn't found add_action for this function in buddypress plugin. Its using do_action and I ...
0
votes
1answer
33 views

Action hook “wp_insert_post” works but not for last imported post

I want to run a custom function whenever posts are imported to my custom post type. I am currently running this code - function on_post_import($post){ global $wpdb; $results = ...
0
votes
0answers
13 views

Meta query not working with pre_get_posts

This works $q->set('meta_key', 'available-date_%_from'); $q->set('meta_value', '20140701'); This doesn't $q->set( 'meta_query', array( array( 'key' => 'available-date_%_from', ...
0
votes
1answer
24 views

How to get menu location in wp_update_nav_menu hook

I want to get the menu location in the wp_update_nav_menu (during menu save action) add_action('wp_update_nav_menu', function ($id, $data = NULL) { error_log( var_export($data, true) ); ...
0
votes
1answer
85 views

Wordpress Update Plugin Hook/Action? Since 3.9

I've researched this a few times, yet my searching does not reveal much except custom code which may or may not be good wordpress practice. As of the latest releases, has a hook been added to the ...
0
votes
1answer
18 views

add_media_page function not creating submenu

I have the following plugin that I'm just testing at the moment. /* Plugin Name: Menu Test Plugin URI: http://codex.wordpress.org/Adding_Administration_Menus Description: Menu Test Author: Codex ...
0
votes
0answers
42 views

External Script Using WP - Hooks / Actions Not Working?

I've researched this problem in depth, but still stumped. Simply stated, I have an external uploader script which loads WP. Yet I cannot seem to grab any of the actions/filters I've put into it. Why ...
0
votes
2answers
87 views

How do I add some javascript validation to the admin interface form's onsubmit?

I have a plugin that adds meta boxes to the admin interface and I need to do some validation when the user presses the "update" button before the form is submitted. Is there a WordPress action or ...
0
votes
0answers
146 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 ...
1
vote
3answers
122 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
1answer
43 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
142 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() { ...
1
vote
0answers
63 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
54 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
75 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
1answer
71 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
1answer
18 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, ...
1
vote
1answer
77 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
56 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
23 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
53 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
325 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'); ...
1
vote
1answer
52 views

wordpress plugin is not activating from widget

I am just creating a plugin in wordpress. In this plugin I am trying to create a widget, In that widget it will show a title, input text and text area in the widget section and when the values will be ...
1
vote
2answers
63 views

Which hook callback has priority if both plugin and theme use the same hook?

If a theme and a plugin uses the same action hook, for example comment_form is used by both theme and plugin. Then , which one will be called first? the function associated with the theme's hook or ...
0
votes
3answers
665 views

add action wp_head not working

I am trying to add some code to the head (namely a block of tracking script) via a plugin I am making. The plugin has an interface where the user enters some details which are then added to the ...
0
votes
1answer
100 views

Very stubborn wp_register_script / add_action vs remove

I am trying to get rid of a plugin's .js file in the but it's not working. It's being called here {partial code): class awqsf{ const post_type = 'awqsf'; function __construct(){ // ...
0
votes
1answer
61 views

How to hook into action/filter call

I'm about to create a very simple logging plugin. Every time an action or filter is fired I need to log it to the file. The idea is that we will be able to see exactly which actions and filters are ...
0
votes
1answer
259 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 ...
0
votes
1answer
63 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
1answer
29 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 ...
0
votes
1answer
185 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 ...
1
vote
2answers
27 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
votes
2answers
606 views

Woocommerce related items - remove action / add action

I'm working on a Woocommerce plugin to show combo items on the product single page. I'm having some issues removing the action that displays the related items on the product page. I'd like the ...
0
votes
1answer
182 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
89 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
0answers
135 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 ...
1
vote
1answer
181 views

Removing an action, or dequeueing style - Both not working

What I am wanting to achieve is to remove an action called inside of another action. The action is calling a style, and although I have tried to deregister, and dequeue the style, it is still ...
1
vote
2answers
315 views

Removing an action from an external plugin class

I am using a plugin that has this line of code to add an action from the Eazyest_Frontend class: add_action( 'eazyest_gallery_thumbnails', 'ezg_thumbnails',5); I want to remove that and do ...
0
votes
2answers
161 views

Problem with executing a function on saving a post

Here is my basic plugin code. I am just starting from scratch. I will explain the functionality. It is simple, While my plugin is active it will add a new meta box in add new post page just below the ...
-1
votes
1answer
79 views

How to remove a class [closed]

Is it possible to remove classes from a plugin and add theme into to theme? I need to modify Woocommerce WP_Checkout class but I want to move it to my theme folder so if woocommerce will be updated ...
1
vote
1answer
49 views

What is the purpose of $merged_filters?

Savvy WordPress user here, or at least trying to be. I have the hang of hooks and filters with the code in WP's plugin.php The only thing I cannot seem to understand is the $merged_filters global. ...
0
votes
1answer
490 views

register_activation_hook in oop approach

I tried to develop a plugin in OOP approach. I tried to load all the function needed inside the constructor class e.g action hooks. The problem is this hook "register_activation_hook". It wont load ...
-1
votes
1answer
2k views

WooCommerce Order Status Displays Twice on Order Page

I modified the woocommerce_custom_order_columns function to make some changes to the WooCommerce Admin Order page. Everything works great, except that Order Status shows up twice (but only for the ...
0
votes
1answer
1k views

Where is the best place to use add_filter

Should I use the function add_filter In my plugin's init action hook or just the in the main plugin script? Since sometimes I found people is using filter all over the place and if I put in the init ...
2
votes
2answers
67 views

Is there an action that is called when a post is restored from the trash?

I'm looking at the wordpress list of actions and trying to find an action that is called when a post is restored from the trash but cannot find one. Does anyone know if it exists?
0
votes
1answer
1k views

Disable WooCommerce action

I'm customizing a WooCommerce theme and am going to be moving the title. There is an action in content-single-product.php called do_action( 'woocommerce_single_product_summary' ); in the ...
0
votes
1answer
2k views

Using the 'draft_to_publish' hook (post status transition)

I am trying to use the draft_to_publish hook (http://codex.wordpress.org/Post_Status_Transitions) to run a function when a post that is a draft becomes published. This hook does not appear to be ...
0
votes
1answer
94 views

template_redirect not being called when using ajax

Usually I hook all my custom plugins code with the template_redirect hook but one of the issue I encountered is it does not work for the ajax call. So if I want to target both standard calls and ajax ...
1
vote
1answer
125 views

How to call bind function in wordpress actions or hooks

I have made a class file in my plugin folder. Then I wrote, class Sample{ function footer_content(){ echo "show any data"; } } Then I added the function footer_content to wordpress ...