Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

1
vote
2answers
40 views

How to add a button to custom post type's posts-page

How can I add a button to a posts -page. (In this case a custom post type). I'd like to place it next to, or near, the "Add new" button, to import content from a web service.
0
votes
0answers
13 views

Adding Information To All Posts Screen

What I'm looking to do is add the value of a post's metafield in each post's row on the all posts screen. I'm attaching a screenshot of where I'd like this information to show up. The info would be ...
0
votes
0answers
15 views

Creating Action Hooks For Automatic File Inclusion

I want to create a hook for automatic file inclusion in my plugin, but I am finding my stuck moments. May be somebody could help me out. Here is what I tried: $args = array( "url" =>"" ); ...
0
votes
0answers
18 views

do action inside a class is not working

I am trying to create my custom hook and call it from within a metabox class. Here is the pattern: metabox.php -- <?php require("libs.php"); require("test.php"); class metabox() { function ...
1
vote
1answer
27 views

When can you get current page ID and initialize hooks right after?

I'm developing a plugin and need to know on what page user is and then add specific hooks and filters for that page. And my problem is that is_page() and the_ID() doesn't work outside of wp, ...
0
votes
1answer
11 views

New User ID not working in custom function with user_register hook

I'm adding data to a table whenever a new user registers on the site. add_action( 'user_register', 'auto_follow_admin', 10, 1 ); function auto_follow_admin() { global $wpdb; ...
0
votes
1answer
15 views

Action hook with wrapper html

I want to add a space for a banner across the top of my WooCommerce Category pages, but i'm trying to figure out how to add some markup that will wrap the action. In my archive-product.php I have the ...
0
votes
1answer
19 views

Remove links from the_content when using filters wp_trim_excerpt

I'm using wp_trim_excerpt which is working perfectly but I want to strip the links contained in the the_excerpt (using get_the_content), I've looked online and tried many solutions to get the thing to ...
0
votes
1answer
35 views

How can I edit comment meta value before it is saved?

I have introduced a custom field in comments form using add_comment_meta() function. I would like to know if there is a way to edit the data of the comment meta just before the post data is saved so ...
0
votes
0answers
22 views

Remove Sidebar from Specific Product Category “Slug”, “not all” | Wordpress Woocommerce

My question is, Can i remove the sidebar only for particular URLs of my side. If the url is like below - remove the side bar and make the page full wridth ...
0
votes
1answer
14 views

WordPress save_post hook not firing when checking if _GET['post'] is set

I was facing an issue (a custom metabox not saving), and after 2 hours I finally realised that, if you try to add an action to the save_post hook inside an if statement checking whether $_GET['post'] ...
1
vote
0answers
44 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
1answer
23 views

Wordpress custom taxonomy check box to dropdown

Hi my custom taxonomy name is country.In this A is a country, a-sub1,a-sub2 are states under A. b-sub1,b-sub2 are state under Country B. Now i need to display the country list(parent) box and state ...
1
vote
2answers
297 views

Pass info from functions.php to plugin

What is the best way to pass some information from functions.php to a plugin? I need to give a user the ability to pass a piece of data from their functions.php file to my plugin. (It can be any ...
1
vote
2answers
33 views

Returning ACF custom field from publish_post

I'm trying to return a custom field as soon as a post gets published. I'm using the publish_post (or {status}_{post_type}) action, but it looks like the custom fields are created after the hook. My ...
0
votes
0answers
12 views

Wrapping main content area of the blog page with a div by action or filter hooks

I used loop_start and loop_end hooks to wrap the main loop to load posts. But the problem is there are recent posts and category sections which is also getting wrapped up. I only want to wrap the main ...
-1
votes
2answers
81 views

WooCommerce - Overwrite action hook [on hold]

Within the WooCommerce template file "content-product.php", I'm trying to overwrite the following action hook: /** * woocommerce_shop_loop_item_title hook * * @hooked ...
0
votes
0answers
34 views

Template file structure , wordpress hook for altering the template

i need to convert a html structure to theme. So this is my html structure <html> <head> ................. </head> <body> <div class="main"> <div ...
0
votes
1answer
27 views

get_header and hook avoid normal call

I would like to use a custom header, like get_header('new') But I cannot modify the templates easily where the calls are being made due to several reasons. (many files and same code base deployed on ...
0
votes
1answer
55 views

woocommerce single product page hook not working

I have written a function which will display a date picker and a select box. I want this function output to be displayed on woocommerce single product page. So I assigned my function to a hook ...
1
vote
1answer
40 views

Cast string to number

Actually, I am using pre_get_posts hook with these configure $metaquery = array( 'relation' => 'OR', array( 'key' => 'price', ...
0
votes
0answers
17 views

Custom Post Type On Publish Update Meta Field

I'm wondering if someone can shed some light on how I can update a custom meta field value, when a new post is created in a custom post type? Specifically, I have a custom post type named ...
0
votes
2answers
18 views

Make a custom column sortable by a value from a different custom post type

I've created some custom columns to display my custom post types more attractively in the admin section - the columns are mostly custom fields. Mostly, this works absolutely fine, and I can sort by ...
0
votes
0answers
3 views

make a pluign javascript run windows load instead of document ready [migrated]

I have a plugin which is displaying wrapped in a document ready function, but i need to have it wrapped in a window load function. Can this be done using a hook or something? Its getting displayed ...
0
votes
0answers
17 views

Wrapping succeeding shortcodes together

I'm developing a WordPress theme where the gallery shortcode breaks out of my main content div. I haven't really put this in to practice but I'm thinking of theories how to accomplish this easily. ...
0
votes
1answer
15 views

Add %taxonmy in worpress custom permalink structure

In default wordpress support %category% tags in custom permalink structure. I need to use %taxonomy in permalink structure .How to do that ? is there any filter are available. Please help.
1
vote
1answer
16 views

What's hook to use immediately after a user is authentcated [duplicate]

Does anyone know the add_action() hook to use immediately after a user is successfully authenticated. Hook Test based on @mmm's answer I ran this test from my mu-plugins.php file: function ...
0
votes
1answer
21 views

Add a custom class to the body tag using custom fields

There are certain posts where I want to manually append a custom body class to using custom fields. How do I go about it appending the class to the body tag when a certain custom field is added to a ...
0
votes
0answers
21 views

Multisite: Hook when wordpress creates new user record for a subsite

I'm trying to find an hook ( filter / action ) to catch when wordpress create new user record on a subsite. Example: Actually I've SiteA SiteB an user register itself on SiteA and ...
-1
votes
1answer
54 views

Access post meta just after publishing

the following code is supposed to store post meta of the recently published post to the variable $temp. But it doesn't, $temp is always empty. This seems to happen because "transition_post_status" ...
0
votes
2answers
76 views

Contact Form 7 - Execute code AFTER mail send

i've figured out how to do something BEFORE sending the mail, but i also need an action to happen AFTER it's been send. I tried wpcf7_after_send_mail but with no success... Any help on the matter ...
0
votes
1answer
25 views

Hook for altering the content of all wp mails

Hi i want to set email template for all mails for my site . I know how to set up mail template and i set mail template for each of my mail by editing the code ie wp_mail( $recipient, $subject, ...
0
votes
0answers
21 views

How to work with hooks and Posts to posts plugin?

I am using Scribu's Posts to posts plugin to create connections between posts. For example I have custom post type Lesson, and to every lesson one (or more) Teacher can be connected. Connection is ...
0
votes
0answers
14 views

Hook upon database insertion?

I have downloaded a plugin that inserts a new row into a table in my database. I want to perform a calculation on this row as soon as it is inserted into the database, in my own plugin. I've seen a ...
1
vote
0answers
21 views

Rewrite rule for page with plugin shortcode

I created a plugin to display a list of real estate properties on a page. The list is embedded into a custom page as a shortcode: [real_estate_list status="1"] The list is loaded from an external ...
0
votes
1answer
22 views

How to remove related post from home page

I am using thesis i am displaying related post using bellow snippet code.My problem is that i dont want load related post on home page.with the css trick we can make it display none but it loads so i ...
0
votes
1answer
34 views

'comment_post' hook doesn't seem to work? [closed]

This is driving me crazy - Does anyone know why this 'comment_post' hook doesn't seem to work!? I've basically written an entire email notification plugin for it and it's failed on the first step. ...
0
votes
0answers
15 views

hook for adding a new column in woocommerce subscriptions

I try to add a new column in Woocommerce subscriptions, I would like to know what hook i will need to display my new column Thank you Nilda
0
votes
1answer
30 views

Which Hook? Hide attachments from specific post types in media library

as the title implies - I would like to suppress attachments of a specific post type(s) from showing up in the "Media Library" Not asking for a code example, but if someone can point me to the right ...
0
votes
1answer
48 views

What hook to add at start of WordPress load

I want to add a hook that is the first thing that runs every and any time someone hits a page, post or other WP piece of content on my site, and before anything else in WordPress executes. Can you ...
0
votes
0answers
8 views

Hooking into action that fires in wp_head from widget on front end [duplicate]

I have a custom action hook for which the do_action() is executed in a function that hooks into the wp_head action. I would like to run add_action() for that custom action hook from the front-end ...
-1
votes
1answer
112 views

Remove word “Category” from WooCommerce product page [closed]

I'm trying to remove the word Category from the product page. As far as I know the code that displays that is woocommerce_template_single_meta located into content-single-product.php file: ...
1
vote
0answers
23 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 ...
0
votes
1answer
24 views

Filter Content on all Post Types

I had this idea to introduce a 'post type footer' using Advanced Custom Fields so that my users could set up common, reusable messages or calls to action and have them appear after the content of a ...
0
votes
1answer
22 views

Bulk action hook for admin pages which uses WP_List_Table

I have an admin page which I added using add_submenu_page function which is listing some custom data using WP_List_Table class. I have defined the bulk actions options in get_bulk_actions and it ...
0
votes
2answers
35 views

How to intercept a 404 error

I'd like to intercept 404 errors and do some things before to show the 404 error page. How can intercept the 404 error?
1
vote
1answer
52 views

Execute a function when admin changes the user role

How can I execute a function, when admin changes the user role of a user? I have two user roles: one is agent and the other one is client . My need is that when admin changes the user role of ...
1
vote
1answer
19 views

Are all hooks/functions tied to Kses meant for sanitization?

I'm currently learning WordPress hooks and am delving into core to see what's happening in there. I noticed there are filters in wp-includes/default-filters.php with PHP comments about Kses. I wasn't ...
0
votes
2answers
48 views

hook filter after the_content on a specific page

I've made a function to hook after the_content. This is only working on certain pages/posts. It's working on the default template but not on my custom one's. function insertFootNote($content) { ...
1
vote
2answers
36 views

How to use output buffering in Wordpress hooked functions?

It doesn't seem that output buffering takes into account echo's from within hooked functions. function buffer_start() { ob_start(); } function buffer_end() { ob_end_flush(); } add_action('init', ...