Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

2
votes
0answers
32 views

Global Objects and Public Methods

I'm developing a plugin and am just thinking over best practices. How common is it to have a global object? Currently on plugins_loaded I am creating a global object of my class: add_action( ...
2
votes
0answers
37 views

How to hook into unregistering a widget instance?

I would like to hook into a widget instance after it is removed from a sidebar panel on the Appearances -> Widgets admin page. So if the instance was an active widget and then removed, I would like ...
2
votes
0answers
121 views

Featured image upload finished hook

I'm looking for a way to hook into the process of uploading a featured image. Ideally I would want to be able to do some stuff right when the upload has finished, before the thumbnails are generated. ...
1
vote
0answers
28 views

Is it possible to delay execution of shortcode output callback?

I have a problem : shortcode output callback triggered too early. /* Defined in plugin constructor */ add_shortcode( 'foobar' , array($this,'pre_render_routine')); function ...
1
vote
0answers
15 views

How to update the values when the featured image has changed?

I'm trying to implement this function. It saves in the database the dominant color of the image uploaded as featured image in a post. It's working perfectly BUT the problem is that it only works when ...
1
vote
0answers
29 views

Importing Product Variation Images Swatches

I want to upload several thousand variable products to Woocommerce using the WP All Import plugin. I also want to display product variations using the Color or Image Variations Swatches plugin, which ...
1
vote
0answers
11 views

wp_insert_post_data hook should be called before updating db but isn't

