Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
1answer
748 views

contact form 7 :create shortcode usable in email message [closed]

i have this (test ) function that adds a redirection bouton function bouton($atts, $content = null) { extract(shortcode_atts(array( 'lien' => '#', 'couleur' ...
0
votes
1answer
116 views

How to conditionally add a widget via a hook in functions.php

I'm trying to add some widget areas to the homepage only using functions.php - so that the client won't be able to accidentally destroy shortcode when editing the page. I've registered the widget ...
0
votes
1answer
137 views

An action hook where a comment meta is updated

By analogy to the hook on post meta update, I use the following code for hooking when comment meta value is updated. My comment meta key is "consider" and can have 2 values: 0 and 1. My Goal is to ...
0
votes
1answer
22 views

Is there a author_update action?

Is there an action you can tie into whenever an authors information is updated. (ie they update their display name). If not is there any way to tie into this?
0
votes
1answer
79 views

an action hook when a post reaches a certain number of views

I am using WP Post Views plugin to display the post number of views. I use: <?php if(function_exists('the_views')) { the_views(); } ?> I am creating a badge system for my wordpress site. My ...
0
votes
4answers
1k views

Theme Customizer not loading JS for live preview

I am currently working on adding options to the theme customizer. For the last two hours I have been trying to get the live preview working and I am trying figure out why my theme isn't loading the ...
0
votes
1answer
487 views

Catch and display error on save_post action

I wrote this function that adds data to an external db every time a custom post called 'event' is created. How can I prevent the save from happening if this function returns an error? At the moment, ...
0
votes
1answer
158 views

Hooking in to an archive page?

I'm making a custom post type that I want to use in the form of a plugin - all pretty straight forward. However, I want the archive page for this post type to look slightly different in the content ...
0
votes
1answer
362 views

Alternative to new_to_publish Hook for Custom Statuses

I am looking for the right hook to use for sending out an email notice when a post is inserted. However, I am using custom statuses (in this case 'holding') which doesn't seem to get hit with the ...
0
votes
1answer
332 views

Restrict certain actions to plugin-specific admin menu pages only

I'm working on a plugin and want to restrict some things to my plugin-specific admin menu pages only. Therefore, I write the slugs being returned when adding (sub)menu pages into an array so I can ...
0
votes
1answer
371 views

How to modify post content?

I still haven't figured this out yet. Is this the right way? I tried $_POST['content'] = "nothing" and $_POST['content'] = 0 neither work for me. I'm using following way function changeContent() { ...
0
votes
2answers
124 views

Action hook to control access to certain parts of my site

I'm searching for an action hook which I can use to control access to certain parts of my Wordpress site. I want to write some custom PHP which will check certain user attributes and decide if they ...
0
votes
1answer
252 views

Removing Submenu from Menu

Thesis appears to automatically add the sub-menus (sub-menu ul) to menu parents if childs exists. I have a specific need to remove this html from a particular menu. The menu name is: second_level ...
0
votes
1answer
277 views

Bloginfo hook - can it be more precise?

From the codex, regarding filter hooks: bloginfo_url applied to the the output of bloginfo("url"), bloginfo("directory") and bloginfo("home") before returning the information. Is there a way I ...
0
votes
1answer
967 views

Admin post list - adding an option to the date filter dropdown

I've been asked if I can add an option for "Today" and "Yesterday" to the date filter dropdown at the top of the post list in the WordPress admin view. (This is the list that shows recent ...
0
votes
3answers
107 views

Need to return shortcode text instead of the output

Is there a way I can return the shortcode text instead of the output. My code function is hooked into 'the_content' and I know if my function contain shortcode it will automatically generate the ...
0
votes
2answers
286 views

How to prevent double execution of do_action statements

Is there any way to prevent double execution of do_action statements? For example, I have the following lines: do_action('myhook1', 'myfunction1'); do_action('myhook2', 'myfunction2'); ...
0
votes
1answer
313 views

How to place a div inside a function that creates a div

I am wondering how instead of having the menuTab div come after the bones_main_nav function html code that is outputted to have it injected inside of it I suppose. I have the following function // ...
0
votes
1answer
253 views

Thickbox 'tb_unload' function being called twice

When closing the Thickbox (by clicking on the cross), I am invoking the following function, by hooking it to the tb_unload action. However, the action is being called twice for some reason, and I ...
0
votes
1answer
146 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 ...
0
votes
1answer
90 views

What's the hook for filtering every texts of site?

I'm developing a plugin to replace a character that google doesn't show it with an accepted character. I want to get all the texts that wordpress returns (content, comments, title, names, etc.) but I ...
0
votes
1answer
118 views

What hook is used to display the admin_bar on the front end?

Or, how is the admin_bar displayed at all? I'm looking to display a similarly styled menu, but for all users who visit.
0
votes
2answers
582 views

Put code into body tags near top, using a plugin

How do I use a plugin to put this inside the body of every page on my WP site, for facebook integration. (Yes, I know other plugins can do it, but I want to do it myself.) Facebook recommends as close ...
0
votes
1answer
133 views

manipulate a plugins shortcode

I want to add some javascript directly below content, added by another plugin's shortcode. We are using the NextGen Gallery plugin and there are many articles containing the [nggallery] shortcode. I ...
0
votes
1answer
331 views

When is the {$new_status}_{$post->post_type} transition hook fired?

Is it fired after a post has been published? Say I have a CPT and want to perform some automated actions based on the post that gets saved, can I do: add_action('publish_myt_cpt', ...
0
votes
1answer
418 views

What filter or action hook to use in order to load some code before the template begins printing in BuddyPress? [closed]

I would like to load some code before the template begins printing in BuddyPress. What filter or action hook should I use? I tried a number of them (such as bp_head, bp_include, bp_init), but none of ...
0
votes
1answer
182 views

Modify message displayed on post save

After a post is updated there is a message displayed, how can I change the displayed text? I would like to remove the "view post" link and change the 'Post published' text. I'd like to do this for a ...
0
votes
3answers
154 views

About Hooks and Filters

Well, am having a very hard time understanding the difference between Actions and Filters. I do use actions in my code, but am a rookie and I don't know even a slightest bit of Filters. I have been ...
0
votes
2answers
2k views

How to hook into Add New Member in BuddyPress

I have a hook into the WordPress Add New User process via an add_action('user_register', 'doMyFunction'); hook. What results is that I am (Step 1) adding a new user through WordPress and then (Step ...
0
votes
1answer
537 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
355 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 ...
0
votes
1answer
824 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: ...
0
votes
1answer
292 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
129 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 ...
0
votes
1answer
351 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 ...
0
votes
1answer
87 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 ...
0
votes
2answers
244 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
1k 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
98 views

Distinguish between different widgets of the same type

I'm playing a little with wordpress widgets and I trying to do something like this: I created a sidebar and a widget to display a slider with latest posts. The jQuery loader is something like this: ...
0
votes
2answers
857 views

Where exactly does the edit_{taxonomy} hook fire?

I'm at my wits end. I'm beginning a project that may involve using an action hook in WP that is not well-documented: edit_{$taxonomy} I'm trying to determine exactly when this hook runs, so I just ...
0
votes
2answers
737 views

modify URL with mod_rewrite or hook

i'm trying to achieve the following: user enters this URL into browser http://mydomain.com/boston/categoryname/postname/ i then want to get the first "folder" and check whether or not it's ...
0
votes
1answer
220 views

Replacing a placeholder term with a session variable value in taxonomy filter

I have in my themes some code which will set a session variable. For the sake of example, it's a geolocation routine which will set to either USA, UK or ROW, resulting in: $_SESSION['region'] = ...
0
votes
1answer
379 views

Modify posts listing at back end

I want to modify posts listing at back end? Say, for a particular user, with role author, O want to list only few posts at posts listing. How can I do this?
0
votes
1answer
113 views

Change status of page after an event (Looking for best practice advice)

I'm looking for a best practice/ideas for modifying the status/data of a page after an event. Here's an example of what I'm trying to accomplish - This WordPress site would allow users to sponsor ...
0
votes
1answer
954 views

Hook for page Request?

I want to run a function that looks at the current url params of the page that is requested and sets a cookie based on those params. So, I guess I'm looking for: The Wordpress Hook that allows me ...
0
votes
1answer
2k views

wp_insert_post hook for a wordpress plugin

I'm trying to make a wordpress plugin to auto-translate posts just before it's inserted, it's for a specific need where I want to write in a language, post in a different one, so far, I'm not able to ...
0
votes
1answer
3k views

How to automatically activate users after registration without activation email?

I want to auto-login my users after signup without an activation email requirement (I'm not concerned about spammers). How might I go about doing this? Thanks!
0
votes
1answer
404 views

Creating a plugin that will display text on every page

I know there is going to be an easy way to do this but I just can't seem to find the best practice for the following; I have a plugin which when complete should generate HTML on every page, I want it ...
0
votes
1answer
373 views

Filter for replacing the WP_query object for a given category

I'm looking for a action/filter to replace replace a category archive page with the contents of a page. I'm thinking of testing the category ID, and replacing the WP_Query object with a new one ...
0
votes
1answer
4k views

Help me to understand wp_header() and wp_footer() functions

hi everyone please help me to understand the hook functions wp_header() and wp_footer() What does it mean hook functions and what to do