Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

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
2answers
26 views

Dynamically add content to an existing widget area

I have an existing widget area / sidebar. Rather than adding content to it via Appearance ? Widgets in the Dashboard, I want to inject content into the widget area from functions.php. Is there hook ...
3
votes
5answers
7k views

Adding onload to body

I'm currently trying to develop a plugin that will embed a Google Earth Tour into a WP post / page via a shortcode. The issue I am running into is that for the tour to load, I have to add an ...
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
0answers
14 views

How can I use a filter/hook to modify the URL passed in the content of an [embed] shortcode?

If I pass the [embed] shortcode an absolute URL that only includes the path (i.e. it starts with a slash and is hosted on the same server as the page itself), if it's a movie file, it doesn't ...
1
vote
3answers
5k views

How can I edit post data before it is saved?

I have a plugin and I would like to be able to run the post content through some filters before it is saved to the database. From looking at the plugin api, I see that two hooks that look like they ...
1
vote
1answer
544 views

save_post hook not triggered in WP v3.6.1

I developed a plugin having a custom metabox that is using the save_post hook to store data. The plugin is 18 months old and is used by thousands of customers, so I'm pretty sure everything is good. ...
0
votes
1answer
705 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 ...
-2
votes
0answers
10 views

How to run some piece of code while before applying a coupon to the cart in woo-commerce? [closed]

Please help me, very urgent. I've a requirement that, I need to extend the apply coupon code event in woocommerce. I can't find an exact hook for my requirement. Here is what I exactly needed. ...
0
votes
1answer
16 views

Can i exclude certain page templates for a specific role?

Let's say i have two types of templates available when making a Page. "Default template" and "Intermediate template". I have a role called "editor", and i do not want the editor to access the ...
4
votes
1answer
58 views

Can I hook inside another hook?

