Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
2answers
79 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
90 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
1answer
37 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 = ...
4
votes
3answers
537 views

Define custom Page Template without its own .php file

Is there any way of defining a Page Template from some function/filter/hook, without having any .php file containing the comment at the top of the page to declare the Template Name? For example, ...
0
votes
1answer
56 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
34 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 href="?page=%s&action=...
1
vote
1answer
201 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( ...
3
votes
3answers
888 views

how to limit edit_form_after_title hook to page and post edit only?

heelo, I want to use this great hook edit_form_after_title it was announced on December 1, 2012: http://make.wordpress.org/core/2012/12/01/more-hooks-on-the-edit-screen/ it curreclty hook for : ...
2
votes
3answers
52 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
41 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
3answers
599 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
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
39 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 ...
16
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"); } ...
0
votes
0answers
45 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
24 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 ...
1
vote
3answers
65 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 ...
2
votes
1answer
65 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( '...
0
votes
0answers
47 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
48 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
55 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 post)...
0
votes
1answer
34 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
1answer
36 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 ...
0
votes
0answers
28 views

Hooks after media is saved

Is there any hooks/filters that fires when user already uploaded image/video . Thank you
1
vote
2answers
77 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 ...
1
vote
2answers
2k views

Disable HTML (Text) Tab in Post Editor

I am attempting to disable the Text tab in the post editor but not having any luck. The first thing I want to do is set the Visual editor to be the default but this code does not work (it is being ...
0
votes
1answer
152 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 ...
3
votes
2answers
197 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 ...
1
vote
2answers
1k views

Filter all html output

I would like to make sure no email address is published in plain. So i developed a plugin that replace all email addresses by a spambot-safe alternative. But some users put their email address in ...
1
vote
2answers
207 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{ ...
3
votes
1answer
234 views

Multiple wp_schedule_event cron jobs in plugin cause multi-execution

over the last week I have been working on some cron jobs for a real-estate website that has hundreds of updates/deletes and new posts added each day. I am very near the end now and looking to ...
2
votes
2answers
302 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 add_filter/action('...
1
vote
1answer
80 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
44 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
0answers
31 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
94 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 ...
12
votes
2answers
8k views

Save_post for custom post type?

Is there a save_post hook for custom post types? example: save_my_post_type I know there is publish_my_post_type but I'm looking for a save hook.
0
votes
0answers
22 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 ...
5
votes
1answer
812 views

get_query_var() not working in pre_get_posts

I'm using the pre_get_posts hook to order the main query on all my custom post type / taxonomy pages using a custom meta value. As part of the logic, I am trying to determine which taxonomy is ...
0
votes
0answers
117 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
33 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
290 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
12 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
24 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
1k 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
22 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
22 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
vote
0answers
62 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
votes
2answers
42 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 ...