Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
2answers
22 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 ...
0
votes
0answers
13 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 ...
0
votes
1answer
17 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 ...
-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
14 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 ...
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
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
26 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
31 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
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"; ...
4
votes
1answer
57 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, ...
-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
1answer
30 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
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
19 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(){ ...
1
vote
1answer
83 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 ...
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 ...
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 ...
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
0answers
23 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
84 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. ...
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
1answer
26 views

Hook into wp_head(); in a plugin

I am following a tutorial that requires I put this code above wp_head(); <?php $example_position = get_theme_mod( 'logo_placement' ); if( $example_position != '' ) { switch ( ...
0
votes
1answer
19 views

Accepted arguments value in hook functions

Let's say I have the following hook function: function my_function() { $post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : ''; if( !isset( $_REQUEST['mode'] ) ) $_REQUEST['mode'] ...
0
votes
0answers
23 views

save_post is not firing when I only edit custom meta fields

I've come across the action hook save_post few days back and I like to take advantage of it. I've custom post post type "Property" with Meta fields associated with it. The problem is that when I ...
1
vote
2answers
64 views

How to override WordPress registration and insert an auto-generated username?

I need to auto-generate usernames upon WordPress registration. I have a custom registration form set up and would like to create the username in functions.php. Can someone tell me why this isn't ...
3
votes
2answers
72 views

How to hook into the CPT's title placeholder?

I want to change the default placeholder text in my Custom Post Type title field. This isn't possible while registering a new post type. The following screenshot describes it.
0
votes
2answers
45 views

How do I hook my function to run only after submitting login form

I'm new to wordpress. I'm writing my first plugin. I don't understand how to have my function run only after submitting the login form while not running every time I refresh the login page. I tried ...
0
votes
3answers
49 views

Categorise Custom Post Types

I don't want to add the category support for the posts of a certain custom post type but to categorize the post types itself. How is that possible? Story behind: In my theme I handle different post ...
0
votes
1answer
40 views

Please explain me what the do_action does

I am trying hard to understand do_action but not understanding. I was studying the blane theme. And they have this code in sidebar.php <div id="secondary" class="widget-area col-md-3" ...
0
votes
0answers
16 views

Override an advanced custom fields action callback [duplicate]

I'm in the process of writing a CDN plugin for WordPress and am trying to integrate it with the Advanced Custom Fields plugin. I need to filter the output of the "File" field type on the edit post ...
0
votes
1answer
27 views

Use a variable created in get_header to calculate stuff in wp_footer

i am trying to create a small time tester that loads at get_header hook and the using the value does something in wp_footer... i have tried using global $var i tried putting the global var inside ...
8
votes
1answer
65 views

Add a new tab to Wordpress Plugin install Listing

When an user searches for a plugin from the WP Admin's Add Plugin area, I want to add a new tab(with a link to a page) next to the current tabs. The location where I want the link is marked in the ...
3
votes
1answer
47 views

How to add a link to Wordpress Plugin install Listing

When an user searches for a plugin from the WP Admin's Add Plugin area, I want to add a link/button to every plugin's listing area. Which hook should I use? The location where I want the link is ...
0
votes
0answers
27 views

Add row counter in Admin area - Custom post list

Hi I add some custom columns to my custom post type listing in admin area. In my functions php: function book_cpt_columns($columns) { unset( $columns['date'] // Ocultar columna ...
0
votes
1answer
21 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
27 views

Where is publish_post hook fired?

Hook publish_post, which does not necessary need to be run on post publishing only, it can be used for any post type and any post status in this format {status}_{post_type} which also makes it hard to ...
0
votes
0answers
30 views

How to apply hook on pre_get_posts go get natural sort in listings in dashboard?

I have this code to do sorting on meta_key e_nummer ascending order in admin dashboard when listing products. /* Sort posts in wplist admin by e-nr! */ function custom_post_order($query){ ...
0
votes
0answers
148 views

admin-ajax.php not working after wordpress 4 update

n WordPress 3.9.2 access to admin-ajax was working for non loggedin users. When I upgraded the script stop working. I have the following code in functions.php function theme_name_scripts() { ...
1
vote
1answer
40 views

How to initialize something in unit test before the init hook being called?

I've a simple PHP Unit written for WordPress and want the initialize code before the main 'init' action being called from the plugin I want to test, e.g. class MyPlugin_Test_Example extends ...
0
votes
1answer
27 views

“Seen by” Feature in posts [closed]

Do you guess how would be a good practice to achieve a "seen by" feature in every post? I mean, simply add which users have seen a post. I'm not sure how to add a hook for that. Neither if I would ...
0
votes
0answers
18 views

Override child theme menu to social menu

I have a header.php file contains these code supreme_primary_navigation(); do_action( 'after_menu_primary' ); and functions.php file contains these code function supreme_primary_navigation(){ ...
3
votes
3answers
230 views

wordpress hooks run sequence

What is Wordpress HOOKS execution consequence? I mean, i want to know the order, how add_action hooks are executed (i.e. init after_theme_setup wp_header and etc.. i want to know the correct ...
0
votes
1answer
48 views

Hook when adding or editing a specific custom post type? [closed]

I'd like to insert a script and if possible some PHP for a custom post type. I'm looking for a hook to do this on the add new or edit screens. Any idea what I'd use for this? I tried "edit_post" but ...
1
vote
0answers
17 views

put custom taxonomy slug in front of their respective term slugs

I needed to register two custom taxonomies which partly share some terms. The structure would look like this, when commerce and crafting are two different custom taxonomies: Commerce Furniture ...
0
votes
0answers
26 views

Add notice to add image popup

I have been using the global "pagenow" variable to add instructions for users, but I need to somehow hook into the add image popup as I would like to instruct the users on optimal resolution for ...