Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

1
vote
1answer
300 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 ...
0
votes
1answer
13 views

Force HTTPS 301 redirect with hook

I am trying to force a 301 https redirect with hooking into the 'template redirect' function. I want not doing it a htaccess because when I update my permalinks, htaccess with https redirect ...
0
votes
1answer
18 views

Custom Meta fields Update hook?

HI Is there any hook available that we can add it into functions.php and fire only when "Custom meta fields gets edited" ? I really need this . If anyone with the knowledge , please help me. Till ...
0
votes
1answer
26 views

Neccessary to call add_submenu_page and add_menu_page from admin_menu hook?

From the fm: NOTE: If you're running into the "You do not have sufficient permissions to access this page." message in a wp_die() screen, then you've hooked too early. The hook you should use is ...
0
votes
1answer
21 views

Pass A Value From Outside To A Plugin Variable

Is there a way to pass a custom variable value from outside like from functions.php to a plugin's variable? Lets say that I have the following function defined in a plugin. function plugin_funct(){ ...
0
votes
1answer
37 views

Creating customized php files in theme folder

I am developing a e-commerce theme that requires an order page. I created a php file inside my theme folder named order-page.php and hope to access this page from the wordpress root url ...
0
votes
1answer
22 views

Add custom message to the plugins page of Wordpress

I'd like to add a banner at the top of the plugins page (where you update plugins) that reads "Please do not update plugins". I know I can use the admin_notices hook to attach the message, but how do ...
0
votes
1answer
76 views

change attachment custom field onChange event

