Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

-2
votes
0answers
10 views

Stop a hooked function execution if conditional check fails

I have hooked a function that checks something, and if that check fails i want the hook instance to stop and not continue, how to do it? Does a simple exit; solve it?
2
votes
0answers
22 views

Wordpress scheduled task is called but not executed

I created a plugin with a cron to update all posts of a certain type every 5 minutes. I installed WP Crontrol to check if the cron is registered correctly and everything seems to be okay. This is how ...
0
votes
0answers
10 views

wp_get_referer function always returning false

I am trying to use wp_get_referer function along with "template_redirect" hook in wordpress like this function show_page_name() { $r = wp_get_referer(); var_dump($r); die(); } add_action ...
0
votes
0answers
18 views

Which hook should I use to generate title from custom profile fields

I have custom post types which do not use any standard fields, and have custom profile fields only. So, I want to generate a title based on a custom profile field, but I'm not sure which hook to use. ...
0
votes
0answers
11 views

Trigger needed when meta data is updated

I need to update a MySQL table (not any of the WP/Woo tables) when a products meta_key "_stock" is modified. The trigger needs to fire on all updates: shop sales, a CSV merge or edits by admin in the ...
-1
votes
1answer
38 views

wordpress post_where set only for my costum post type

in my Wordpress plugin i used the post_where filter but it's effect all other post type of my site. my question is how to set this filter only for "property" post only add_filter('posts_where', ...
0
votes
0answers
13 views

How to pass arguments with do_action to objects?

Passing arguments from do_action to objects added with: add_action('hook', array($obj, 'object_function')); does not work?
0
votes
0answers
14 views

Hook function on click of Button “Pages” in the WP Admin Panel / Not Activate Plugin

I need a hook which I can use for add_action('TheHookINeed', 'add_hooks_for_advanced_page_manager'); I need the function add_hooks_for_advanced_page_manager() executed before the page overview site ...
0
votes
0answers
7 views

WP send email on new post not on revision [duplicate]

I have something like this for my custom post type: function send_property_email_notifications( $post_id, $post, $update ) { global $wpdb; global $post; $slug = 'property'; // If this is just a ...
0
votes
0answers
22 views

do_action filter function from add_action array

I am looking at the following setup: -- Combing multiple functions into single action -- add_action( 'single_post_meta_start', array( $this, 'the_title' ), 10 ); add_action( ...
0
votes
1answer
35 views

Use external link in the add sub menu

I want to show the data in the external plugins.php file. the below url path is correct but its not showing the file data. Whats the problem? add_submenu_page( 'antify', 'Plugins', 'Plugins', ...
0
votes
1answer
24 views

Add sub menu page in your plugin

this is how i am adding the menu and trying to add the sub menu page which is not adding. party-reservation.php function a_qoute_admin_action() { add_menu_page(__('Reservations Pages'), ...
0
votes
1answer
25 views

Plugin Development - Functions or Hooks?

I am brand new to WordPress plugin development and have a few questions, mostly about best practices but also some specifics. Essentially I just want to trigger an action (invoking a PHP class and ...
0
votes
0answers
8 views

A hook while a new site is created [duplicate]

I would like to know is there any hook available such that we can populate some common table data from the base site to the newly crated site. Actually I creating a website where the network will ...
1
vote
1answer
62 views

Plugin development, hooks, generate content

I'm building my first plugin. This plugin will activate a theme, set up a default front page, register tax. / cpt, and create some content. (cpt = custom post types) I made it work all this in ...
1
vote
1answer
50 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
35 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
23 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
20 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
23 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
15 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
13 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
27 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
39 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
56 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
46 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
34 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
17 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
60 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
vote
1answer
38 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
29 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
12 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
25 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
95 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
50 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
65 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
94 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
43 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
91 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
50 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
40 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
21 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
30 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
104 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
76 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
57 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
52 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
44 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
17 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
32 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 ...