我的文件在这里
-> theme_folder_parent/fastwp/fastwp.user.interface.php
-> theme_folder_child/fastwp/fastwp.user.interface.php
我在我的孩子主题中复制了同一个文件而我编辑但没有...
我的班级有这个功能
static function displayMenu($id = '', $class = 'menu', $echo = true){
global $fwp_data;
//$logo = isset( $fwp_data['fwp_logo']['url'] ) ? esc_url( $fwp_data['fwp_logo']['url'] ) : fwp_main_theme_url . '/assets/img/logo-square@2x.png';
$type = isset( $fwp_data['fwp_menu_location'] ) ? $fwp_data['fwp_menu_location'] : '';
$soc_net = $soc_net2 = '';
if( !empty( $fwp_data['menu_social_media'] ) && is_array( $fwp_data['menu_social_media'] ) ) {
foreach( $fwp_data['menu_social_media'] as $sn) {
$lu = array_map( 'trim', explode( '|', $sn ) );
if( isset( $lu[0] ) && isset( $lu[1] ) ) {
$soc_net .= '<li><a class="navIcon" href="'. esc_html( $lu[1] ) .'"><i class="'. esc_attr( $lu[0] ) .'"></i></a></li>';
}
}
}
if( !empty( $fwp_data['menu_social_media2'] ) && is_array( $fwp_data['menu_social_media2'] ) ) {
foreach( $fwp_data['menu_social_media2'] as $sn) {
$lu = array_map( 'trim', explode( '|', $sn ) );
if( isset( $lu[0] ) && isset( $lu[1] ) ) {
$soc_net2 .= '<li><a class="navIcon" href="'. esc_html( $lu[1] ) .'"><i class="'. esc_attr( $lu[0] ) .'"></i></a></li>';
}
}
}
$menu_markup = '<header id="header" class="clearfix">
<ul class="social-list clearfix alignleft">
%s
</ul>
<div id="menu-button">
<div class="cursor">%s
<div id="nav-button"> <span class="nav-bar"></span> <span class="nav-bar"></span> <span class="nav-bar"></span> </div>
</div>
</div>
</header>';
$menu_markup .= '<nav id="main-nav">
<ul id="options" class="option-set clearfix" data-option-key="filter">
%s
</ul>
<ul class="social-list clearfix">
%s
</ul>
</nav>';
$menu = sprintf( $menu_markup, $soc_net, ( isset( $fwp_data['fwp_menu_title'] ) ? esc_html( $fwp_data['fwp_menu_title'] ) : 'Menu' ), UI_getMenu( $id, $class, false ), $soc_net2 );
if( $echo == false ) return $menu;
echo $menu;
}
它不是一个可插拔功能,因为没有function_exists
。覆盖此功能的最佳方法是什么?