Mengxin asked why php is in return'.. .' Call <? php;? > inside

how does php call this output in return""
I use 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;

how do I write it?

Aug.07,2021

if ( $format && array_key_exists( $format, $icons ) ) {
    return '<?php echo _get_post_views(); ?>';
}

change:

if ( $format && array_key_exists( $format, $icons ) ) {
    echo _get_post_views();
    return '';
}

return ''._get_post_views();
Menu