Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

2
votes
2answers
358 views

Run javascript code after wp_login hook?

after using the wp_login hook, is it possible to add a snippet of javascript code to the page seen immediately after the login in wordpress? I want to use this top implement a notification system ...
2
votes
1answer
62 views

Hooks for Links Box [duplicate]

Possible Duplicate: Getting archive pages in WP's AJAX internal link finder? Are there any hooks for the new internal links box that was created in WP 3.1? I'm trying to modify it in my ...
2
votes
3answers
732 views

Is there a hook for user activation (after they click the email confirm)?

Is there a hook for user activation (after they click the email confirm)? I am creating a plugin to automatically add them to my email software, but I want them to have to confirm their email first.
1
vote
3answers
565 views

How many times can I hook into the same action?

I have a theme which includes some setup, using after_setup_theme but I'd like to write my own functions which also need to run after_setup_theme. I'd prefer to keep my stuff in a separate file. Can I ...
1
vote
3answers
420 views

Insert all post IDs in new database table

I have a plugin which creates a new database table. Upon activating the plugin is there a way to insert all my posts ids into that table? Right now I'm using an action hook to immediately insert the ...
1
vote
2answers
910 views

Trouble understanding apply_filters()

In apply_filters() apply_filters( $tag, $value, $var ... ); I'm having trouble wrapping my head around the $value and $var. I read the codex and it sounds like the $value can be modified, $var not, ...
1
vote
2answers
1k views

Why isn't is_home() working correctly?

I put a if(is_home()) bit in my theme's functions.php and it doesn't seem to work. The function containing this bit is called on init so is_home should work already.
1
vote
3answers
96 views

When to use actions and when to use filters

I'm trying to understand where to use filters and where to use actions. Suppose I have a query in a plugin, which later add on modules might modify to change the results of the query, thus modifying ...
1
vote
1answer
2k views

WordPress Hook for user register

how can I tell WordPress, that if a user registers, it shall execute my function?
1
vote
3answers
511 views

Why doesn't wp_enqueue_script() work when including a JavaScript file with TEMPLATEPATH?

I am trying to use tips from here to add my JS file. I put the following in the functions.php of atahualpa theme I've got installed function lektor_init() { if (true) { ...
1
vote
3answers
160 views

How and where can we request new WordPress hooks to be added?

I use the great Changelogger plugin, which adds plugin version history to the plugins page when there is an update. Although I would like it to, it doesn't work from the updates page where you can ...
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.
1
vote
2answers
92 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 ...
1
vote
3answers
370 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 ...
1
vote
2answers
1k views

What hook should be used to programmatically create a post only when master post is updated?

Pippin and Jean-Baptiste Jung have very good tutorials on how to programmatically create content when a new post is published using these four actions hooks... publish{post_type} ...
1
vote
1answer
937 views

Execute function when post is published

