Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

1
vote
1answer
68 views

Create hooks based on an array of hook names?

I have this idea where I would create a class that would take in a set of hook names then create them, for me to use when ever, and where ever. Currently the way to create a hook is we do something ...
1
vote
3answers
298 views

How can I filter blog name?

I want to filter the blog's name for Google's user agents. I have tried the_title, the_content, comment_text, single_post_title, wp_title, category_description, bloginfo hooks, but none of them ...
1
vote
1answer
82 views

Conditional hook based on the core function that is calling it

In a Multisite, I'm applying the filter get_blogs_of_user to sort the "My Sites" admin bar menu, where the sites are listed by blogname: What happens is that I'd like another order elsewhere, where ...
1
vote
1answer
448 views

How to delete all post and attachments of a user when I delete it?

When I delete a user, WordPress can just delete the post or page of this user, not his custom post and his attachments. An idea for a special hook? add_action( 'delete_user', 'my_delete_user'); ...
1
vote
1answer
596 views

How to Add Custom CSS to the Media Thickbox?

I've added a couple of custom fields to the Edit Media screen, but when these are displayed in the WP Media Thickbox (when adding images from the Edit Post screen, for example), the styling is gone. ...
1
vote
2answers
309 views

How do I display only the latest post on my home page, while maintaining proper plugin hooks?

What I'm trying to do is display the most recent post (a la my theme's "single.php") on my "home" page. This is complicated by the fact that I have certain plugins (specifically, Scripts n Styles) ...
1
vote
1answer
226 views

Adding option to Gallery shortcode

just starting out in WP dev, and I'm looking for any guidance I can get. What I'd like to do is use a hook or filter to add my own option to the core WP gallery shortcode. I would want it to work just ...
1
vote
1answer
184 views

Strange behaviour with add_{$meta_type}_metadata | add_post_metadata filter

I'm unsuccesfully trying to use the add_{$meta_type}_metadata. This filter is called inside add_metadata function (wp-includes/meta.php:31 in Wordpress 3.4.2). In particular I wanna hook ...
1
vote
1answer
454 views

correct way to call javascript into hook function

