0

我正在使用很棒的支持插件在我的项目中创建票证系统。

我遇到的问题是支持插件会将一些字段添加到我不想要的用户管理页面中。

我在插件代码中进行了搜索,发现了用于将字段放入用户页面的操作,我想删除该操作。

我尝试使用以下代码删除其操作:

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

它正在工作,并且这些字段没有显示在用户页面上,但是我的 debug.log 中出现了一个致命错误,它说:

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

像这样的插件类

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;
  }

. 
.
.
}
4

1 回答 1

0

您是否在 php 中包含文件名?

<?php include('yourfile.php') ?>
于 2019-05-24T10:13:48.033 回答