我正在使用此代码,但在IF
部分不知道为什么会这样。
$instac = get_the_author_meta( \'au-instagram\', $current_author->ID );
if (!empty($instac)) {
return \'<a href="\' . $instac . \'" class="kalim">instagram</a>\'
}
我正在使用此代码,但在IF
部分不知道为什么会这样。
$instac = get_the_author_meta( \'au-instagram\', $current_author->ID );
if (!empty($instac)) {
return \'<a href="\' . $instac . \'" class="kalim">instagram</a>\'
}
500错误或内部服务器错误可能是由PHP错误引起的。通过启用WordPress调试,您将很容易找到问题所在。您可以按照此处的说明操作https://wordpress.org/support/article/debugging-in-wordpress/#wp_debug_log
从代码中很容易看出,在右括号前缺少一个半列。
我正在编写一个迁移脚本,它必须读取帖子的post\\u内容,然后动态更改一些自定义Gutenberg块的一些属性。我能够读取post\\u内容,然后使用parse_blocks 作用我还能够通过操纵块对象动态更改自定义块的属性。但我无法将这些块对象转换为Gutenberg用来序列化它们以便更新post\\u内容的特殊HTML注释。我发现WordPress core的PHP部分只有parse_blocks 函数将特殊HTML注释解析为块对象,并render_block 函数来渲染块,但没有serialize