Questions tagged [hook]

1

votes
1

answer
33

Views

Set hook exception programmatically

In a custom module for prestashop, how would one define a hook exception for a special page (front controller) of the own custom module? I know that i can register for hooks in the install() method of the module by e.g. $this->registerHook('displayHome') and hooks can be configured in the prestashop...
x29a
1

votes
2

answer
92

Views

Passing 'this' pointer to MouseProc of SetWindowsHookEx

Generally, whenever we want to wrap a Window/Thread in a C++ object, we do so by passing the this pointer via SetWindowLong/GetWindowLong or SetProp/GetProp for a Window, and as lpParameter for CreateThread/etc. My question is specific to Hooks. What is the elegant approach to pass the 'this' pointe...
subdeveloper
1

votes
1

answer
43

Views

Does useState not call a rerender when working with object states?

I have a firebase project with a firestore database document that looks like this. document-id => item1 => {detail: 'value', title: 'value', image: 'value} item2 => {detail: 'value', title: 'value', image: 'value} ... My React component that renders this looks something like this: const [data, setD...
Tristan Trainer
1

votes
2

answer
111

Views

How to apply a keyboardhook on F1 within the application

For our application we created a Online Help where customers can look up stuff about our application. They can reach this in the menus but I also wanted to make it available by pressing the F1 key where ever you are within our application(since this is mostly used for Help within other applications)...
MonkeySleeve
1

votes
1

answer
31

Views

Unexpected behavior with “git commit .” when pre-commit hook modifies staged files

In my experience git commit -a has had equivalent behavior to git commit . However, recently I have created a pre-commit hook that automatically formats my source code and now git commit . has some unexpected side-effects: the file that is committed ends up as modified in the working directory and i...
Eric Roller
0

votes
0

answer
4

Views

How to add shutdown hook in Apache Flink job?

I'm using redis connection pool in my flink job. I need to release all connections when the job get cancelled or finished. How can I add a shutdown hook for my flink job?
孙兴斌
1

votes
0

answer
504

Views

WooCommerce. How to add a wrapping div around single pages product descriptions?

I am looking for a filter/hook to wrap some extra div around my woocommerce single pages product descriptions included to the tabs. Right now i have Product Title My Product Description Text And thats what i would like to achieve instead Product Title My Product Description Text So the container j...
romu
1

votes
1

answer
333

Views

mutt - difference between account-hook and folder-hook

What is the difference between account hooks and folder hooks in Mutt? If I understand Mutt correctly, it can only have one IMAP connection open at a time. So why can't I just let an account hook to set up everything? What needs to be set in account hooks and what should be left for folder hooks and...
Mark Howard
1

votes
0

answer
147

Views

how to add filter by attribute to woocommerce in admin panel

is there any way to add filter (search) by attribute function in the woocommerce admin panel something like that:
adek44
1

votes
0

answer
173

Views

PyCharm | git pre-commit hook for inserting last change date causes that the file will be flagged as edited (which is the case). Workaround?

I tried to use a git pre-commit hook for inserting informationen about the datetime of the last change to each commited file. The script works fine, but... It seems that PyCharm resets the 'file-has-been-changed-flag' before the git hook executes. Therefore the inserting of the last-checkin-timestam...
sfx2k
1

votes
0

answer
253

Views

Xposed: How to hook Constructors with parameters in Nested Class

In order to analyse app, I need to hook public final class LoadedApk { …… static final class ReceiverDispatcher { ReceiverDispatcher(BroadcastReceiver receiver, Context context, Handler activityThread, Instrumentation instrumentation, boolean registered) { …… } final class Args extends Broa...
Petitz
1

votes
0

answer
142

Views

Capturing global paste event using hook to WH_GETMESSAGE not working

Purpose: To capture global paste. Whenever any of ctrl + v, edit->paste and right click->paste is done in any application. Be it file paste or text paste. For that, I am installing a hook to the WH_GETMESSAGE and check for WM_PASTE message using the message parameter of MSG structure returned. Foll...
Shameel Mohamed
1

votes
1

answer
236

Views

SimpleMessageListenerContainer shutdowntimeout

I am using spring-rabbit-1.7.3.RELEASE.jar I have defined a SimpleMessageListenerContainer in my xml with shutdownTimeout parameter. bean id='aContainer' class='org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer'> When my service shuts down and there are still messages in 'aQueu...
GGKamal
1

votes
1

answer
1.3k

Views

After a successful payment, What hook is triggered in Woocommerce

In Woocommerce, to send sms payment information to the customer, I need to activate a trigger after a successful payment. But I didn't find any hook do it This is my plugin code: if ( isset( $this->options['wc_notify_customer_payment_successful_enable'] ) ) { add_action( '####Action to be used here#...
Milad Karimi
1

votes
0

answer
93

Views

Weird incorrect behaviour when detouring connect from ws2_32?

So currently i have the following code which is just a simple trampoline type hook for ws2_32 to hook connect in order to eventually add a proxy to an application. The problematic area is inside int __stdcall connect_FUNC(SOCKET s, const struct sockaddr* name, int namelen). Whilst i don't need to un...
Kasi
1

votes
0

answer
257

Views

C++ MinHook function hooking - error: invalid conversion

I am trying to use the MinHook library, but when I try to compile the example code I get the following error: E:\Dev\C++\detour\main.cpp:50:98: error: invalid conversion from 'int (__attribute__((__stdcall__)) *)(HWND, LPCWSTR, LPCWSTR, UINT) {aka int (__attribute__((__stdcall__)) *)(HWND__*, const...
SilencePhil
1

votes
1

answer
727

Views

Custom Button in WooCommerce add order admin page

I want to add a custom button in the page where admin can manually create new order. Admin -> Woocommerce -> order -> Add order After i add product and when clicked edit button can i show a custom button near to Add Meta button ? I cannot find a hook to use. add_action( 'woocommerce_after_order_item...
melvin
1

votes
1

answer
61

Views

How do git server hooks run on git server hosted on windows [duplicate]

This question already has an answer here: Git Server Hooks - Are they executed locally on the client/clone machine? 3 answers Very new to GIT. This is more an educational question! Our bare repo is hosted on windows server shared network folder(file:// protocol). We use eGit on our local machines t...
PCash
1

votes
0

answer
44

Views

Need Example Using @wordpress/hooks In Node Program

I'd like to add the ability to hook into a Node.js program I am writing for release. Ideally, I'd like something like the Wordpress Hook system (traditionally for PHP and recently for Javascript!) that is very robust, yet simple. It seems WP has released a Node module for just this purpose: https://...
Trees4theForest
1

votes
1

answer
543

Views

Woocommerce Address Update Validation on My Account Page using Hook

I want to add a validation on billing phone when the address is updated through the My Account Page. Form Location: http://www.example.com/my-account/edit-address/billing My Code so far as below:- add_action( 'woocommerce_customer_save_address', 'custom_validation'); function custom_validation($use...
Sharique Anwer
1

votes
0

answer
281

Views

Pre-commit hook not working in Github Desktop

I set up a pre-commit hook on my Mac to avoid committing with rubocop errors: echo -e '[RUBOCOP] Init...' RUBOCOP=`bundle exec rubocop` if [ 'grep $RUBOCOP 'no offenses detected' -c' == '1' ]; then echo -e '[RUBOCOP] 👍 approved.' exit 0 else echo -e '[RUBOCOP] ✋ \n' bundle exec rubocop exit 1 f...
davegson
1

votes
1

answer
727

Views

Woocommerce auto cancel on-hold after X days

Since I will be using offline payments (bank billets - standard in Brazil). What I am trying to achieve is to auto-cancel 'on-hold' orders after 9 days, which is when the billet expires. I found a few references of code: one from woocommerce github and another from stackoverflow. What the code does...
Daniel Romagnoli
1

votes
0

answer
395

Views

Auto-Restock Woocommerce Canceled orders for time-out orders

So @LoicTheAztec helped me out with some code to get auto-restock working for canceled orders. What I have found is that the code works only when the Admin cancels an order in the panel. When Payment isn't fulfilled or if the customer cancels his order stock isn't replenished. Have no idea how I wou...
Daniel Romagnoli
1

votes
0

answer
83

Views

How to Unregister EasyHook.dll, EasyHook64.dll, and EasyLoad64.dll

I'm using EasyHook dlls & performing DoDragDrop API hooking, everything is working fine, but how to release following 3 dlls 1.EasyHook.dll 2.EasyHook64.dll 3.EasyLoad64.dll these dlls are hooked to explorer.exe even after closing my application, they release once I restart my explorer.exe So far...
Krish
1

votes
1

answer
400

Views

Change user role if checkout custom checkbox is checked in WooCommerce

I'm trying to add a custom function to my child-themes functions.php file where a checkbox is added to the bottom of the billing details form on the checkout page. This checkbox asks the customer if they'd like to become a wholesale customer. function customise_checkout_field_with_wholesale_option...
jvandelaar
1

votes
1

answer
783

Views

Intercepting function calls in javascript

I appreciate if anyone can tell me how to intercept a function call in javascript. I know it is possible with making use of proxies. for example I tried the code below to intercept it but now I want to intercept toDataURL(). in order to call toDataURL you need to create a canvas element first.So, no...
Bathooman
1

votes
0

answer
11

Views

Make Gitlab warn devs of breaking changes upon git pull/clone/checkout

I've been looking for a way to warn a developer on a repo of breaking changes upon a git pull or a git clone or a git checkout (either one would be fine to begin with). Example: $ git pull --rebase origin XXX remote: Counting objects: 67, done. remote: Compressing objects: 100% (50/50), done. remote...
StephaneMombuleau
1

votes
1

answer
184

Views

Respond to a Packet Received in The NetFilter at Kernel

I'm working on Linux 4.13.x. And I'm considering to send a packet response in the kernel. Consider an echo TCP or UDP server running in the userland and there is also another node running a TCP or UDP client. Clients are sending requests to the server. I want to send the packet response back to the...
Alireza Sanaee
1

votes
1

answer
156

Views

Parallel TestNG - cucumber.runtime.CucumberException: No qualifying bean of type 'com.hooks.CustomHook' available

I have my testng.xml like so: It is running fine when thread-count='1', so it runs the same tests on Chrome and Firefox one by one sequentially. But when switching to 2 thread-count, in order to run them simultaneously on 2 browsers, I have got this error: cucumber.runtime.CucumberException: No qual...
Hugh Bui
1

votes
2

answer
1.3k

Views

Angular (2+) : how can i know from parent component when all child-components were initialized?

is there a lifecycle hook so-called 'ngAfterAllChildrenInit' because ngAfterViewInit is called before ngOninit of the children, I am trying to avoid hacking with setTimeOut or emitting events from all the children and collecting them and then do what I want ( that depend on the children initializati...
Shaul Naim
1

votes
0

answer
113

Views

Add extra fields via hook woocommerce_default_address_fields?

We want to add extra fields to the billing and shipping addresses to the account of registered customers (users with Customer role). We also want the user to be able to edit those extra fields in their settings panel, under ”My Account” -> ”Addresses” -> ”Edit' I found a way to do this, n...
Olle Raab
1

votes
2

answer
51

Views

Add a custom item above logout item in Woocommerce my account menu

I've been googling for a while now, but I can't seem to find an answer, nor anyone else with the same issue. I'm trying to add a menu item, 'My Files', above the 'Logout' item. Here's the code I'm using: // Add Menu Item function my_account_menu_items( $items ) { return array_merge( array_slice( $it...
Tarik Druskic
1

votes
0

answer
218

Views

Mongoose post init async not working

Mongoose post 'init' is apparently unable to perform asynchronously as documented. I'm using the latest [email protected] and @types/[email protected] packages. schema.post('init', function (doc, next: any) { gunzipJSON(this.zipped).then(obj => { this.categories = deserialize(Category, obj) || []; next()...
Jackpile
1

votes
0

answer
61

Views

PMPRO before checkout hook or filter

I am using a Paid Membership pro plugin in WordPress everything is working fine and there were no issues at all before this I have customized many functionalities with the help of the following link. https://www.paidmembershipspro.com/hooks-filters/ Now, I want to execute my custom function Before C...
Mohsin Abbas
1

votes
1

answer
144

Views

Get order custom post meta data for specific Emails Notifications in WooCommerce

I created a custom form field that gets added to the WooCommerce checkout form. Everything is working as expected except I can't figure out how to get the custom field to output to the new order customer email (in this particular case, it is the on-hold email) - it is in the email sent to admins th...
Brett
1

votes
1

answer
194

Views

Add a custom text when a product sold individually message in Woocommerce

In Woocommerce I would like to add a text message in single product pages if the product is sold individually, just after short description: In this screenshot I would like to replace the red rectangle by 'You can only buy one piece of this product'. Any help is appreciated.
1

votes
1

answer
165

Views

Override Woocommerce WC_Checkout process_customer method to new plugin

I Will like to override process_customer() method of WooCommerce class WC_Checkout: class WC_Checkout { protected function process_customer( $data ) { How can I override the functionality of this method in new created plugin? I have not found any hook or filter, that override that current method...
rescue1155
1

votes
1

answer
432

Views

Woocommerce replace Storefront header with Elementor header

I am pulling my hair out trying to replace the default StoreFront Theme header with a custom header created using Elementor (using a shortcode). However, my code only seems to replace the default nav buttons with blank spaces. Any ideas on what I am mising? My code: add_action('init', 'replace_heade...
Giuls
1

votes
1

answer
28

Views

Portal.getUser is not working after user logs in

We are having a problem on Liferay we don't know how to deal with. We need a Hook filter to catch user requests to a particular URL pattern (which is direct accesses to document library files) as with: http://localhost:8080/documents/20181/323505/dddd.pdf/d188618b-56c5-4be6-bf94-548fac22bc24 Key Use...
1

votes
0

answer
60

Views

Woocommerce - Replacing Variable pricing text through a function

I am currently looking to add multiple currencies to be displayed in my variations data. I would like to be able to replace the html generated by available variations function in woocommerce, specifically 'price_html' => $show_variation_price ? '' . $variation->get_price_html() . '' : ''...
Mike

View additional questions