function node_wp($post_ID) { global $post; $post_title = get_the_title( $post_ID ); $post_url = get_permalink( $post_ID ); $json = array( 'title_post' => $post_title, ...
1
vote
1answer
224 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 ...
1
vote
1answer
837 views

Wordpress Delete hook with wp_delete_post function?

I have this action/hook: add_action( 'before_delete_post', 'my_delete_function' ); function my_delete_function($post_id) { global $wpdb; $achievement = get_the_category($post_id); $h = ...
1
vote
1answer
246 views

Need to check is_archive during init

I need to check if a page is an archive or not, before my plugin does some URI manipulations. These manipulations only work before wp but if I perform them first and then check is_archive, the check ...
1
vote
1answer
380 views

Pass variable to hook. Its possible?

I have this hook created to retrieve user password when he register or update his pass. I dont want my client to touch wordpress core so i was planning to use a hook in wp-includes/user.php All this ...
1
vote
2answers
352 views

Hooking in to replace the Sidebar/Widget areas

The Goal: To replace the sidebar on all sites across my network with content loaded from a plugin, across all themes. I need a way of over-riding the sidebar/main widget area on all sites across my ...
1
vote
2answers
299 views

How to get all of the activate_plugin action parameters?

I am trying to hook into activate_plugin. I know that activate_plugin has 1 required param and 2 optional ones. I am trying to acquire all 3. Here's my setup: // create plugin settings menu ...
1
vote
2answers
786 views

From what hook on is it possible to conditionally add actions?

I tried to have a siderbar registered at the "init" hook based on a variable from the theme options array indicating whether the sidebar should be used in the design. Now it appears that that the ...
1
vote
1answer
245 views

Executing Arbitrary Code at a Specific URL without Creating a Post or Page?

I am trying to figure out which hooks I can tie into in order to read the incoming URL prior to the query actually being run. A quick look tells me maybe wp_loaded or posts_selection would be good ...
1
vote
2answers
87 views

Modifying the comments section through a plugin regardless of theme

I need to be able to add some data (text/images) to each comment in the comments section through a plugin. What I'm trying to do is actually very similar to the way the stack exchange sites have their ...
1
vote
2answers
39 views

Hook to generate a dynamic sitemap with “All in One SEO Pack” Plugin

Besides the urls of posts, pages and categories, I need my site's sitemap to include the urls of various pages that display data coming from an external source other than the WP database (Rails API). ...
1
vote
0answers
30 views

Move excerpt meta box to above content editor

I found a WordPress hook called "edit_form_after_title" to add a text box after the title. How can I use this hook to display the excerpt after the title while creating a new post?
1
vote
2answers
38 views

How to filter backend post list showing only posts having a shortcode

I need to filter the Posts and Pages tables in the Admin panel by certain shortcodes. In my plugin, I have added a column for shortcodes to the Posts and Pages views that works like the "Categories" ...
1
vote
0answers
47 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: ...
1
vote
1answer
49 views

Filtering the post list in the admin area

How can I filter my custom post type like it's filtered by WordPress itself? By that I mean the links that allow you to show only published, private or trashed posts. I need it because I want to ...
1
vote
1answer
32 views

When does a function assigned to the content_filtered_edit_pre filter hook fire?

I added a function to the filter hook tag 'content_filtered_edit_pre', but it doesn't seem to fire no matter what I do. I am also aware of 'content_edit_pre', but I am curious as to when this filter ...
1
vote
0answers
40 views

I have 2 plugins using the same wp_login action hook and one is not working

so this is after a few hours investigating, I have s2member plugin and a custom plugin what happens is they are both using wp_login hook in this manner, s2member: add_action("wp_login", ...
1
vote
3answers
107 views

Hook Widget to Woo Theme in functions.php

Right now I am adding a sidebar above my woocommerce products. How can I hook the sidebar to my theme. Have registered sidebar and it works. register_sidebar( array( 'name' ...
1
vote
0answers
44 views

Add custom text in the media library image meta area

I want to add some custom text in this area in the media library: Is there a filter I could hook into or how can I add content there? If not, how do we do this using Javascript? I want the text to ...
1
vote
1answer
59 views

How can I find the hook I need to rewrite a function?

I want to change the behavior of a bbpress/Buddypress "create group" page. I found the function I need to rewrite, it's the function create_screen in ...
1
vote
1answer
88 views

Lock user information once fields have been filled in

Much like the username is locked down and cannot be changed once it has been registered, I would like to lock down additional fields I have created with Advanced Custom Fields like the person's ...
1
vote
1answer
90 views

Add Lightbox To WordPress Native Gallery

Is there a way to check if a gallery is linked to an attachment page or to an image file via jQuery or WP filter? I'm trying to add a lightbox to gallery image that is linked to image file. But I ...
1
vote
1answer
184 views

Which hooks is this? add_action('wp',

I have seen it here http://codex.wordpress.org/Function_Reference/wp_schedule_event code snippet: add_action( 'wp', 'prefix_setup_schedule' ); I couldn't find this hook anywhere in documentation, ...
1
vote
0answers
52 views

Issue understanding and using WordPress filters and actions

I have a custom WordPress plugin that I have developed. The plugin is a widget bundle containing a bunch of custom widgets. The scenerio The plugin allows for custom css styles through creating a ...
1
vote
1answer
331 views

“save_post” hook not triggered in WP 3.6.1

I developed a plugin having a custom metabox that is using the "save_post" hook to store data. The plugin is old 18 months and is used by thousands of customers, so I'm pretty sure everything is good. ...
1
vote
1answer
1k views

Custom Blog Post Listing in Genesis Sample Child Theme

I want to add several images and divs and also customize the look of my Blog post listing... But i can't find the way to do it. Here's the Blog Template code <?php /* WARNING: This file is ...
1
vote
1answer
136 views

How can I replace an oEmbed URL in post with actual embed HTML

What I want is to get the output of the Twitter oEmbed system into my actual posts. IMHO the embed output itself is high-quality, semantic HTML and I'd rather have it inside the post than in the embed ...
1
vote
1answer
41 views

read more, even if excerpt not trimmed

I am using the excerpt field (Not the tag, because the excerpt also serves as a lead paragraph). I altered the "more"-link to be an arrow >. function fabs_excerpt_more( $more ) { return ' <a ...
1
vote
1answer
100 views

Hide content editor for posts after approriate date

I am tuning my new site and i what to disable Content Editor for post created after date X, but for posts that created before that date Content Editor must be on its place.
1
vote
0answers
76 views

Show message in media-new.php

I'm wondering if there's a way to show a specific message when user uploads a file using the wp-admin/media-new.php script. So far I have this: function my_uploads_notice(){ global $pagenow; ...
1
vote
1answer
407 views

Empty Super Cache programmatically (with ACF action)

I regularly use Advanced Custom Fields to create awesome backend interfaces for my clients (as I'm sure a lot of us do…). ACF includes an Options add-on that creates one or multiple global options ...
1
vote
2answers
974 views

Include WooCommerce 2's prettyphoto scripts on all site pages

So when WooCommerce updated to version 2 they replaced the fancybox lightbox scripts with prettyphoto. I would like to use this on all my wordpress site's pages, not just the product pages, but the ...
1
vote
0answers
175 views

How to add X number of products to woocommerce cart at once

I am trying to add x number of products input and button to my catalog page so I can select a number, then hit add to cart. Is it possible to add in this function? The user will provide a number ...
1
vote
1answer
56 views

How do wordpress hooks respond to user interaction?

Embarrassingly big hole in my understanding! When I've finished editing a post and click the big blue "Update" button, what happens next? In particular, how does the 'pre-post-update' hook (which, ...
1
vote
0answers
35 views

Hooks are not being removed in child theme

I have a hook file: function load_admin_package(){ do_action('load_admin_package'); } /* * ----------------------------------- * Define hooks bellow * ----------------------------------- */ ...
1
vote
1answer
474 views

How can I hook into creating a new post and execute wp_die(), before the post is inserted into the database?

Info about wp_die from codex: Kill WordPress execution and display HTML message with error message. A call to this function complements the die() PHP function. The difference is that HTML will be ...
1
vote
0answers
225 views

get_query_var() not working in pre_get_posts

I'm using the pre_get_posts hook to order the main query on all my custom post type / taxonomy pages using a custom meta value. As part of the logic, I am trying to determine which taxonomy is ...
1
vote
1answer
179 views

Implement Hooks Using Array

I'm trying to implement some hooks into a theme, but rather than write out every hook with repetitive code I was wondering if I could use and array to declare the hooks instead. E.g. ordinarily i'd ...
1
vote
2answers
47 views

Adding a form at the end of the content

I'm trying to add a little form after each post for a plugin I have to code, but I'm not very familiar with Wordpress. By using add_action with the_content as hook, I was able to add some text to the ...
1
vote
0answers
28 views

How to hook into unregistering a widget instance?

I would like to hook into a widget instance after it is removed from a sidebar panel on the Appearances -> Widgets admin page. So if the instance was an active widget and then removed, I would like ...
1
vote
0answers
91 views

Firing a function AFTER redirect

I am using a function that redirects the user to a custom page, rather than wp-login in the event of errors. In my case I am using the Http Referer function to send the user back to the same page ...
1
vote
0answers
72 views

Copy post to separate database with “add_action(…)”

I'm basically trying to have a copy of a post be sent to another database's table when it's published. I've gotten it to add a new row in the new table, with my own static arguments, but I'm not sure ...