The hooks tag has no wiki summary.
0
votes
1answer
168 views
OOP Plugin: Where should I place the action hooks in the class?
Where in my admin class should I place the action hooks for adding css, scripts and the add menu page?
In the __construct? Or should they be placed in a method?
1
vote
2answers
82 views
Too many actions/filters!
New to wordpress here. The concept of actions/filters in and of itself is not too difficult to grasp. What I am overwhelmed by is the HUGE amount of actions and filters available. When I am looking at ...
0
votes
1answer
3k views
The hook for the AJAX Add to Cart button?
Anyone here ever had the need to add the AJAX add to cart button (the one located on product archives) on a custom query post output?
Do you mind sharing the hook? I can't seem to find the correct ...
2
votes
2answers
188 views
Load different template file when condition met?
If I visit a page on my WordPress site, WP goes and determines what template file it should use based on the template hierarchy.
If I'm doing some logic checking in the hook init and say my ...
1
vote
1answer
172 views
What hooks/filters are there to alter selected terms on post save?
Very simple, where would I hook/filter to alter the users selection of terms when they save a post (Update or Add)?
I need to hook in all instances; such as when saving a post via AJAX, saving when ...
0
votes
1answer
297 views
Custom posts and get_post_meta in {$post_status}_{$post_type}
I am making a function to parse a .csv file uploaded in a custom field of a custom post. The name of the custom phone and the field's name is plan_information . The problem is when I ...
0
votes
1answer
131 views
Fire a hook programmatically
Is it possible to fire a wordpress hook programmatically? Specifically I'd like to have control of wp-insert-post.
1
vote
1answer
111 views
Looking for a hook for post.php
First time posting here...
I am trying to figure out if there is a hook or action that I can use when a user goes to wp-admin/post.php... Basically when the user goes to post.php I want to check if ...
4
votes
1answer
323 views
What is the action hook for save media-form on gallery tab?
I want to save a meta data to post parent when the media-form on gallery tab is saved( The submission button is "Save All Changes"). Which action hook can I use?
2
votes
1answer
89 views
deactivated_plugin hook: get the name of the plugin
I would like that every time any plugin previously activated, a function from my plugin be called, returning (at least) the name of the plugin, or something that allows to identify it (file name?).
I ...
1
vote
1answer
289 views
Filter all html output
I would like to make sure no email address is published in plain. So i developed a plugin that replace all email addresses by a spambot-safe alternative.
But some users put their email address in ...
1
vote
2answers
312 views
Enqueue script from widget method (of extended WP_widget object) possible? (slightly different from other variations of this question)
I am creating a widget plugin that a user could potentially use multiple iterations of the widget multiple times on a single widget-area / multiple widget-areas on a single page. Because of its ...
0
votes
2answers
569 views
How to use a WooCommerce action hook?
I am wondering how you would implement the following hook.
do_action( 'woocommerce_process_product_meta_' . $product_type, $post_id );
What is the correct way to call a call the action from a ...
1
vote
0answers
67 views
Can I hook into wp_update_core outside of the admin?
I'm trying to bring some of the admin functionality to a custom front end in WordPress. Questions of security and pragmatism of this aside, is there an available hook to trigger wp_update_core outside ...
0
votes
1answer
145 views
How to change database values on theme update
I have a theme released into the wild but have not prefixed the post type appropriately. Yes, I know, it's a shame and I regret it :(
So, I am currently using acme as the post type name, but I' like ...
1
vote
1answer
172 views
Which action does wp_update_user triggers?
I am working modifying an ecommerce plugin, and it makes uses of wp_update_user() function, and everytime the function runs another table (created by the plugin), gets updated too. The problem is that ...
0
votes
1answer
289 views
hook for lostpassword form
Im trying to add captcha to my remember lost password form:
I've added the input with the lostpassword_form hook and is ok.
now in the processing I need to add a error when captcha is invalid:
...
2
votes
2answers
177 views
Which hook should be used to validate custom form fields on the login form?
I've added a custom input field with login_form hook.
So, I need to process the post data to validate.
I've used the lostpassword_post for lostpassword_form and works great, but I cant find a hook to ...
1
vote
3answers
249 views
Is there a recover_post hook to go with trash_post hook?
I'm using the trash_post hook to set a flag in a custom table to indicate that this item is "deleted", but when the user chooses to restore that post, what hook can I use for that? I couldn't find ...
1
vote
1answer
33 views
Is there any way to allow a plugin to write over a previous version?
When installing a plugin, it will not install if the directory to which it is attempting to install already exists. This means that users of our plugin must first manually deactivate and delete the ...
1
vote
1answer
528 views
RSS Feed Custom Title?
For some reason my RSS feed is repeating the site title twice without a space, obviously quite annoying.
BlognameBlogname for example.
Is there any hook i can use to have a custom title for the RSS ...
4
votes
1answer
72 views
How Do I Load My Action Earlier Enough?
With add_action, I want to intercept as early as I can in my plugin and send a 304 Not Modified header per some rules. Does anyone know what the order is of events? When I view this page, it seems to ...
1
vote
1answer
424 views
Add custom column in custom post type edit page
I am using the Content Scheduler plugin to control the post expire. The plugin will add a expiry date column on the wp-admin/edit.php in page and post. However it doesn't show in custom post type page ...
7
votes
2answers
947 views
Why do some hooks not work inside class context?
I'm pretty stumped on this one. I'm using add_action inside my plugin class to do certain things- add scripts & styles to the head, wp_ajax, etc. Here's the actions, in the __construct:
function ...
0
votes
2answers
231 views
How to get post ID with hooks publish_post, new_to_publish, etc
I have two plugins, one uses the function wp_insert_post(), the other has a code like this:
add_action('future_to_publish', 'myFunc', 10, 1);
add_action('new_to_publish', 'myFunc', 10, 1);
...
11
votes
3answers
1k views
Multisite: How to add Custom Blog Options to new blog setup form?
Seems like a simple enough requirement, but I'm struggling:
I want to add an option field to the "Add New Site" -- a simple text option is fine.
How do I do this??
I need to save this custom blog ...
0
votes
1answer
85 views
Turning on output buffering in a wordpress plugin
My wordpress plugin uses sessions for handling various things, and on the production site I'm testing it on output buffering is not on by default so I'm getting a lot of messages such as these:
...
0
votes
1answer
328 views
get_current_screen and the WP_Screen class
So I'm trying to figure out how to properly use the get_current_screen. For learning sake, I'm just popping an alert for a specific page. I've looked at ...
0
votes
1answer
179 views
How can I modify the header of RSS feed items?
Specifically I would like to change the value of <dc:creator> in the feed items. In order to display the site name instead of the post author.
I'm able to hook into the_title_rss , ...
0
votes
1answer
95 views
Bug: Post needs to be updated twice when adding action for save_post hook
My function does exactly what I want it to do: I'm trying to add/update meta fields in another post type when an "events" post is saved. Except the post needs to be updated twice for the information ...
1
vote
3answers
319 views
wordpress custom modules/widget areas on the page? can i make my own?
im kind of a wordpress noob so please excuse my inexperience.
so long story short, ive been tasked with creating a WP theme (kinda simple) but, one of the areas, around footer area, has a few things ...
3
votes
1answer
243 views
Want to redirect if search query match exact title of any post
I am using WordPress 3.3.1 and new to this system. I want to redirect the search query to the post if query exactly matches post title of some post.
I also want it to run before any search query ...
6
votes
1answer
337 views
Whats worth using add_action when we can simply use add_filter?
I've just looked into wordpress code and found this definition of add_action:
function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1) {
return add_filter($tag, ...
3
votes
1answer
127 views
How should I intercept the main query and inject custom join / order by / group by criteria
I have a CPT that is a member of two separate taxonomies. On the taxonomy archive page for one of the taxonomies, I need to further group and sort on the second taxonomy like so:
...
2
votes
1answer
144 views
How do I flush the rules after saving settings using the Settings API?
I'm using the Settings API to allow the user to toggle the has_archive option on some custom post types. When the user turns archives on or off, I want to flush the rewrite rules. If I had written ...
2
votes
1answer
1k views
How can I remove “Proudly powered by WordPress” from twentyeleven without modifying footer.php?
How can I remove "Proudly powered by WordPress" from twentyeleven without modifying footer.php, and without creating a child theme?
I'm looking for a php command, such as add_action, remove_action, ...
2
votes
1answer
582 views
why doesnt is_home() work in functions.php
I'm pulling in scripts.php through functions.php. this is in scripts.php but for some reason, wordpress isn't recognizing is_home(). i've tried resetting the query, but to no avail. Am I hooking into ...
1
vote
1answer
109 views
filter the_title problem in nav
Hi I have a problem with the_title filter:
I have this code at my constructor:
add_filter( 'the_title', array($this, 'change_title') );
and this as callback (for testing purposes)
public ...
0
votes
1answer
228 views
Changing the text of Upload/Insert on Posts and Pages Screen
In wp-admin/includes/media.php I found this:
function media_buttons($editor_id = 'content') {
$context = apply_filters('media_buttons_context', __('Upload/Insert %s'));
$img = '<img ...
2
votes
1answer
273 views
In what sequence are the hooks fired when a post is “published”?
I would be grateful if someone could point out a link. I understand this may have a very lengthy answer but I searched and couldn't find any resource.
Alternatively, it would also be nice if someone ...
0
votes
1answer
292 views
Unhook the comment form in Buddypress
Im trying unhook the comment form found in the functions.php of the deafault buddypress theme so I can change it a bit. I placed this piece of code into my child theme functions.php but it didn't ...
0
votes
1answer
52 views
Remove iPhone detection on login page
I have a wordpress site with a customized login page, the problem is when I go to that page on my iPhone, it detects it as an iPhone and adds the viewport meta tag, which normally would be great but ...
2
votes
1answer
780 views
Check before publishing, if already exist post with current custom field value
I have a custom post type with only 3 custom fields in it.
$post_types = get_post_meta($post->ID,'post_types',true);
$post_taxonomies = get_post_meta($post->ID,'post_taxonomies',true);
...
1
vote
2answers
196 views
action lifecycle
I'm looking for a documentation page where wordpress action lifecycle is explained. Does it exist?
I can't understand if init is called before admin_head or viceversa (even if the name is ...
2
votes
2answers
327 views
Wordpress Admin Tooltip hooks
I want to know if there is a way to use Wordpress Adminitration Tooltips (de gray and blue ones) that are shown one you update your worpdress (3.x). Showing the new features.
Thanks!
7
votes
1answer
1k views
Passing a parameter to filter and action functions
Is a way to pass my own parameters to the function in add_filter or add_action.
For example take a look in the following code:
function my_content($content, $my_param)
{
do something...
using ...
0
votes
1answer
777 views
NextGEN Gallery: Adding drop-down menu widget to gallery view without modifying plugin code
In NextGEN Gallery, I am able to add a dropdown menu that lets users filter a gallery to only show images that are tagged with a specific ngg_tag, simply by adding this to view/gallery.php in the ...
0
votes
2answers
173 views
How to deactivate my plugin upon deactivation of NextGen
i'm writing this plugin and i need to deactivate it when NextGen is deactivated:
<?php
/*
Plugin Name: Plugin Name
Description: Description
Version: 1.0
Author: Author
Author URI: Author URI
*/
...
0
votes
1answer
503 views
Hooking custom PHP output into WP: how to do it, parse_request almost works but not quite
I'm new to wordpress, so chances are I'm missing something pretty basic here.
I'm trying to write a plugin which uses custom PHP code to generate output. I managed to get this working on the ...
0
votes
1answer
71 views
Where should I hook into admin?
Where should I hook into the admin backend to check and see if the user is "active" as defined by the Membership Plugin.
Or in other words, where can I hook into the WP admin header to check an ...