I try to use this function i have created when a post is published for the first time. function a_new_post($post){ $post_id = $post->ID; if ( !get_post_meta( $post_id, 'firstpublish', $single ...
1
vote
1answer
152 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 ...
1
vote
1answer
1k views

Why is save_post hook not running?

I am trying to save my meta box, I have something like function xxx_meta_box_callback() { add_meta_box('xxx-meta', 'xxx Details', 'xxx_meta_box', 'xxx-post-type', 'side', 'default'); ...
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 ...
1
vote
1answer
82 views

What does (10, 2) mean when used with add_filter

Please tell my what is 10, 2 in below mention code: add_filter('nav_menu_css_class', 'add_active_class', 10, 2 ); function add_active_class($classes, $item) { if($item->menu_item_parent == 0 ...
1
vote
2answers
95 views

Failed to invoke other hook from the init hook

Related to this question (Use wp init hook to call other hooks?) but not the same. Sometimes, I found that the hook will failed to run when I place inside the init hook, e.g. Not Work: ...
1
vote
3answers
493 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
2answers
58 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.
1
vote
2answers
242 views

wp_mail - Remove sitename from email subject

Can some one tell me how to remove site name from email subject. As of now my email subject looks like this [sitename] - Subject goes here I want it to look like this Subject goes here I ...
1
vote
3answers
640 views

How to inject content after <body>

I would like to inject some elements directly after the <body> tag. Is that possible using only WordPress hooks?
1
vote
1answer
802 views

How to use filter hook 'post_updated_messages' in coherence with action hook 'save_post'

I am trying to send out e-mail, SMS and IM notifications to group members of this WordPress website, whenever a WordPress page in their user group has been published/updated. I figured using the ...
1
vote
2answers
378 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 ...
1
vote
2answers
2k views

Hook to get image filename when it is uploaded

I want to get the full local filename of an uploaded image so that I can copy it to a new directory and process it with my own image processing scripts. Which hooks/actions should I look into to ...
1
vote
2answers
84 views

Same Conditionals Not Working on Two Different Hooks

Everyone! I am new to WP and trying to build a plugin. I have the following codes working properly: add_filter('the_content', 'say_hello'); function say_hello($content){ if(is_single() || ...
1
vote
1answer
396 views

Hook up MU site creation

I want to write a plugin so I can hook up the wp_install_defaults function. I actually need to do the following: when a new site is created, I want to import a default XML file with some categories ...
1
vote
2answers
1k views

post meta data clearing on autosave

For starters I am using this GREAT answer to achieve custom post types as well as a custom way to insert those post types into other pages, you can view that answer here: Custom field/meta populated ...
1
vote
3answers
282 views

How to find hooks as per Just-In-Time approach?

How can I follow Just-In-Time approach in hooking up my function to an action? I mean everybody just attach the functions to a very early stage like init which leaves the scope of optimisation. I saw ...
1
vote
3answers
435 views

Good tools for locating hooks in a wordpress page/admin interface/blog post?

I've recently started using the Hikari Hooks plugin for Wordpress as it seems to allow you to get a good idea of what do_actions are being called on the page, so that you can easily find out where ...
1
vote
1answer
470 views

A good way to add a different background image for each page?

I'm working an a Thematic child theme wherein I need to have a unique image decorating each of the site's main pages, from a pre-defined set of permanent images. It would also be ideal to have one of ...
1
vote
3answers
8k views

Remove title attribute from images

I'm looking for a way to remove the title attribute from images, preferably through using a hook or a filter. Most clients don't bother giving images a proper title, thus eliminating the purpose of ...
1
vote
2answers
42 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 ...
1
vote
1answer
64 views

Question about how do wordpress filters/actions work

I have a question that I'm curious. In WordPress we can add a filter or action like this code: add_filter($filter_Name, $function_will_be_hook); add_action($action_Name, $function_will_be_hook); ...
1
vote
1answer
3k views

How to customize woocommerce related products?

I have the following lines of code in my website that will display the related products at the bottom of my single product page in WooCommerce... functions.php: // display upsells and related ...
1
vote
1answer
74 views

Change the footer text on the login page

I am customising the login page and would like to alter the footer text that takes the user back to the website. Ideally and as an example, changing it from the first image, to the second just below: ...
1
vote
3answers
202 views

Filter specific shortcode output?

Is there a hook in WordPress that I can use to filter the output of a specific shortcode? Something like this: add_filter('shortcode_output', 'my_filter_function', 2); function my_filter_function ( ...
1
vote
2answers
173 views

How to update WordPress core or themes and still have my child theme hooks work

I made a child theme based on the WordPress twentytwelve theme (i.e., the WordPress 'twentytwelve' theme is its parent). Some of the modification were done very simply by overriding style, using my ...
1
vote
2answers
24 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
vote
1answer
254 views

the_posts hook, which set of posts?

I want to modify search results. Currently I hook to the_posts and check wp_query->is_search to determine if I am looking at the search results page. However, I noticed that the_posts is executed ...
1
vote
2answers
159 views

Creating a function that receives the taxonomy terms that have been changed in a custom post type

Ive been looking into actions and hooks etc... from wordpress, but cant seem to do a very simple thing. I just want to execute a function whenever a post is updated, and within the function I want the ...
1
vote
1answer
56 views

How to check if upload window came from the featured image link?

I need to verify if the media-upload screen came from a click on the "feature image link" on the admin screen. How can i do it? I've already change the way the uploader works , but I need to check ...
1
vote
1answer
106 views

How to Remove the “Restore” Link in Quick Edit?

I want to know is there any hook to remove the Restore link in the edit page - trash page? /wp-admin/edit.php?post_status=trash I know I can hide it with a css/jquery trick, but I prefer to use a ...
1
vote
1answer
38 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
2answers
1k views

Adding custom text in items titles from wp_nav_menu()

I need to add something after each title of a specific menu called by wp_nav_menu() I tried add_filter('wp_nav_title', 'testing_stuff'); with function testing_stuff() { $item->title = ...
1
vote
2answers
150 views

how to determine how many and what kind of arguments are passed to hooks

I am not able to understand a very logic behind add_action / add_filter Consider following example: function SearchFilter($query) { if ($query->is_search) { $query->set('post_type', ...
1
vote
1answer
644 views

functions.php conditional tag - only show in single.php?

//Geo Map add_action( 'woo_post_inside_after', 'my_geo_mashup' ); function my_geo_mashup() { global $post; if ( in_category('listings') ) { echo GeoMashup::map(); } } Works to ...