Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

1
vote
1answer
133 views

Checking post format during xmlrpc_publish_post

WordPress apparently stores post format information outside of the $post object. During publish_post this isn't (usually) a problem because you can check on formats via get_post_format( $post->ID ) ...
1
vote
2answers
154 views

Strict tag list - user should choose only existing tags for posts

While selecting tags for the posts the user is able to create new tags on fly. For example we have the tag 'animal' but the user misstpye it as 'aminal' - and Wordpress creates it. In our blog the ...
1
vote
1answer
680 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
1answer
518 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 ...
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 ...
1
vote
1answer
120 views

Showing Notifications While Activating Plugin

I want to give errors like this, while activating my plugin. Which hooks should i use ? Can you share simple examples ? In shortly,when user activate my plugin, is a directory's CHMOD isn't 777 , ...
1
vote
1answer
3k views

Changing “Lost Password Email Link” to custom password reset page

On the Wordpress site I am working on, subscribers will not be allowed to see anything in the backend at all. Because of that I am creating a custom pages for the Wordpress login page that subscribers ...
1
vote
3answers
542 views

Two-step login process - Is it possible?

Is it possible to do the following with Wordpress (without hacking too much code - I would like to make this a general plugin using simple hooks)? Log in with the username/password. If ...
1
vote
1answer
388 views

Hook any php file into the wordpress api

Say I just have a dumb .php file sitting on my WP server and I wanted it to access WP info through the API, how would I go about doing that? For example if I wanted to call bloginfo('url'); As I ...
1
vote
1answer
470 views

Event Calendar using insert_post_data after save_post and insert_post after post_transition draft_to_schedule

OK, I'm taking on the dreaded task of developing an event calendar for my site and have gotten a bit stuck. I'm open to any and all ideas but here's what I'm doing and what I'd like to do. I'm ...
1
vote
1answer
30 views

Wordpress capabilities and restricted categories access

I've a Wordpress blog to share content with some people only. Users has to login to access this website. I created new roles and new capabilities on this blog. I've got some articles which belongs ...
1
vote
1answer
58 views

Plugin activation hook in an abstract class

I would like to create a common abstract class to use for every WordPress plugin that I develop. As a part of the class' initiation process, I would like to fire the activation hook which calls an ...
1
vote
1answer
229 views

Remove “Get Shortlink” button in admin of custom post type