The form is in post creating window. Ajax is posting values, but the values doenst renews. Where can be problem ? Ajax <script> function dynamic_Select(field, aid, value) { ...
0
votes
1answer
41 views

Add Different Actions To Different Page's wp_footer

I am trying to add functions to wp_footer based on the the page id. I am hooking my callback to init, but its not working. Here is what I am using. function fl_template_loader() { if ( is_page( ...
0
votes
1answer
37 views

Plugin Hook: Get posts

I am building a WP plugin. It shows several featured post images with titles atop. It will have a spot on the admin bar to tell it what the featured posts are. What hook do I use to get the post's ...
0
votes
1answer
62 views

Add_menu_page() error message -> “You do not have sufficient permissions to access this page”

I'm currently building a website for a friend and have assigned him the user role of editor. I don't want to give him an administrator role in case he breaks the layout. Anyway, I am using ...
0
votes
1answer
165 views

get_post_meta not working inside a function in functions.php but works outside

function notify_new_posts($post_id) { $keyval = get_post_meta( $post_id); $buyer_wdistance = get_post_meta( $post_id, 'cf_wdrive'); //$buyer_wdistance = $keyval['cf_wdrive'][0]; ...
0
votes
1answer
49 views

Retrieving post ID from current page

I am following the tutorial here. Wordpress Ajax is a bit complicated but this tutorial helped me out a bit. The only question I have is, when I view any page, I want to be able to get the current ...
0
votes
1answer
271 views

Ajax +wordpress onClick link redirect to new page and create html content

i have two pages in my wordpress plugin index.php charts.php in index.php i have some content and some link.. <a onclick="show_trend()" >Trend</a> while clicking this link ,i have ...
0
votes
1answer
61 views

Dynamically Generate Functions and Hooks

I'm trying to find if it's possible to dynamically generate functions and hooks. All functions do the same thing, and all hooks are essentially the same. Here's an example of a hook/function combo: ...
0
votes
1answer
102 views

How to get menu location in wp_update_nav_menu hook

I want to get the menu location in the wp_update_nav_menu (during menu save action) add_action('wp_update_nav_menu', function ($id, $data = NULL) { error_log( var_export($data, true) ); ...
0
votes
1answer
336 views

wp_trash_post action hook with custom post type

When a 'contact' cpt post is trashed, i need a metakey from another cpt 'act' to be deleted, i have been searching all over which hook i should use but unfortunatly the codex action reference page is ...
0
votes
1answer
50 views

When is get_currentuserinfo() needed?

I know you usually call it inside functions after global $current_user, but sometimes it works whether you have it or not. So what are the conditions where is it needed? Sample code: function ...
0
votes
1answer
63 views

change output location of plugin function using a custom hook

I'm running the YouTube Video Fetcher plugin and it fetches youtube videos and displays it on your website. However, instead of displaying the video after the post, I want to hook the code into a ...
0
votes
1answer
128 views

What is the use of wp_schedule_event hook?

I want to do a cron(executes function at specific time, like email,db backup etc) job. I searched in wordpress, i got this wp_schedule_event Here they say it will execute job when someone visits ...
0
votes
1answer
148 views

How can I add a Custom Button to Add or Edit post / page next to Add Media?

I'm trying to add a custom button nearby the Add media on the wordpress Add and Edit Post/Page. How can I do that? Thank you very much for your help!
0
votes
1answer
63 views

password_reset hook is not working

I am developing a plugin where a MySQL user is created with username same as WP-username and password is entered by user using form . Now If the user resets its password in WordPress then the same ...
0
votes
1answer
75 views

save_post not working

In order to create (or update, whenever a post is updated) a unix-timestamp meta, I used following code to fire on save_post. I pasted this code in functions.php. But I believe this is not working, ...
0
votes
1answer
57 views

How do I remove an action hook by s2member

I noticed that my plugin doesnt work when s2member is activated but unfortunately it is needed for the site functionality, i did some research if I comment out this line on hooks.inc.php then my ...
0
votes
1answer
48 views

Which hook should I use for this scenario regarding the registration process and account/profile update?

I would like to run a PHP script "ONLY" when a user successfully fills out the WordPress Registration form and submits it as well as when a user updates their profile. Here's what I have so far, ...
0
votes
1answer
104 views

WPMU Hook for archive or deactivate blog?

I am trying to automatically clear the blog's cache when it is Archived (or Deactivated is fine) in a Multisite install. This is useful for anyone using a caching program like WP Super Cache as an ...
0
votes
1answer
84 views

can't access dashboard and showing forbidden page

i cant access my dashboard. after i make true the wp-debug it shows the following error. Notice: wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued ...
0
votes
1answer
81 views

Best hook for a function which adds shortcodes to the system?

I have a plugin released, and one of my customers was reporting a problem where the plugin was outputting ads in the header area of their website. I have a function defined which contains my ...
0
votes
1answer
215 views

Add content after get_header

I'd like to add content directly after the div#main (end of header.php) and before /div#main (beginning of footer.php). I'm using an own child-template (of twentythirteen), that contains only ...
0
votes
1answer
255 views

save_post not working with attachments

I've made a Meta Box for Posts and Pages, and while testing added Attachments too. But, curiously, the hook save_post does not fire. $cpts = apply_filters( 'my_filter', array( 'post', 'page' ) ); // ...
0
votes
1answer
55 views

Change event firing in wordpress

I have to run a function when a post is published. The function checks a custom meta value and works accordingly. I am using couple of hooks for this purpose: new_to_publish draft_to_publish ...
0
votes
1answer
56 views

Getting all post/page IDs related to a soon-to-be-deleted tag/cat

When deleting a tag, category or other term I would like to get the IDs of the posts that are related to the term before deletion. Wordpress uses wp_delete_term, which is found in taxonomy.php, to ...
0
votes
1answer
404 views

Insert new user with form submit 'init' hook

I'm posting a form to insert a new user and hooking my function to 'init'. This code is in my mu-plugins folder. The user gets inserted fine, but the page is not loaded after wards. My form action ...
0
votes
1answer
109 views

Hooking get_posts()

On a site this is a plugin that uses get_posts() to make a list of pages. The list is used to create a list of pages and create next page and previous page links. ( ...
0
votes
1answer
704 views

using wp_footer hook in a plugin

I'm using the wp_footer hook into the plugin and it doesn't work, but when I copy the code to the "functions.php" file of the active theme it does work, what is the possible problem in this situation ...
0
votes
1answer
87 views

What filter or action to replace comments or add new comment system

I am looking to make a plugin for my site, which either replaces the current comments in a post or adds an additional comment system. I am getting the comments from a custom RSS feed from my forum ...
0
votes
1answer
569 views

List posts based on First letter of Posts

I want add a Pagination [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] .......[Z] Easy Post Title - By Admin on 2013 post content....bla bla bla... Example Post - Another Test ...
0
votes
1answer
37 views

How to make plugin work in each template in wordpress

I am new to plugin development .I want to get all images of a particular page/post and want to show them as slideshow below the page ..Currently i am able to gather all images in media library and ...
0
votes
1answer
57 views

Which hooks are essential for post templates?

Im in the process of building a very custom theme and Im beginning to work on the post templates, but I dont know which hooks are essential for them. So like, I've seen (but cant remember where)some ...
0
votes
1answer
35 views

Meta boxes not showing up

Okay so I'm trying to render a meta box. This is what I have so far, trying to keep it as basic as possible: add_action('load-post.php', 'ad_templates_callback' ); add_action('load-post-new.php', ...
0
votes
1answer
218 views

Incorrect data after modifying post using backlink from wp_die

I have hook: function myHook( $post_ID, $post ) { $data = get_post_meta($post_ID, 'data', true); if ($data) { _log('data:' . $data); /* here some checks and validation */ ...
0
votes
1answer
108 views

How do I replace title with my plugin?

I am developing a plugin for WordPress 3.5. My blog's default title is "Test". Here is some code of my plugin: add_filter('wp_title', 'my_replace_title'); function my_replace_title(){ return ...
0
votes
1answer
80 views

Function is Missing an Action Hook

I have tied an action into a status change, which works on the backend. However,using a frontend button for updating post status does not trigger the ...
0
votes
1answer
117 views

Looking for Hook that is fired after a plugin or wp upgrade is installed/updated

I'm trying to write some code to sms me whenever someone updates/installs a plugin, or updates the WP core, but I can't seem to find a hook that gets fired when this happens. Does anyone know if there ...
0
votes
1answer
287 views

Redirect back to origin page after using get_delete_post_link()

I need to implement frontend and backend redirection after delete specific post using get_delete_post_link(). Which hook i can use? Any advice would be appreciated. Something similar to : <?php ...
0
votes
1answer
330 views

Create action running on trashed_post hook to modify post_meta value

I have a custom post type that always do math operation to its post_meta and other custom post type post_meta. For example: post-type 1 = cpt_product_order post-type 1 post_meta = ...
0
votes
1answer
70 views

Checking url from plugin

I'm trying to change the login url from wp-login.php to simply 'login'. I'd been looking through another plugins source to find ways of doing it. Some of the applicable parts that I've got so far: ...
-1
votes
1answer
69 views

How can I get the term_id from the action hook 'set_object_terms'?

I have the following code and I want to use the term_id inside that function. I aware that the variable $terms contains the term; however, I do not know how to get the term id from it. ...
-1
votes
1answer
210 views

How to hook wp_mail to add a custom email as BCC for each sent email?

Is there a way to hook into the wp_mail function to add a custom email as hidden (BCC) copy to each email sent? If so, how? -edit- It's not like I want to send an email with BCC, I would like to ...
-2
votes
1answer
88 views

How to place plugin hook in a wordpress template

In many WordPress plugins, there are installation directions to add <?php do_action('plugin_name_hook'); ?> in your theme's templates. Where exactly do I need to place this code and what should ...