Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

1
vote
1answer
925 views

How to check if certain plugin exists and in expected version

I've created plugin that goes to wordpress plugin repositories. Now, I need to create another plugin (sub plugin or child plugin you may call) that require this certain plugin to be already installed ...
1
vote
1answer
25 views

How to hook in after user's registration email has been sent?

I want to redirect to a page after the user's registration email has been sent. What is the correct hook? user_register is too early, that is the user is entered into the database but the email ...
1
vote
1answer
67 views

Setcookie works on admin but not front end

I have a simple function to set a cookie to the value of whatever parameter is attached. For example, if I visit http://example.com/?devsource=http://dev.example.com/ it should set the value of the ...
1
vote
1answer
25 views

How to find a callback attached to a bbpress hook?

bbpress has a large number of callbacks attached to various hooks. I am familiar with this feature at the wordpress level but I am unable to locate where bbpress registers a large number of these ...
1
vote
2answers
60 views

How to place HTML below the title of the (custom) post overview

Edit: Yes, I know, I provided an answer to this question myself. However, I'm still interested in other solutions and/or comments on the one I found. Is this how you would do this? Are there any other ...
1
vote
1answer
51 views

Filter or action hook to insert content on admin pages before </body> tag

I am developing an administrator plugin and want to be able to write some HTML content just before the last body tag . This content will initially be hidden then displayed with javascript when a user ...
1
vote
1answer
47 views

Redirect logged in users if they are on a specific page

I'm trying to prevent a user access besides the admin to the registeration page and reset password page if they are already logged in. I have the following: function redirect_loggedin_users() { // ...
1
vote
2answers
455 views

Customize user account activation message

During the process of a user creating a new account, once they click on the link in the activation email, they receive the message on the login page: Your account is now active! Username: ** ...
1
vote
1answer
49 views

Get current page_id before loop, in functions.php

In the Shoestrap theme, you often change content by using hooks. I want to add the following to functions.php but it doesn't work... // in functions.php if ( is_home() ) { add_action( ...
1
vote
1answer
73 views

Should I use function_exists() and/or add_action() in theme development?

I'm trying to get my theme ready for publication on WordPress.org I got this feedback: function_exist() it is not preferable 3.0 design Now I wonder what I'm doing wrong. In the current ...
1
vote
2answers
93 views

How to trigger the core WPLANG to make automatically set a language when the theme is activated? [duplicate]

I'm developing a theme especially for Bānglā blog posting, and it'd be under GNU license. I questioned about a Calendar Widget translation with some problems today, and got a comment saying: I'm ...
1
vote
1answer
131 views

Set template based on query in URL

I want to be able to force WordPress to load an page/post based on a query in the URL. www.mywordpresssite.com/posts/myarticle?template=custom This URL should load the myarticle post using template ...
1
vote
1answer
160 views

How do I successfully create a hook for an email override?

I'm creating an online apartment rental application using Visual Form Builder Pro. I need to have completed forms go to certain managers based on the property selection. Once a user selects a ...
1
vote
2answers
142 views

Add site options UI in Multisite Sites > Infos page

I want to add meta fields for the sites in my network (such as a thumbnail and a category). I know how to do this using get/add/update_site_option, but I'm wondering where I could put the UI to manage ...
1
vote
1answer
258 views

How to remove a metabox from menu editor page?

I am not sure if it is much different for any page but I am wondering how to remove a metabox from the appearance>menu page without having to go into the wordpress core files and remove it. Is there ...
1
vote
1answer
209 views

Better post meta efficiency?

I work with websites which require using Post Meta for Post Objects within a particular Post Type. I often add a Meta Box to a particular Post Type, to provide additional settings for the new Post ...
1
vote
1answer
167 views

Alter image output in content

I'm trying to implement the JAIL javascript into my WordPress install. The javascript requires me to add a data-attribute and change the output html of images. I have been looking through the codex ...
1
vote
1answer
231 views

Count singular post views automatically

I'm trying to add some function to each loop called in the themes. What I'm doing is I add a function to count post view from here post views without plugin, to use the function I need to add this ...
1
vote
1answer
116 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
132 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
540 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
495 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
112 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
1k views

How can I see all the actions attached to an “add_action” hook?

I'm working with the admin bar and trying to debug some of the menus and their priorities. I know several callbacks get bound to actions, such as this one: add_action( 'admin_bar_menu', ...
1
vote
1answer
2k 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
1answer
319 views

How can I tell if I'm on a login page?

There are functions for is_home(), is_blog() is_single() etc... What's the best way to tell if I'm on a page that is requesting that I login? I guess that would just be the wp-login.php page.
1
vote
3answers
492 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
320 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
1k views

hooks & filters and variables

I was updating the codex page example for action hooks, while playing around to get some reuseable functions done (originally for some Q over here @WA). But then i ran into a problem i wasn't aware of ...
1
vote
1answer
460 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
28 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
45 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
27 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
212 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
83 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
79 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
2answers
70 views

remove_action conditionally for Custom Post Type

By default, my theme is showing an author box below my posts. I am using a custom post type, and would like to remove this author box only on this post type. Here is how the theme is calling the ...
1
vote
1answer
54 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
39 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
1answer
87 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
163 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
2answers
144 views

How to pass arguments to add_action() [duplicate]

I declared an action for a single event in Wordpress which accepts an array as an argument: $asins = array(); //I had to declare this since I'm getting a notice of undefined variable if I don't ...
1
vote
1answer
203 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
2answers
115 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
333 views

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

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
214 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
151 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
387 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
145 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 ...