我想在子主题中重写此插件类:
class-config.php
namespace um;
if ( ! defined( \'ABSPATH\' ) ) exit;
if ( ! class_exists( \'um\\Config\' ) ) {
    /**
     * Class Config
     *
     * Class with global variables for UM
     *
     * @package um
     */
    class Config
    {
        //some code here...
    }
    //end class
}
 但正如您所看到的,这个类使用了一个名称空间,所以我不能只在函数中编写它。php:
functions.php
class Config
{
    //some new code here...
}
 我试图添加名称空间um在函数中。php,但它当然不起作用。
有人有想法吗?:)