我在孩子的functions.php 中遇到错误。这里有什么问题?
致命错误:无法在 .../functions.php 中重新声明 wpst_get_filter_title()(之前在 .../functions.php:20 中声明)在线 ...
父母的functions.php:
function wpst_get_filter_title() {
$title = '';
$filter = '';
if ( isset( $_GET['filter'] ) ) {
$filter = $_GET['filter'];
} else {
$filter = xbox_get_field_value( 'wpst-options', 'show-videos-homepage' );
}
switch ( $filter ) {
case 'latest':
$title = esc_html__( 'Latest videos', 'wpst' );
break;
case 'most-viewed':
$title = esc_html__( 'Most viewed videos', 'wpst' );
break;
case 'longest':
$title = esc_html__( 'Longest videos', 'wpst' );
break;
case 'popular':
$title = esc_html__( 'Popular videos', 'wpst' );
break;
case 'random':
$title = esc_html__( 'Random videos', 'wpst' );
break;
default:
$title = esc_html__( 'Latest videos', 'wpst' );
break;
}
return $title;
}
孩子的functions.php:
if ( ! function_exists( 'wpst_get_filter_title' ) ) :
function wpst_get_filter_title() {
$title = '';
$filter = '';
.
.
.
return $title;
}
endif;