0

我只是想在 wordpress 上写我自己的插件

我写这个是为了从 github 原始文件中下载代码

邮政:

[github raw="https://raw.github.com/pmontu/PatientRecordsWindows/402fcb1706f408428aa1a6df2a82fbbba1fc4071/PatientRecordsWPF2/Domain/Media.cs"]

插入:

function github_func( $atts ) {
    extract($atts);
    return file_get_contents($raw);
}
add_shortcode( 'github', 'github_func' );

它可以工作,但带有标签的代码无法正确显示

在此处输入图像描述

所以我试图将语法荧光笔插件应用于下载的代码

使用语法荧光笔:

[c language="#"][github file="https://raw.github.com/pmontu/PatientRecordsWindows/402fcb1706f408428aa1a6df2a82fbbba1fc4071/PatientRecordsWPF2/Domain/Media.cs"][/c]

但看起来优先级搞砸了 突出显示之前未获取 url

如果调用 do_shortcode(),我读到嵌套的短代码确实有效,我究竟如何实现它?

4

0 回答 0