Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
3answers
903 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); ...
12
votes
3answers
2k views

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
225 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
945 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
267 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
115 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
450 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
633 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
832 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
182 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: ...
4
votes
1answer
291 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
2k 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
2k 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
182 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
328 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
412 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
2answers
415 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
79 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
1k 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
663 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
664 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!
24
votes
1answer
5k 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 ...
-1
votes
1answer
1k views

NextGEN Gallery: Adding drop-down menu widget to gallery view without modifying plugin code [closed]

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
229 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
135 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 ...
2
votes
1answer
206 views

Problem using role_has_cap hook

I'm trying to filter a capability check in order to work around the lack of filters to customize the user edit page in the admin area. But I can't seem to add filters to a hook, and I'm sure I'm ...
0
votes
1answer
2k views

add_action hook for publish_post not working

I can't get my function to trigger on post update or save. I've found a couple of other forum posts around with the same problem, but never an answer :( My code is as simple as: function ...
3
votes
3answers
3k views

How to hook wp_list_pages?

How can I hook the wp_list_pages function so that it reads a value of a custom field and displays it instead of displaying the page title?
2
votes
1answer
275 views

Change WordPress RSS link with filter?

In my theme i use add_theme_support( 'automatic-feed-links' ); to enable the rss links. But i want to create an option to use Feedburner for the main rss feed, my problem is that i don't know how i ...
2
votes
1answer
309 views

Post-Registration, post-meta hook?

Is there a hook in WP to access meta data of a user JUST after they have registered and meta data has been added to the database? I was reading to use profile_update, but wouldn't that be invoked ...
0
votes
1answer
93 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: ...
4
votes
2answers
565 views

Is there a hook to put stylesheet and/or JS inside iframes (thickbox or tinyMCE) in admin area

I'm working on my admin area theme and I wanted to make some modifications on the way the thickbox and tinyMCE looks. I could make most of the changes through adding custom stylesheets and JS to my ...
0
votes
1answer
257 views

Why does hook priority affects admin menu permission error?

On this answer, there was this final comment For future readers, Roland's issue was a hook priority issue. Changing priority from 10 to 11 fixed it in his case The answer seems already closed, ...
0
votes
1answer
74 views

Change Title Type

I'd like to change the title field of a post in admin panel. I'd like this field was "textarea" instead of being "input type='text'". Would it be possible through any hook in functions.php? Thanks ...
2
votes
2answers
3k views

How do I “unhook” / de-register jQuery so that it's not called as part of wp_footer();?

I need to "unhook" jQuery from my wp_footer() ... it's being called automatically and I'm looking for something I can add to functions.php which prevents it from being called a second time in the ...
0
votes
2answers
700 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 ...
1
vote
2answers
2k 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 = ...
2
votes
2answers
2k views

How can I remove css from a child theme?

I am using the theme twentyten as a parent theme for my child theme. I have other stylesheets I want to use and so I'm trying to figure out how to wp_deregister_style for the style.css sheet that is ...
1
vote
2answers
1k views

How to get post ID in post_updated action hook?

I want to execute a function, myfunction() [hypothetically named], whenever a page is updated in the admin. The function doesn't do anything to the content that is saved—it just runs an unrelated task ...
0
votes
2answers
573 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 ...
8
votes
2answers
11k views

WordPress hooks/filters insert before content or after title

trying to insert content before the post content in my functions.php - I know how to use the regular wp hooks, but unsure how to insert into other areas. Tried this, but it kills content on any other ...
2
votes
1answer
221 views

How can I customize the upload error message in Wordpress?

After following the guide for How can I prevent uploading bmp image? to remove bmp (and in my case tiff images) from being uploaded, I tested and it is working, but noticed users are now getting the ...
2
votes
3answers
1k 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.
0
votes
1answer
404 views

Filter dashboard custom post listing by user

Did some research, but I was unable to implement it after all. I have a custom post type accessible only by a new role. I want to filter the post type listing so that each user should see only his ...
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 ...
0
votes
1answer
184 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'] = ...
1
vote
2answers
157 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', ...
2
votes
2answers
496 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 ...
12
votes
5answers
3k views

How to include code only on specific pages?

I'm learning about plugins and shortcodes. I noticed that when I activate my plugin its code gets loaded on all of my pages-- even pages that don't have my shortcode. (I don't mean content vs. admin ...