function custom_editing_permissions($data, $postarr) { //Post gets updated here WTF? die; } //Hook should be called "prior to inserting into or updating the database" ...
1
vote
0answers
13 views

Audio Player not loading when the content is loaded through Ajax, MediaElement.js no applied

When I load the content using ajax it doesn't apply MediaElements.js to my audio player, so the audio isn't display. I think this is because the MediaElement.js is loaded with wp-footer(), and this ...
1
vote
0answers
20 views

How to send an automated user 'inactivity' email?

I'm currently working on a editorial heavy WordPress site, and one thing that I'd like to implement is a functionality that sends someone of a specific role (in this case contributor/author) an email ...
1
vote
0answers
90 views

Woocommerce action before Place Order

I want to know is there any hooks in woocommerce before placing an order, In my case, What I want to achieve is, If the customer selects the COD option in the check page, and click place order I want ...
1
vote
0answers
58 views

Comment search plugin

I want to develop a plugin which places a search input field above the first comment on the post pages, filters the comments below that post, and only shows the comments which include the string that ...
1
vote
0answers
159 views

add_filter hook redirect view cart button in woocommerce

In my current multilanguage wp project I'm trying to redirect the user from the checkout (which is in the current language choosen by the user) via "view cart"-button to a translated cart page. ...
1
vote
0answers
28 views

How to change the default mail when admin approuved an user?

How to change the email (content & template) when the administrator approuved an user?
1
vote
0answers
88 views

template_redirect or admin-ajax.php?

My plugin needs to be reachable by the public and accept query vars. When called, it will run some backend db tasks, call a 3rd party API and sometimes redirect. Previously, I was using ...
1
vote
0answers
47 views

wp.media add context

I have wp.media frame on my plugin to upload doc, docx file. I am filtering the uploaded file. If uploaded other than supported file, it will display this error I am filtering it at ...
1
vote
0answers
60 views

wp cron job fires at every second or so, if callback is wrapped with DOING_CRON check it never fires at all

I am a bit lost while dealing with a open source plugin implementing wp cron. You can read about the problem on github https://github.com/nekojira/wp-currencies/issues/6#issuecomment-116735909 - I ...
1
vote
0answers
140 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 ...
1
vote
0answers
30 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 ...
1
vote
0answers
132 views

Get log of function/method calls made by do_action() on WordPress initialization

Is there any way I can get a log of the method calls that are made when do_action( 'init') is fired?
1
vote
0answers
176 views

Hook before & after plugin / core update

I'm working on a maintenance plugin for my website and I want to enable it before plugin/core upgrade starts and disable it after plugin/upgrade ends. Any ideas ? Thanks! :) PS: all I know is I can ...
1
vote
0answers
1k views

How to set a custom path, for ajax image upload folder in admin?

I am coding my first Wordpress plugin that handles some data for a custom (shop-like) post type. It also has an image uploader within a metabox, where you simply drag in your images and it ...
1
vote
0answers
64 views

PHP header() gives headers already sent

I am working on a checkout proces in Wordpress where if customer clicks on the checkout button he gets redirected to a payment provider. Important to know: I use a session in this proces. I use PHP ...
1
vote
0answers
113 views

I have 2 plugins using the same wp_login action hook and one is not working

so this is after a few hours investigating, I have s2member plugin and a custom plugin what happens is they are both using wp_login hook in this manner, s2member: add_action("wp_login", ...
1
vote
0answers
68 views

Add custom text in the media library image meta area

I want to add some custom text in this area in the media library: Is there a filter I could hook into or how can I add content there? If not, how do we do this using Javascript? I want the text to ...
1
vote
0answers
69 views

Issue understanding and using WordPress filters and actions

I have a custom WordPress plugin that I have developed. The plugin is a widget bundle containing a bunch of custom widgets. The scenerio The plugin allows for custom css styles through creating a ...
1
vote
0answers
148 views

Show message in media-new.php

I'm wondering if there's a way to show a specific message when user uploads a file using the wp-admin/media-new.php script. So far I have this: function my_uploads_notice(){ global $pagenow; ...
1
vote
0answers
44 views

Hooks are not being removed in child theme

I have a hook file: function load_admin_package(){ do_action('load_admin_package'); } /* * ----------------------------------- * Define hooks bellow * ----------------------------------- */ ...
1
vote
0answers
117 views

Firing a function AFTER redirect

I am using a function that redirects the user to a custom page, rather than wp-login in the event of errors. In my case I am using the Http Referer function to send the user back to the same page ...
1
vote
0answers
99 views

Copy post to separate database with “add_action(…)”

I'm basically trying to have a copy of a post be sent to another database's table when it's published. I've gotten it to add a new row in the new table, with my own static arguments, but I'm not sure ...
1
vote
0answers
233 views

Hook into existing tinyMCE button

Is there a way to hook into an existing tinyMCE editor button? I have a plugin that currently has a button on the editor and it shows a popup-box when clicked. This box has tabs inside. I would like ...
1
vote
0answers
67 views

Add a new confirmation page before saving

I'm going to add a hook that does some modifications of the text before saving. Before making the changes permanent, I would like the user to confirm the changes after a "save_post" hook. Is there a ...
1
vote
0answers
81 views

Can I hook into wp_update_core outside of the admin?

I'm trying to bring some of the admin functionality to a custom front end in WordPress. Questions of security and pragmatism of this aside, is there an available hook to trigger wp_update_core outside ...
0
votes
0answers
8 views

How to Add Class or ID to a WooCommerce Layered Nav Widget

I'm looking to modify the class/id of a WooCommerce Layered Nav widget by adding in a new class or ID if the widget is displaying for a WooCommerce attribute (ex. Sizes, Colors attribute). Is there ...
0
votes
0answers
19 views

Hooking to APIs working on WP_Posts

I'm working on a WP site, and I've found a plugin that I can use to do most of the work. But there is a problem: as I feared, it stores all of its data inside WP_Post. This is obviously pretty stupid ...
0
votes
0answers
9 views

Save to boolean custom field when video is embedded in post

For my site I want my visitors to be able to tick a checkbox to only include content (posts/pages) with video embeds in a search query. This would be possible if I stored the state (true/false) in a ...
0
votes
0answers
38 views

Removing item from Woocommerce cart

I am using the template_redirect action hook to try and remove items from the cart, but having an issue with variable products. I found it was only affecting variable products by adjusting my code to ...
0
votes
0answers
16 views

plugin development for woocommerce

i create this plugin: A discount in % for woocommerce price, but i have a problem: add_action( 'woocommerce_product_options_general_product_data', 'crele_add_custom_general_fields' ); add_action( ...
0
votes
0answers
15 views

How to add new tab and data in Wordpress Users section

I have to add new tab and new data in wordpress users. Please see the image below. The points tab came from the plugin mycred but i don't know what was used. What I think was it was done using: ...
0
votes
0answers
20 views

Execute code only after user clicks 'update' button for CPT being edited

In my plugin, my custom post type posts might be updated either by a user clicking 'update' on the editor page, or programmatically. I need to execute a settings validation routine only when the ...
0
votes
0answers
39 views

On WP 4.4, how to get the post id on comment_post hook

Since WP 4.4, seems like is not possible anymore to use get_the_ID() or the_ID() when hooking on comment_post action. How can I get the post_id when a new comment is saved?
0
votes
0answers
70 views

Woocommerce: trigger new order email without changing status

We are working on trying to process phone pledges for a non-profit where the payment is not received and will be invoiced. I have a custom checkbox field in the Woocommerce admin, when checked, I ...
0
votes
0answers
37 views

How to resolve 500 error in post listing page?

I am getting a 500 error in only post listing page. I checked code in admin and found this hook creating a problem: admin_head-$hook_suffix When I remove this hook, page works fine. How can I ...
0
votes
0answers
27 views

wp query custom orderby not custom field

I am working on a products archive page where I show 20 products on each page with pagination. Each product's price is calculated by a formule which gets his parameters by data saved in the database. ...
0
votes
0answers
33 views

Function Hooked on Init Running Multiple Times

I have a method that logs the users login time. public function log_login() { if ( isset($_COOKIE['current_visit']) ) { return; } // Get current user $user = ...
0
votes
0answers
14 views

Hooks after media is saved

Is there any hooks/filters that fires when user already uploaded image/video . Thank you
0
votes
0answers
13 views

How to email a published post notification at a certain time?

I am using follwoing code to send an email if any post is published or draft to published. <?php add_action('future_to_publish', 'send_emails_on_new_event'); add_action('new_to_publish', ...
0
votes
0answers
91 views

Woocommerce - Send billing details to email

I'm new to wordpress and woocommerce and I'm trying to send the details of anyone making a purchase on my site to an email script I have. I've done some research and it seems the best way to do this ...
0
votes
0answers
32 views

How Do I Add a Custom Field Inside a Gravity Forms Field?

I would like to add a custom field inside a gravity forms field. The custom field should accept HTML syntax. Here is an illustration of what I would like to achieve: To be specific, how do we add ...
0
votes
0answers
17 views

WP-Automatic to run publish hooks

Maybe there is someone who could help me with this plugin I use. I need it to run publish hooks, so plugin WP to buffer would work. So now WP-Automatic, publishes content, but WP to Buffer doesn't ...
0
votes
0answers
45 views

Featured image to grayscale with PHP imagefilter - which hook to use?

Website I am working on uses b/w images everywhere and my client is a little lazy, so I need to convert any image attachment to grayscale automatically. For that, I use something similiar to this: ...