萌新求问 php怎么在 return'. .' 里面调用<?php ; ?>

php怎么在 return'' 里面调用这个输出<?php echo _get_post_views(); ?>
我用的是 wordpress

if ( !function_exists( 'vlog_post_format_icon' ) ):
    function vlog_post_format_icon() {

        $format = vlog_get_post_format();

        $icons = array(
            'video' => __vlog( 'label_video' ),
            'audio' => __vlog( 'label_audio' ),
            'image' => __vlog( 'label_image' ),
            'gallery' => __vlog( 'label_gallery' )
        );

        //Allow plugins or child themes to modify icons
        $icons = apply_filters( 'vlog_modify_post_format_icons', $icons );

        if ( $format && array_key_exists( $format, $icons ) ) {

            return '怎么在这里调用<?php echo _get_post_views(); ?>';

        }

        return '';
    }
endif;

<?php echo _get_post_views(); ?>该怎么写?

阅读 2k
2 个回答
if ( $format && array_key_exists( $format, $icons ) ) {
    return '怎么在这里调用<?php echo _get_post_views(); ?>';
}

改:

if ( $format && array_key_exists( $format, $icons ) ) {
    echo _get_post_views();
    return '';
}
return '怎么在这里调用'._get_post_views();
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题