「Lightning フォント設定」の部分のソースコードは下記サイトでいう最悪のパターンで定義されているようです。
【WordPress】クラスによるアクション/フィルターへのフックを解除する
ただし、
if ( ! class_exists( 'Vk_Font_Selector_Customize' ) )
の記述があるのが救いで子テーマのfunctions.phpに
get_template_part( 'inc/vk-font-selector-config' );
を記述し、
/inc/vk-font-selector-config.php
/inc/vk-font-selector/class-vk-font-selector.php
を上記構造を保ったまま子テーマにコピーして
子テーマの/inc/vk-font-selector/class-vk-font-selector.php
の
下記を以下のように編集すれば良さそうです。
変更前
public function __construct() {
add_action( 'customize_register', array( $this, 'register' ) );
add_action( 'wp_head', array( $this, 'dynamic_header_css' ), 5 );
add_action( 'wp_footer', array( $this, 'load_web_fonts' ) );
}
変更後
public function __construct() {
add_action( 'customize_register', array( $this, 'register' ) );
//add_action( 'wp_head', array( $this, 'dynamic_header_css' ), 5 );
//add_action( 'wp_footer', array( $this, 'load_web_fonts' ) );
}
P.S.
こちらトピックとも関連性があるような気がします。
開発者の方へ
Classを定義して使用するのは自由だと思います。
しかし、最低でもクラスにはシングルトンパターンを使用しないと
こういう問い合わせには大変苦労すると思います。