Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
1answer
30 views

WordPress Plugin Boilerplate - add_action hook in static “activate” function

I'm hoping someone can point me in the right direction here. I'm using the Wordpress Plugin Boilerplate to develop a custom plugin. On install, the plugin will register a new post type (course), a ...
0
votes
0answers
9 views

Manage users custom column add class “num”

I have customized my admin users column to show the purchased leads of a role "lead buyer". The value of the column is a decimal (the number of leads). The "posts" column of the users table has a ...
0
votes
1answer
14 views

Hook Adding content after title

I need to add something after title in loop in single post and page, home page, categories. This is for a plugin and i don't want to modify the theme directly. function after_title($title) { ...
-1
votes
0answers
17 views

How do you move Woocommerce Description tabs under Product Image?

I have been trying to mess around with the hooks in content-single-product.php but can't seem to get it under the product image. Even tried some hook overrides in the function.php file. // Removes ...
1
vote
0answers
15 views

Add media library tab

I'm trying to make a new tab in the media library. I have found the function add_media_page which helps me add a page in the media menu to the left. How ever, this menu is not always visible, for ...
0
votes
0answers
5 views

How to create a hook that can give points for either how many pages viewed by user, or pages viewed by a user's posts?

I started a blog recently and I liked the achievements idea. I installed two plugins both which I like, one is called Achievements and the other is called WordPoints. Specifically, I would like to ...
0
votes
1answer
43 views

CF7: Custom Error Message [on hold]

May I ask how is the wpcf7_form_response_output filter (found in includes/contact-form.php) use? The below is what I had tried but to no avail. Function 1: $wpcf7->skip_mail = true; $content = ...
0
votes
0answers
22 views

Best Way to get facebook share count and update using wp_schedule_event or any other method

I recently developed a news blog, and my client needs facebook share count. I Successfully able to get the share count and update the custom field using below code.(with the help of cybermeta). What ...
0
votes
1answer
25 views

No result update a custom field using wp_schedule_event

I recently developed a news blog. My client asked for a facebook share count of an article. I am able to get the share count using facebook api, However, according to the information I found from ...
2
votes
1answer
44 views

Send an email when custom post type category is changed

This is the first time I've attempted to write an action hook. My CPT has 4 categories. I'm trying to make WP automatically sends an email notification when the category is changed. By change I ...
0
votes
2answers
22 views

Embeding style into the header via the function.php

I'm trying to add the following hook into my functions.php file. The CSS style shows up when I view the source code but it also show the php code for the random background image generator. How can I ...
0
votes
1answer
28 views

Customizing a plugin function using a hook

I've written a hook in my functions file that adds a metabox, from an installed plugin, to a custom post type that I've created. The metabox appears fine, but the default selection that is checked in ...
0
votes
1answer
19 views

Function the_content

For some reason on my attachment page template (http://capa.furniture/?attachment_id=1494) I am getting the url of the reduced size image. I do not know why. I am not getting the thumbnail full size ...
0
votes
0answers
15 views

How might one programmatically set the link for all images in all posts?

Every post on my Wordpress site contains at least one image (in the content, not as an attachment). Each post also contains a custom field with a URL. I'd like to programmatically modify all posts ...
0
votes
0answers
20 views

Object oriented programming, add_action in constructor not firing

I am trying to write a class that adds an action to the save_post hook, but the post_updated function never gets called. I tried some variations, but it never gets called. Am I doing something wrong? ...
0
votes
1answer
30 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
11 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 ...
3
votes
3answers
135 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 ...
0
votes
1answer
15 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
17 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
42 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
39 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
17 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
56 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
42 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
54 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
31 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
18 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
30 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
31 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
35 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
43 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
16 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
44 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
80 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
27 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
81 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
25 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
23 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
158 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
30 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
57 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
18 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
18 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
46 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
15 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
50 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 ...