Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

2
votes
1answer
128 views

Removing labels and <br> tag on WordPress's default login form

I am customizing the login form to more closely resemble Google's minimalist form, which has no form labels, and instead relies on placeholders to prompt users for the input fields. The form starts ...
-1
votes
1answer
29 views

How do I add functionality to images?

How would I add functions to images? I host a photography site, in which I'd like to add options to favorite an image or attach it to a product for ordering. Is there a hook or something that I can ...
0
votes
0answers
62 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
1answer
47 views

Remove Permalink From Admin Edit Post

Is there any way how to edit the title field in post.php? this field: I want to remove the permalink part but I wasn't able to find any hook or filter for it.
0
votes
0answers
203 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
1answer
24 views

Run only on plug-in activation instead of wp_head

I have below function on my plugin which adds more capabilities to current user. // Role setting for add media function wh_edit_roles(){ if ( current_user_can( 'edit_posts' ) ){ $user = ...
0
votes
1answer
95 views

$_POST empty in using new php file added to theme

I am using a theme which handles form data with jquery (a handler function defined).I have added a new php file to theme (using it in as template in a wordpress page, also registered with rewrite ...
0
votes
2answers
58 views

How to distinguish on hook profile_update user registering, user resetting password or user updating profile?

The hook profile_update gets fired in case the user updates his profile, that is also when he reset the first time his password after registration and when he register. How do I distinguish ...
0
votes
1answer
53 views

Passing variable in hooks and filter

I was trying to pass variables in filtes. This works perfectly for me. class my_class { function my_class() { add_filter('wp_list_categories', array(&$this,'cat_count_span')); } function ...
0
votes
1answer
27 views

Passing link parameter values to form

I've added edit|delete options in every row of a table, created in the admin panel. function column_A( $item ) { $actions = array( 'edit' => sprintf( '<a ...
1
vote
1answer
138 views

How to change post status from publish to draft using hook in wordpress?

I want to change the status of already publish post to draft using its id. add_action( 'save_post', 'change_post_status', 1 ); function change_post_status( $post_id ){ $my_post = array( ...
2
votes
3answers
47 views

Getting my head round WordPress filter

I am following a tutorial that will hopefully allow me to insert templates straight from my plugin into WordPress. I am using the template_include filter, I can't get my head around how the whole ...
0
votes
0answers
40 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
1answer
22 views

Odd map_meta_cap $args on post edit — sometimes integer, sometimes string

I've been digging into the map_meta_cap filter since I need to extend the user's capabilities based on context, in certain situations. This is working well but in my traces I noticed something odd ...
0
votes
1answer
28 views

Customize title, description and focused keyword [closed]

I would like to customize focused keyword, SEO title and meta description, but I am unable to find any clue how to do it. There is official documentation but it is sooo lacking... I came up with ...
0
votes
0answers
35 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
2answers
23 views

Trying to get class to instantiate ONCE (or, “why do I keep punching myself in the head?”)

Here's a very simple plugin, which I drop into mu_plugins in my multisite installation: <?php /* Plugin Name: Test */ class myclass { function __construct() { error_log("I just ...
14
votes
3answers
2k views

How many times will this code run? (or, how rich is grandma?)

Hypothetical example but real world applicability (for someone learning, like me). Given this code: <?php function send_money_to_grandma() { internetofThings("send grandma","$1"); } ...
2
votes
1answer
53 views

Error when overriding only some audio shortcode HTML output

Context I have a function that overrides audio shortcode HTML rendering, thanks to a WordPress hook: wp_audio_shortcode_override I used it this way in an OOP plugin: add_filter( ...
1
vote
3answers
58 views

Trying to understand order and frequency of action hooks firing

I'm working on a plugin that modifies user capabilities and turns off a lot of things in the Admin pages. I'm having some problems with order of execution with my code, so I want to refactor it and ...
0
votes
0answers
38 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
1answer
25 views

Converting restricted html in comments to bbcode

Problem: Wordpress multisite only allows the Admin account to include images in html for security reasons. It is possible to install a plugin that turns off these restrictions, but it apparently opens ...
0
votes
1answer
31 views

WP Cron not executing after timespan

I trying to utilize wp_schedule_single_event to schedule an asynchronous task. However, my event was never called after 60 seconds. Do I need to do anything with ldp_new_topic_event hook before using ...
0
votes
0answers
25 views

Hooks after media is saved

Is there any hooks/filters that fires when user already uploaded image/video . Thank you
1
vote
2answers
66 views

Wordpress action and filter hooks runs asynchronously?

I have some functions that run fairly long to complete. These functions are called via hooks registration (i.e. add_action() and add_filter()). Would it impact the end-users when my tasks runs for a ...
0
votes
1answer
42 views

set_post_format called after wp_update_post when using bulk edit?

EDIT: See comments below. changing the question to reflect this new info From what I understand from the codex, save_post is meant to always fire after the post is saved (and when creating a new ...
0
votes
1answer
33 views

How can i create a pages for anonymous users in custom plugin..?

I am very new to WP. My requirement is to create a small Booking System as a plugin. I have 5 different pages for entering details step by step and Users can book as anonymous. Admin only need a mail ...
1
vote
2answers
127 views

action hook wp_head higher priority as all other plugins/hooks

I work a bit with the wordpress API and I want to try to include a <meta>-tag into my head area of my website. This is my code (works everything fine!): class dmd_noindex_options_page{ ...
2
votes
2answers
182 views

Is there a hook before the user is authenticated?

I'm looking for a hook that can be used before WP reads the DB to authenticate the user's login credentials, but can't seem to find one anywhere. Does one exist? I tried ...
1
vote
1answer
75 views

Adding dynamic section to WordPress

[Edit: I've added a more concrete example below] I need to convert a custom PHP site to WordPress. The site has 60,000+ media items along with a ton of metadata, all of which needs to carry over to ...
0
votes
1answer
36 views

Add action to custom Function

I am trying to use plugin action in my custom function. Plugin is adding an action to wordpress registration form add_action( 'bp_before_account_details_fields', 'tv_bp_avatar_upload_form' ); But ...
0
votes
1answer
124 views

How can I hook into existing WordPress Bulk actions?

I am creating a plugin which syncs both standard WP data and custom fields within a custom meta box on post edit pages, to an external resource using SQL queries. However my functions are currently ...
0
votes
0answers
21 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
166 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
47 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
18 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
91 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: ...
0
votes
1answer
32 views

Wordpress hook source

I am trying to understand how plugins are activated. wp-admin\includes\plugin.php, line 602, there is a call to run a hook called activated_plugin do_action( 'activated_plugin', $plugin, ...
1
vote
0answers
30 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 ...
0
votes
1answer
204 views

Add my own function to existing WooCommerce hook

I'm trying to customise my WooCommerce child theme with parent theme Storefront. The parent theme creates single product template (content-single.php) like this: /** * @hooked storefront_post_header ...
0
votes
0answers
11 views

How to trigger an email when a posts metadata has been updated?

I'm really struggling on this one, so I appreciate the help from all of you guys/gals. I've built a progress bar type of application for a client. The basic setup is that each project (custom post ...
0
votes
0answers
19 views

Why none of xmlrpc filters work

I disabled all of the plugins and used fresh install of wordpress but it seems none of xmlrpc filters works for me... . for example add_filter( 'xmlrpc_wp_insert_post_data', 'ffff' ); //or ...
0
votes
1answer
541 views

WooCommerce: change display order of product short description and price [closed]

re: https://modestmix.com/shop/benefit-teas/go-the-fuck-to-sleep/ I'd like to move the price "$4.99–$24.99" below the product short description "Seriously. Drink a cup of this..." Any ideas how to ...
1
vote
0answers
109 views

Removing Generated HTML Comments from SEO Plugins (All in One SEO, Yoast, Platinum SEO) [closed]

Most of the SEO plugins out there sign the code of the site with a comment with their name and even their software version. For example, All in One SEO adds the following: <!-- All in One SEO ...
1
vote
0answers
164 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
21 views

Which hook is fired when tag is added or changed? [duplicate]

I have a transient that collects WordPress tags with specific description. I'm looking for a hook name that fires when user edits a WordPress tag or creates a new tag in admin so I can delete my ...
0
votes
0answers
19 views

Attempting to add an imagemap/ content to Front Page — shows up only in meta description

I'm dealing with a nasty old theme for a friend that uses a huge slider as its homepage background image. I'd rather not scrap and recreate the site, as back in the day I put in a good amount of ...
-1
votes
2answers
38 views

What is meaning of BEFORE and AFTER in this hook name?

I'm trying to interpret this action hook name: ws_plugin__s2member_pro_before_sc_authnet_form_after_shortcode_atts What is meaning of BEFORE and AFTER in this hook name? Do the underscores mean ...
1
vote
0answers
59 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 ...
0
votes
0answers
60 views

Access Action Hook from Child Class in External Plugin Class

I am attempting to access an action hook that is declared in a plugin's child class. The plugin uses a singleton instantiation pattern: class WC_Freshdesk { protected static $instance = null; ...