【问题标题】:Override plugin ajax function in theme function.php wordpress覆盖主题function.php wordpress中的插件ajax函数
【发布时间】:2019-08-30 21:51:16
【问题描述】:

我想重写插件ajax功能,需要自定义

我的插件钩子是:

add_action( 'wp_ajax_nopriv_custom_membership_register_user', 'custom_membership_register_user' );

我想在主题function.php中覆盖这个函数

【问题讨论】:

    标签: wordpress plugins


    【解决方案1】:

    您需要使用remove_action删除现有函数的调用

    remove_action( 'wp_ajax_nopriv_custom_membership_register_user', 'custom_membership_register_user' );
    remove_action( 'wp_ajax_custom_membership_register_user', 'custom_membership_register_user' );
    

    这篇文章解释了很多https://wpshout.com/practical-remove_action-remove_filter/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-11
      • 1970-01-01
      • 1970-01-01
      • 2012-06-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-22
      • 1970-01-01
      相关资源
      最近更新 更多