doutan5844 2019-05-24 09:31
浏览 54

如何删除插件类中的wordpress中的动作?

I'm using awesome support plugin for creating a ticket system in my project , the problem I have is that support plugin will add some fields into Users Admin page which I don't want them. I searched inside plugin code and I've found the action that is used to put the fields in users page and I want to remove that action.

I tried removing its action by using this code:

remove_action('wpas_all_user_profile_fields', array( WPAS_User::get_instance() , 'profile_phone_fields'), 10)

and it is working and the fields doesn't show on users page but I'm getting a fatal error inside my debug.log which says:

 PHP Fatal error:  Uncaught Error: Class 'WPAS_User' not found in ...

the plugin class that is something like this

class WPAS_User {

  public function __construct() {
     add_action( 'wpas_all_user_profile_fields', array( $this, 'profile_phone_fields' ), 10, 1 );
 }


  public static function get_instance() {

        // If the single instance hasn't been set, set it now.
    if ( null == self::$instance ) {
            self::$instance = new self;
        }

        return self::$instance;
  }

. 
.
.
}
  • 写回答

1条回答 默认 最新

  • dounayan3643 2019-05-24 10:13
    关注

    Do you include in your php the name of the file ?

    <?php include('yourfile.php') ?>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line