This question already has answers here: Get a list of all registered actions (2 answers) Closed 6 years ago.admin管理员组文章数量:1130349
Given the following code:
<form>
<h1> My form <h1>
<input type="text" />
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
</form>
How can I locate the "woocomerce_checkout_after_customer_details" defined?
It prints a button where I have to add functionality, maybe can I just use add_action() to add new features? in that case: how can I use remove_action() to stop rendering the old button?
Thanks in advance
This question already has answers here: Get a list of all registered actions (2 answers) Closed 6 years ago.Given the following code:
<form>
<h1> My form <h1>
<input type="text" />
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
</form>
How can I locate the "woocomerce_checkout_after_customer_details" defined?
It prints a button where I have to add functionality, maybe can I just use add_action() to add new features? in that case: how can I use remove_action() to stop rendering the old button?
Thanks in advance
Share Improve this question edited Nov 23, 2018 at 9:49 Krzysiek Dróżdż 25.6k9 gold badges53 silver badges74 bronze badges asked Nov 23, 2018 at 9:31 JnewbieJnewbie 132 bronze badges 01 Answer
Reset to default 0You can find out what actions are assigned to given hook with this code:
function print_filters_for( $hook = '' ) {
global $wp_filter;
if( empty( $hook ) || ! array_key_exists( $hook, $wp_filter ) ) {
return;
}
print '<pre>';
print_r( $wp_filter[$hook] );
print '</pre>';
}
Call it where you need it. In your case:
<form>
<h1> My form <h1>
<input type="text" />
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
print_filters_for( 'woocommerce_checkout_after_customer_details' );
</form>
This question already has answers here:
Get a list of all registered actions
(2 answers)
Closed 6 years ago.
Given the following code:
<form>
<h1> My form <h1>
<input type="text" />
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
</form>
How can I locate the "woocomerce_checkout_after_customer_details" defined?
It prints a button where I have to add functionality, maybe can I just use add_action() to add new features? in that case: how can I use remove_action() to stop rendering the old button?
Thanks in advance
This question already has answers here: Get a list of all registered actions (2 answers) Closed 6 years ago.Given the following code:
<form>
<h1> My form <h1>
<input type="text" />
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
</form>
How can I locate the "woocomerce_checkout_after_customer_details" defined?
It prints a button where I have to add functionality, maybe can I just use add_action() to add new features? in that case: how can I use remove_action() to stop rendering the old button?
Thanks in advance
Share Improve this question edited Nov 23, 2018 at 9:49 Krzysiek Dróżdż 25.6k9 gold badges53 silver badges74 bronze badges asked Nov 23, 2018 at 9:31 JnewbieJnewbie 132 bronze badges 01 Answer
Reset to default 0You can find out what actions are assigned to given hook with this code:
function print_filters_for( $hook = '' ) {
global $wp_filter;
if( empty( $hook ) || ! array_key_exists( $hook, $wp_filter ) ) {
return;
}
print '<pre>';
print_r( $wp_filter[$hook] );
print '</pre>';
}
Call it where you need it. In your case:
<form>
<h1> My form <h1>
<input type="text" />
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
print_filters_for( 'woocommerce_checkout_after_customer_details' );
</form>
本文标签: woocommerce offtopicHow can I locate where the actions are defined
版权声明:本文标题:woocommerce offtopic - How can I locate where the actions are defined? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749157515a2324844.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论