Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

3
votes
1answer
87 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 ...
0
votes
1answer
69 views

WP_query hooks before execute a search query

Anybody knows if there's a hook before execution of a search query (not in main loop) in order to change the 's' parameter to avoid Wordpress' phrase splitting? Examples are welcome... thanks P.S.: ...
0
votes
1answer
55 views

Custom Fields as Post Type Options

Im using a theme for vehicle listings and the WPUF Pro plugin for frontend submitting. WPUF plugin automatically reads the taxonomies of themes post_type (vehicle), but the theme got vehicle ...
0
votes
0answers
75 views

Add “data-” attribute to image links

Is it possible to add an attribute and value to image links? I currently have: <a href="#"> <img class="img-responsive aligncenter wp-image-1286 size-full" src="#" alt="..." width="858" ...
9
votes
3answers
136 views

Generate dormant hook references

It seems a lot of plugin developers take the time to add filter/action hooks to let users tweak their products’ functionality. Which is great, but what they often don’t do is provide a list of hooks ...
0
votes
1answer
111 views

Update post meta using pending_to_publish hook

Below is my code for updating post meta. function changePostExpireDatetime( $post ){ $featurePlanID = get_post_meta($post->ID, 'post_price_plan_id', true ); ...
0
votes
1answer
111 views

Woocommerce single_product_summary hook not working

I'm trying to add my own custom fields to the single product summary after the main product's title output on my product page. I've looked into the woocommerce documentation ...
0
votes
1answer
67 views

Set Default Category if user do not set any in admin - before create post

Is there some option "hook" to set default category for custom_post_type if user do not choose any ? For example in RoR it's very simple - just use before_save filter and You can set whatever You ...
1
vote
1answer
122 views

Can I remove WooCommerce main content hook?

<?php /** * woocommerce_before_main_content hook * * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content) * @hooked woocommerce_breadcrumb ...
0
votes
0answers
11 views

What Will Happen If I do This Hook-ing Pattern?

I am creating a custom hook inside a shortcode like this: do_action("my_custom_hook", $param_1, $param_2, $param_3); I then creating a file containing a class and hooks like the following: class ...
0
votes
1answer
62 views

How do I hook into the container of wp_nav_menu?

I know I can edit the items within the wp_nav_menu by declaring a custom walker, but I want to add some code just inside the container, which isn't handled by a walker. It's in ...
0
votes
1answer
21 views

Can an RSS item be altered with a hook?

I would like to alter the content of each item in a site's RSS feed with a regular expression. The rss2_item hook is close but it is run just after the item has been output, so is only really useful ...
0
votes
0answers
28 views

Checking if text from product 2 is equal to product 1

I am using Woocommerce product addons to allow users to upload a pdf file when ordering 2 products. I would like the following logic to be applied when both items are in the cart. If filename ...
0
votes
0answers
22 views

Passing variables to JavaScript from multiple hooks

I use inside the hook 'wp_enqueue_scripts' the following code to deliver home_url() value to some javascript function in the module with handle 'rdhil_read_write_css'. It was fine and the javascript ...
1
vote
0answers
157 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. ...
2
votes
1answer
49 views

Over write plugin templates

Is that possible for overwriting a plugin templates via making a folder in theme file and copy the file in that folder and altering the content [both folder and file name have the same name as ...
0
votes
1answer
17 views

Getting entry ID from frm_email_message filter in formidable

Using the filter frm_email_message in formidable I want to change the message body in an email but I need to get the entry id. I can get it using a different filter frm_email_value. Is there a way ...
0
votes
0answers
47 views

how to find add_filter hook name?

I'm using jetpack photon. but it's not cache sidebar widget's image. so I found this code function jeherve_photonize_text_widget_images( $content ) { if ( class_exists( 'Jetpack_Photon' ) ) { ...
0
votes
0answers
12 views

Which filter called the function [duplicate]

I've created a function that does some replacing of urls and is called by several filters: add_filter( 'theme_root_uri', array( $this, 'replaceCDN' ), 99, 1 ); add_filter( 'plugins_url', array( ...
0
votes
1answer
95 views

How to customize category_description()?

In a website I am working on ,there are 50 categories + sub categories, each has a a very long description text, then in an archive page I display all the titles of the categories + their description ...
-1
votes
2answers
122 views

How to hook into permalink when publishing-saving post?

I want to know how I can change the structure of the permalink to my desired one before saving or publishing my post in Wordpress? For instance, when I add the title like the wordpress blog in my post ...
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?
0
votes
2answers
108 views

Yoast SEO hooks overriding themselves

I have some dynamic templates where I have to customize the canonical links. According to Yoast documentation the hook to use is wpseo_canonical I have two functions pointing to different pages ...
0
votes
0answers
26 views

Can I use a hook other than 'init' to handle form submissions?

I'm developing a plugin that handles form submissions at several different points. As such, I was relying on being able to use global $post and get_query_var to determine which stage the user is at ...
1
vote
2answers
49 views

Don't delete a page if it holds users

I have to do something but I just can't come up with a way to do it. On one hand I have created pages who are companies. So every page is a company-page. On the other hand I have created users who ...
0
votes
0answers
9 views

What is the earliest hook you can piggyback on to check terms/taxonomy for a collection view?

I am attempting to set up some conditional logic based on whether or not get_the_terms( $post->ID, 'product_cat' ) has the term 'Photographs' in it. Currently I'm using the wp hook, but that ...
0
votes
0answers
29 views

Event fired when file attached to a post?

I am using a Plugin called Attachments which allows you to attach any number of files which each have there own defines meta data into a post. Adding new files uses the WP Media Library shown below. ...
0
votes
1answer
34 views

Block Update Profile Errors

I'm trying to validate the form users submit when updating their profile data. I've hooked into user_profile_update_errors. It prints errors correctly to the user, however, it still allows the ...
0
votes
0answers
39 views

How to trigger function on theme delete?

Tryed to find action or some hook to fire a function when theme is being delited, but didn't found any hook.. May be someone can tell if there's a way to fire my function on themes delete event ? I ...
1
vote
1answer
28 views

What hook/filter can I use to add/edit/show/hide the title under (on hover) links on the table view?

I'm not entirely sure the name given to these links, but the class is called "row-actions".
1
vote
2answers
566 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
20 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
19 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
47 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 ...
2
votes
1answer
247 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
41 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
19 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
110 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
60 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
169 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
34 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
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
1answer
60 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
835 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
125 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
26 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
1k views

WooCommerce - Overwrite action hook [closed]

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
42 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 ...
1
vote
1answer
57 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
306 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 ...