Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
0answers
3 views

Add class to link surrounding avatar

I need to adjust styling of the -tag surrounding each avatar on my page. It's easy to add a class to the avatar img itself with this code: add_filter( 'bp_core_avatar_class', ...
4
votes
1answer
20 views

Better to fire specific hooks or generic hooks with paramaters?

I'm creating a form plugin to handle forms that can be hooked into using actions/filters by developers. My plug-in needs to be able to handle different forms with different sets of filters and I see ...
4
votes
1answer
65 views

Getting instance variable in scope of 'wp_enqueue_scripts'

I need a little help getting my head around passing instance variable to a hook. I am reading the CSS files I need in my template dynamically and storing them in a $settings object that I am keeping ...
4
votes
2answers
110 views

Using filters and actions for plugin API?

I want to integrate a public API to a plugin that I develop. The usual way other plugins integrate APIs is to define some functions that can be called by any theme or plugin. However, I think this ...
-1
votes
0answers
23 views

Use variable for different hooks [on hold]

I am currently developing a OOP plugin where I have the problem that in a specific function, which gets fired by a specific, a variable $test gets filled. Now i have a another function ...
0
votes
0answers
24 views

How should I use a plugin function as a hook?

I'm using Expire Password plugin, an open source plugin to expire users. It actually lets you expire users from the Users admin page, individually. I need to create a new user from a front-end form, ...
0
votes
1answer
12 views

Seems that admin_post_{action} does not executing

I'm trying to proccess different actions of my plugin with admin_post_{action} hook. But following code seems not working class TestPlugin { function test(){ die('working!'); } ...
3
votes
1answer
93 views

the_content and wp_link_pages

Many plugins seem to be adding a filter/action hook to the_content to display related posts, advertisements and such. The problem is I these appear before the post pagination so it the pagination is ...
0
votes
0answers
12 views

Send email to post author 1 day before his project ends

I am running wordpress with a job board and I would like to integrate an automated email notification: Users post jobs as a custom post type. Freelancers can send proposals within 7 days. When 1 day ...
0
votes
0answers
20 views

admin_post hook error message passing

I've mocked up a quick skeleton plugin, I'm trying to catch the $_POST data from the form template. The best route that I've found is using the hook admin_post, unless there is a better alternative? ...
1
vote
1answer
30 views

Hook (or other way) to find out when another plugin is activated / installed

Is there some way to run a function when another plugin is being installed and/or activated? Basically I need something like register_activation_hook only for other plugins. The use case: I want to ...
0
votes
2answers
22 views

How do I override the user's input when updating a custom post type's permalink?

When publishing a custom post type, I'm trying to override the custom permalink based on code rather than what the user types into the input box. I can confirm my action is firing correctly, but I'm ...
0
votes
1answer
30 views

what is do_action(); in wordpress? [duplicate]

Sorry for making duplicate Topic but it is very important to me because i don't understand this topic by looking other related topics. Actually i am in process to build a WordPress theme and i am ...
0
votes
0answers
13 views

WP Hook Action API trigger function when User is Activated

I'm trying to find a WP add Action Hook, that responds to enabling and activating a User in User Profiles Admin. I have a members site, with a members blog that feeds to a members newsletter in ...
0
votes
1answer
18 views

Trying to send AJAX data to WordPress hook

I'm trying to send jQuery data via AJAX to a WordPress template file. I've tried several different techniques and solutions based on other questions posted that pertain to this topic, with no ...
0
votes
0answers
21 views

Sticking a post or page to the top of all WordPress pages, posts, index pages, etc

I'm trying to add the same common content (like an announcement, banner, or slider) to the top of all WordPress pages, posts, category archives, etc. Standard WordPress sticky posts are displayed only ...
0
votes
1answer
26 views

remove_action not removing add_action from constructor

I am trying to replace a message from a function that got hooked in a constructor from a class from woocommerce. This is what I tried to remove the message: What I tried. function remove_actions() ...
0
votes
0answers
12 views

custom forgotpassword and hook for additional function

I have other app and a wordpress, whenever if there is a lost password request in the wordpress, it will also trigger for lost password request and other function for the app API.. the password ...
0
votes
1answer
32 views

Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()

I'm developing a plugin and I've problem with inserting new term to my custom taxonomy. <?php add_action('init', 'create_tax', 0); function create_tax() { $args = array(...); ...
0
votes
1answer
48 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
2answers
96 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
15 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
vote
0answers
19 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
7 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
42 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
28 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
54 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
27 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
31 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
19 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
31 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
43 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
13 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
172 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
20 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
51 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
51 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
21 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
84 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
56 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
69 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
34 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
25 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
53 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
42 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
36 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
53 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
22 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 ...