I want to remove completely this section under my title in my custom post type. (I don't need this because I use this only for content management). With this piece of code I can remove the ...
1
vote
1answer
75 views

Injecting a custom sql query into a page/theme

I have written a custom sql query for our WordPress website (fairly elaborate and not achievable with the standard wordpress code) and I've got it to run via $pageposts = $wpdb->get_results($query, ...
1
vote
2answers
434 views

Update meta values with AJAX

I am working on a voting system in Wordpress. I first made it with GET requests but someone told me you should not use GET for this, So I started working with AJAX to update custom fields/meta values, ...
1
vote
1answer
55 views

Posts are duplicating on wp_post_update

I have stucked in writing a simple function that on certain page update refresh all posts in a custom post type. Here is my code (based on this): add_action('save_post', 'bulk_refresh'); function ...
1
vote
1answer
112 views

new_to_publish fires multiple times

i have been trying to use draft_to_publish & new_to_publish to create an update when ever a post of a specific type (cpt) is published... it works but published 600+ times instead of one time! ...
1
vote
1answer
676 views

Problem only while using require_once() within functions.php

I use add_theme_page() within my child theme's functions.php implemented something like this... // other functions located here that create a custom options page in the Dashboard. // THIS IS NOT A ...
1
vote
2answers
240 views

Hook for post permalink update

I would like to know what hook should I used when the permalink/url of a post is modified. My goal is to get the old permalink and new permalink so I can used it for my plugin. Thanks. [EDIT] Just ...
1
vote
2answers
220 views

how to limit edit_form_after_title hook to page and post edit only?

heelo, I want to use this great hook edit_form_after_title it was announced on December 1, 2012: http://make.wordpress.org/core/2012/12/01/more-hooks-on-the-edit-screen/ it curreclty hook for : ...
1
vote
1answer
114 views

What filter should I use to insert a button inside on Media>Add New

I am adding a new way to upload a media file to WordPress. So I am looking for a way to add a link or a button to the Upload New Media page. What is the recommended filter? Or is there another better ...
1
vote
1answer
75 views

How to hook some Unicode texts into calendar widget safely?

I collected a good numerals replacing function for WordPress calendar: function make_bangla_number($str) { $engNumber = array('0','1','2','3','4','5','6','7','8','9'); $bangNumber = ...
1
vote
1answer
41 views

Inserting above the comment template

I want to insert content, just above the comment template.I have tried all the word-press filters and hooks but failed. I want to insert the content above the comment template, I mean above all ...
1
vote
2answers
256 views

Conditionally call add_action depending on post_type?

When building a plugin, I know that you can hook into a function to run some code like add_action('admin_footer', array($this, 'custom_function')); And within that function, test for post_type like ...
1
vote
1answer
170 views

Determine plugin name from within plugin_action_links filter

Is there any way to determine what plugin the plugin_action_links filter is addressing when it processes the filter? I'm trying to add some actions for each plugin on the /wp-admin/plugins.php page. ...
1
vote
2answers
320 views

Passing values from a widget to a function within a plugin

I have a plugin that is built with many widgets. A widget's bundle. Each widget creates it's own custom CSS code. Instead of having messy source code where I display 15 different sets of inline CSS ...
1
vote
1answer
353 views

Post Content, Special Characters and Filters

I added a hook to the_content. add_filter('the_content', 'edit_the_content'); function edit_the_content($content){ return $content; } Pretty simple right? However, when it output $content from ...
1
vote
1answer
127 views

admin_notices after register_uninstall / deactivate_hook

I've successfully added admin notices to display on register_activation_hook, and when the plugin updates, but I'm not seeing any way to display admin_notices after the uninstall or deactivation ...
1
vote
2answers
133 views

ajax, right way to do it and make it works?

I'm new to wordpress but have knowledge in php and javascript. I read a lot of blogs about ajax call in wordpress. I also read some posts on this forum. However, I still have some difficulties making ...
1
vote
2answers
1k 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
2answers
513 views

gform_after_submission content appears immediately after <body>, not in post body [closed]

I have the following function that successfully uses form fields (IDs 13 and 18) from a Gravity Form (ID 18) as parameters within wp_query. This displays a list of posts with specific taxonomy terms ...
1
vote
2answers
345 views

Hook before inserting user into database

I'm working on airsoft website using woocommerce. One of my client's needs is to prevent a user to register if his name or mail is in a blacklist (I don't know yet if I'll use a csv file, a json or a ...
1
vote
1answer
195 views

Detect type of post status transition

I have a function on my site that it supposed to run when a new post is published (email push notification), with the exception of the same article updated (i.e publish_to_publish transition, I don't ...
1
vote
1answer
595 views

Hooking after get_header()

Does anyone know a good way to hook just after get_header() without hacking the theme? I know you can hook before the function loads header.php but I am trying to insert some HTML just after ...
1
vote
1answer
183 views

How to display a message about updates in the plugin list

I am trying to use the hook in_plugin_update_message in order to display a one line message below the name of my plugin in the admin plugin list section. However, the function called in the hook does ...
1
vote
1answer
87 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
385 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
97 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
504 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
727 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
366 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
269 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
258 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
595 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
357 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
953 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
702 views

Is it possible to Hook/Filters Attachment Creation?

Is it possible to hook or filter the attachment creation process? More specifically is it possible to hook into the attachment creation so that I may parse the attachment’s filename, populate the ...
1
vote
1answer
279 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
429 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
411 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 ...