hooks's questions - English 1answer

1.603 hooks questions.

One of the plugins we use have this code: class MailChimp_WooCommerce { private function activateMailChimpNewsletter() { $service = new MailChimp_Newsletter(); if ($this->...

I am using a plugin, and to get around something I need to add some text to the excerpt field on my posts, but I don't want to display the excerpt field data on the front end, but rather the post ...

I'd like to be have more control on the srcset on certain important images of my website if not all. By default the srcset includes all the sizes created by wordpress for all the images. I'd like to ...

I'm working on my first plugin and I have made a nice settings page which saves and works. But I have split it to few files and now I can't determine if field is checked.. I have also tried ...

The form is in post creating window. Ajax is posting values, but the values doenst renews. Where can be problem ? Ajax <script> function dynamic_Select(field, aid, value) { console.log(...

I'm having an issue where the attachment is being deleted despite me returning false function action_maybe_delete( $id ) { echo "Let's not delete Attachment id: " . $id ; // prevent the ...

I'm trying to insert a dropdown (via HTML string) in to every post I have. I'd like to add it before the post information, but below the website nav. bar and header. In the screenshot, you'll notice ...

I'm syncing my Wordpress authentication system with an secondary/external authentication system and my site has at least two ways of resetting the password, including: Password reset email User ...

I'm using a plugin that uses wp_update_user instead of password_reset and I need to use the password prior to hashing to sync the change to a secondary authentication system. Is there any way to do ...

Is it possible to use wp_remote_post to send http post requests to 3rd party api's? I wasn't able to successfully save the user object as a javascript variable, so I was hoping I could make an http ...

I have some code that generates a dropdown list of all my post files. I would like to add this dropdown to the top of every post page, right before the post content. What's the correct hook/action ...

I want to access my S3 bucket, and when I remove a file, use the delete_attachment hook to call to Amazon and delete those files ( we have a service that offloads files to S3 but doesn't delete them. ...

I have some posts that (in the actual post text on the backend) has some errant <strong> </strong> entries. I'm trying to filter these out before being rendered as HTML. (Note that I do ...

Is a way to pass my own parameters to the function in add_filter or add_action. For example take a look in the following code: function my_content($content, $my_param) { do something... using $...

I am working modifying an ecommerce plugin, and it makes uses of wp_update_user() function, and everytime the function runs another table (created by the plugin), gets updated too. The problem is that ...

What I want is to get the output of the Twitter oEmbed system into my actual posts. IMHO the embed output itself is high-quality, semantic HTML and I'd rather have it inside the post than in the embed ...

Is there a way to trigger the post saving or updating event in code? such as do_action('save_post', $post_id); The function here seems to imply that a WP_POST object needs to be passed in. Is there a ...

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 ...

How I add google tag manager to default registration page? So Ill can track the registration flow? Ill need to add a google the tagmanager script to the head and a tagmanager noscript to the body of ...

I've overwritten WooCommerce's review-order.php to change the checkout a little bit. Now everytime I add something to the hook woocommerce_review_order_after_order_total the contents get displayed ...

I am developing a e-commerce theme that requires an order page. I created a php file inside my theme folder named order-page.php and hope to access this page from the wordpress root url (example.com/...

I need to overwrite the wc_price in my theme's function as I need to make suitable changes into it based on my requirements. I have used add_filter( 'formatted_woocommerce_price', 'span_custom_prc'...

I'm currently working on writing my first OOP Plugin for Wordpress. To help out a little bit with structure I looked for, and found, a boiler plate that sets up the basics for me. In Main.php there'...

I have good experience in other CMS. but I'm very new in Wordpress. My goal is to intercept POST values in some of the form of a pre-existent site. Following documentation I've done the following ...

This question might be wrong, I am not sure about it. Because I am not clear on this. I know add_action it is used to to hook our function to the specified function. For example add_action('wp_head'.'...

I have a meta field called postexpiry, and I want to set the value to the publish date, + 2 weeks. So if today were October 3rd, I want the field to be set to October 17th. I was thinking about ...

I'm trying to create some custom REST API endpoints which get products with some special conditions, for example one endpoint for featured products. I tried to use the wc_get_products function like ...

I am building an application using WordPress Rest API. I want to make simple calls to the API, such as just /wp-json/wp/v2/posts and let the backend have a systematic way how to handle this and serve ...

I know this is duplicate of Why always one post missing but the solution suggested to use Hikari Hooks Troubleshooter plugin which was last updated 8 years ago and I was not able to comment on the ...

I would like to add an extra row to the Cart Table in Woommerce, but I can't find the right action. From this file https://github.com/woocommerce/woocommerce/blob/master/templates/cart/cart.php, I ...

I have a custom post type that always do math operation to its post_meta and other custom post type post_meta. For example: post-type 1 = cpt_product_order post-type 1 post_meta = ...

I am currently using code to add a custom field to the site-info.php & site-new.php in the network admin management to add a custom option to the database, this does work when I create a new ...

In what order add_action hooks execute? i.e. init wp_head wp_footer after_theme_setup etc... ??? ??? ??? EDIT: I've also posted my solution.

How can i add any type of PHP code to header section through plugin programmatically ? I did use add_action('wp_head', 'your_function'); function your_function() { echo ...

So in a nutshell I have a code that checks if an item is listed with a price or not on my website. If there is no price, or the price is 0 it currently shows "Call # to Order" My problem is I need ...

I need display custom block before H1 Title in my posts. Please, tell me. Is there any function or hook to implement this? I cant edit file single.php, because I create different single templates ...

I am trying to re-arrange Woocommerce Sensei hooked content. Basically, I would like to have course_image at the top (high priority). // code in sensei /includes/hooks/template.php <?php /...

Can someone helps me to understand the logic of WooCommerce for sending email on a completed order? If I'm not wrong, the mail is send when the order is marked complete, but I'm not able to find the ...

I want to add arrow (or anything like ...) after every menu item that have children menus. I know that there is some JavaScript solutions. But for some reasons (stability and ...), I don't want to ...

I use LearnDash plugin for e-learning courses. I am using the learndash hook for when a topic is completed to run some code. This looks a bit like this: add_action("learndash_topic_completed", "...

So I want to change top header line display. To do that I'm trying to override parent theme function with my edited function. When I do that my function override parent function, but next page content ...

Learning more about sessions I've gathered that a session_start() should come directly after <?php per Where exactly do I put a SESSION_START? and I wanted to play around and create a plugin that ...

I've been following this tutorial: https://www.kathyisawesome.com/add-a-custom-field-to-woocommerce-product/ on how to add a custom field to the front end, that saves to the order and is stored in a ...

I'm trying to access to a specific plugin function in my theme. I really don't know what I'm doing wrong. I tried with include, no luck. I tried wit add_action and do_action, no luck. What should I ...

I am looking for a way to replace all links on images. Currently when a user clicks an image it links to the source file. What I want it to do is to ink to: example.com/editor=12&image=filename....

I am trying to register an activation hook for my plugin. The plugin is using classes and the actual activation method is held in a separate admin class. Reading the documentation for ...

I want to add meta fields for the sites in my network (such as a thumbnail and a category). I know how to do this using get/add/update_site_option, but I'm wondering where I could put the UI to manage ...

I am trying to add a suffix through a filter hook to a product price in Wooommerce, but for some strange reason the woocommerce_get_price_html filter hook (like explained here) does not change ...

I would like to bulk delete WooCommerce product categories that only contain a certain number of products, is there a hook that provides this functionality?

Here is my code: add_action('template_redirect', 'ep_tags_redirect_lockout'); function ep_tags_redirect_lockout() { if ( is_user_logged_in() ) { return; } //echo 'XXXXXX'; if (...

Related tags

Hot questions

Language

Popular Tags