Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
1answer
10 views

Genesis - Adding custom hooks to display secondary navigation

within my functions.php I added the following piece of code to display my footer accordingly: //* Customize the entire footer remove_action( 'genesis_footer', 'genesis_do_footer' ); add_action( ...
0
votes
0answers
10 views

Displaying randomly created meta values in wysiwig editor

I have already asked this question on stack overflow but I'm asking it once again here because i haven't found a solution to it yet. I am creating custom meta info for a post that will have null ...
2
votes
3answers
88 views

Filter for “get_post_type_archive_link()”

I tried to find filters or a hook to modify link returned by this function get_post_type_archive_link() I have gone through most of the documentation. I'm not sure it's not there or I'm not able to ...
-1
votes
0answers
20 views

Changing Woocommerce Search Results to Put Price/Rating/Button in container? [on hold]

I'm working to change the woocommerce search results so that the info floats over the image, and is only revealed on hover. Instead of tons of styling, I was hoping to take this code: <li ...
0
votes
1answer
13 views

add hook restricted only to either plugins or themes?

I'm writing a plugin and I want to create two hooks like the following: add_action( 'myplugin/ready_for_theme', array( __CLASS__, 'myfunction_for_themes' ) ); add_action( ...
0
votes
1answer
12 views

Must filter functions receive all arguments passed to them?

I'm writing a filter function to redirect logins: function my_filter_func( $redirect_to, $requested_redirect_to, $user) { // My code. } add_filter( 'login_redirect', 'my_filter_func', 10, 3 ); ...
0
votes
1answer
25 views

How to alter the query using pre_get_posts hook and is_post_type_archive

The need: I'm trying to filter a custom post type archive using a GET parameter, so that I can split the posts in two groups depending on which terms they are tagged with. How: So far I've decided to ...
0
votes
1answer
23 views

Help to change the text for new website notification (wpmu_welcome_notification)

i am trying to change the text for new website notification (wpmu_welcome_notification): in the core file i see wordpress using this function to send the email when new site created: the quasion is ...
0
votes
0answers
12 views

add_action - $function_to_add first argument defaults overwritten

I have an issue with the following code, $function_to_add first argument defaults are overwritten with an empty string "" and it cause an error: Warning: join(): Invalid arguments passed The second ...
0
votes
1answer
45 views

Should I use add_action('publish_post or add_filter('publish_post?

I am trying to trigger an extra function as soon as a certain custom post type is published function insert_table_products($post_id, $post) { if ($post->post_type == 'custom-products') { ...
0
votes
1answer
25 views

How to load a mycred hook from a plugin?

I've created a hook for mycred following this tutorial. I added the code to the function.php, and I am now wondering how to call it from my plugin? I have no clue, and the tutorials that I've ...
1
vote
2answers
37 views

add_action for unknown custom post types

If the custom post type is known (e.g., 'reference') then the add_action is add_action( 'publish_reference' , 'run_new_post_code' ); Great. But what is the proper code for an unknown custom post ...
0
votes
1answer
27 views

WordPress HTML Helper

I've played recently with WordPress Hooks and I've noticed that in order to create layouts based on the hooks the main practice is to use html in functions and combine them with logic. I've searched ...
0
votes
1answer
17 views

Act on user meta updated, but only once

My plugin is calling a third party over http whenever a users meta data is updated. To do this I am using the updated_user_meta hook. It seems however that that hook is called multiple times, once ...
0
votes
1answer
15 views

WP action/filter to modify title before header output and article output?

I'm trying to split test two versions of a posts title using a custom plugin. So far I haven't found the right filter or action to hook into to modify the title on the meta tag level before the page ...
0
votes
1answer
22 views

Why doesn't global $wp_query not get hooked?

I have a plugin that helps me to make lazy loading on posts of a custom post type. The idea is to add an action to the template_redirect/init and get data from the global $wp_query to make jquery ...
0
votes
1answer
29 views

Manually return false for function_exists

I'm having a run at developing a theme options plugin and right now working on implementing a 'hero' header, checking first to see if my plugin is active using: if( function_exists( ...
0
votes
1answer
35 views

add_action in the loop hooks

I have the following structure: add_action('my_content', 'standard_loop'); function standard_loop() { if (have_posts()) : while (have_posts()) : the_post(); ...
0
votes
0answers
12 views

Prevent attachment from being deleted

In Wordpress admin media library page (upload.php) I'd like to do some checking on delete_attachment action. I want my custom function to fire before attachment's being deleted. In this function I ...
0
votes
0answers
37 views

How to `remove_action` from plugin

I'm using a third-party plugin that has an function hooked to the plugins_loaded hook. From the plugin file itself: add_action('plugins_loaded', 'acf_qtranslate_monkey_patch', 3); This is not in a ...
1
vote
1answer
55 views

Implementing DNS Prefetching with WordPress

I'm not sure whether my question sounds promising or not but what I'm going to ask is very much relevant. So please read the full question before down voting or flag. I'm trying to implement DNS ...
0
votes
0answers
21 views

How to call plugin function everytime

This is probably a very basic and simple matter, but what is the command to call a function in my plugin every time the page is loaded? I think it is something like add_action() or do_action(). ...
0
votes
2answers
43 views

Fatal error: Call to a member function get_queried_object_id()

I am trying to display shortcode using the following pattern: class callShortCode { function __construct() { global $post; $this->dos($post); } private function ...
0
votes
0answers
7 views

Wrap template files of the parent theme

Is there a function or trick to put a wrapper to all template files. For example comments.php where the parent theme template looks like this: <div ...
0
votes
1answer
22 views

How wordpress plugin hooks works? [duplicate]

I am new to wordpress development. I am familiar with joomla's ins-and-out working mechanish, now i want to contribute or say learn wordpress. I found that every thing in wordpress is done through ...
0
votes
1answer
22 views

update_post_meta is Updating with two page id

I am writing a code to count the number of views of post. For that I am using update_post_meta and passing appropriate parameter. I am calling a function on add_action('wp', 'function_name'); in ...
0
votes
2answers
53 views

call php file from form and use wp functions

I'm building a stripe plugin and I'm stuck on this minor major issue. Problem: the form calls my process.php page to grab the form input variables, handle the Stripe token, and finally call out to ...
0
votes
1answer
28 views

save_post hook - headers already sent?

I'm trying to create a very simple alert for each time a post is created or updated with the below... add_action( 'save_post', 'updatedAlert' ); function updatedAlert() { echo ...
3
votes
1answer
50 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
16 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
19 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
13 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
42 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
14 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
31 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
27 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
42 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
40 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
26 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
63 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
82 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
43 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
28 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
23 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
34 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
16 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
16 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
33 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 .