My question is that when we hook to a certain action using the oop way for example class My_Plugin_Class { public function __construct( ) { add_action( 'admin_init', array( &$this, ...
0
votes
0answers
10 views

Write Custom Access Control Code For WordPress Download Manager

The WordPress Download Manager plugin by default allow us to select which rule can access the file. But I have a special case, I want if the user have a meta date equal to specific value then the ...
0
votes
0answers
9 views

Run function after theme is installed for the first time

I want to run a function to add default widgets for my theme when it's installed for the first time. I tried add_action( 'after_switch_theme', 'add_theme_widgets' ); but it resets the widgets back to ...
1
vote
1answer
18 views

Any hook for pre-plugin-update -either bulk or single plugin update

Any hook is available on before the plugin update action ? i searched in hooks library . What is the exact hook? . Doing some stuff before updating plugin/theme .
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
2answers
406 views

How to use the password_reset hook to validate new password and display error

When a user resets their password via the link in the password reset email, I know I can use the password_reset hook to get the user object and the new password. I want to validate the new password to ...
0
votes
0answers
29 views

A correct hook for saving meta boxes data

Nothing happens when I do the var_dump() in a callback on post save. Here are the hooks I've tried: save_post as shown in the codex pre_post_update as suggested here wp_insert_post_data found in ...
0
votes
1answer
27 views

Disable HTML (Text) Tab in Post Editor

I am attempting to disable the Text tab in the post editor but not having any luck. The first thing I want to do is set the Visual editor to be the default but this code does not work (it is being ...
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 ...
1
vote
1answer
32 views

Namespaced action and filter tags

I'm upgrading several of my plugins to use PHP namespaces, so that functions, classes, constants etc are all namespaced correctly. <?php namespace my\plugin; function init() { ... } // ...
0
votes
1answer
337 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
3answers
465 views

How do I add some javascript validation to the admin interface form's onsubmit?

I have a plugin that adds meta boxes to the admin interface and I need to do some validation when the user presses the "update" button before the form is submitted. Is there a WordPress action or ...
0
votes
0answers
10 views

Unable to create custom table , register_activation_hook from class

Cannot create the table , what am i missing class em_db { public function em_events_custom_table() { global $wpdb; $table_name = $wpdb->prefix . "em_events_db"; ...
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
161 views

Adding custom Bulk Actions

I have been looking around for ways to add custom Bulk Actions to the categories page. Most of them say that it is impossible to do it in a clean way, because of the lack of a hook for this. Most of ...
0
votes
2answers
2k 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 ...
0
votes
1answer
570 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 ...
-1
votes
0answers
20 views

not able to hook the event for the state of article change to publish for the iOS app push notifications

i have developed an iOS app with wordpress as backend and i have written the server side code for the same. Now, i need to run my code when ever a post is published. Also i need to create a table to ...
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 ...
0
votes
2answers
328 views

what is correct way to hook when update post

i try to hook when post is updated but all hook i try never executed except updated_post_meta add_action('updated_post_meta', 'my_function'); function my_function($post_id) { echo 'This is ...
1
vote
1answer
31 views

Is there an earlier hook than login_head or login_enqueue_scripts?

What I have: A basic plugin that enqueues a style-sheet and JavaScript file to modify the log-in forms. The logo, colour scheming and other styles are affected. My problem: As the /wp-login.php ...
0
votes
0answers
24 views

calling a function from a class in your template

ok, so I have created a plugin in Wordpress. I want to be able to use some values I have created in a function within my template but I just don't seem to be able to get it to work. I have created my ...
0
votes
2answers
301 views

What is the action hook that deletes a taxonomy term from the backend? And how to retireve the term id before deleting it?

I need to delete some postmeta when deleting taxonomy terms from the backend. Before deleting the term, I need to retrieve the postmeta's meka_key and the term id that is going to be deleted. Use the ...
0
votes
0answers
5 views

Customizing what happens when the user logs in - Hook or custom file?

I'm trying to get used to the S2 Members plugin and I am using it to build a membership based website. It's fairly simple stuff, but it's just to get used to working with the Framework and Wordpress. ...
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
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
331 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 = ...
1
vote
1answer
86 views

Searching hook to set cookies before <head> and avoid “headers already sent”

I have written a plugin that sets cookies, and need to avoid the "Headers already sent" PHP error by placing the code at the very top before the head section. Themes usually place wp_head just before ...
1
vote
2answers
334 views

How to use the 'comments_number' filter?

I'm not sure how to use this filter. Could someone show me an example? I'm trying to change ('0', '1', '%') to ('0 Comments', '1 Comment', '% Comments'). I'm using this function to get the comments ...
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 ...
27
votes
7answers
5k views

Where Can I Find a List of WordPress Hooks?

Where can I find a list of all the WordPress hooks and over-ridable functions (pluggable, scriptable, etc)? Edit: Plugin is here: ...
2
votes
3answers
326 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
1k views

How to only hook on Single.php after content?

I am currently hooking on the_content() but that goes through the Wordpress loop too. How can I only hook on the Single.php page? Also, is there a way to only look on the first X posts in the ...
1
vote
2answers
42 views

Fatal error: Class not found in

I am working on a plugin for 'hooking' an extra payment provider into a checkout system. I have a class gtpCheckoutData in my function.php which calculates the prices. In my plugin I want to use ...
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 ...
2
votes
1answer
72 views

Am I using the right hook for removing quicktags on the admin TinyMCE?

This is more of an excercise than something for a client. Anyway, I'm trying to disable the quicktags when you're on the dashboard and you click on Comments > Edit Comment. On that screen, there's a ...
0
votes
1answer
42 views

How to enable visual editor when editing comments on the dashboard?

For editing a comment in admin pages the editor is only html, can we modify the edit comment page with a filter to include visual editor too?
0
votes
0answers
25 views

How to hook add_action('user_register', 'my_functon') only when manually adding?

I stumbled upon the following. In functions.php i have a hook which calls a function when a new user is registered: add_action('user_register','do-my-function') This works, but i have also a plugin ...
5
votes
2answers
85 views

Is there a hook or function I can use to display all theme files being used on a current page?

Basically I want to be able to see the names of files on the front-end - not just templates e.g. category/page templates, but the actual theme files like header.php/sidebar.php/footer.php and so on. ...
1
vote
3answers
523 views

Why doesn't wp_enqueue_script() work when including a JavaScript file with TEMPLATEPATH?

I am trying to use tips from here to add my JS file. I put the following in the functions.php of atahualpa theme I've got installed function lektor_init() { if (true) { ...