wordpress - 自定义字段的插件?
问题描述
这个插件https://wordpress.org/plugins/no-external-links/
我正在使用自定义字段。
<?php $values = get_post_custom_values("imgurl"); echo $values[0]; ?>
该插件不会掩盖我的自定义字段。如何屏蔽此链接?
我应该在函数文件中添加什么代码?谢谢
// You will have to add just a line in a theme code where you output custom field data.
// To add same preprocessing for data as for comment text, use
$metadata = apply_filters(‘comment_text’, $metadata);
// For example, if you use some kind of metadata, it should look like this:
$metadata = get_post_meta($id, ‘MetaTagName’, true); // get data from wordpress database
$metadata = apply_filters(‘comment_text’, $metadata); // add this line of code for preprocessing field value
echo $metadata; //output preprocessed field value
// Use “the_content” instead of “comment_text” if you want to use the same masking policy as for post text. https://www.ozgurbilgi.net
解决方案
推荐阅读
- html - 在导航栏 div 内对齐图像
- swift - Xcode - 从模拟器访问持久数据 (NSCoder)
- c - AVX/SSE 将浮点符号掩码转换为 __m128i
- symfony - 当值为“0”且语言为“斯洛文尼亚语”时,Symfony transchoice 无法选择翻译
- java - 如何在 Spring 中添加自定义 Hibernate 类型
- gradle - Gradle:依赖和配置之间有什么联系?
- python - 如何在python中获取另一个函数的预期参数?
- java - Spring REST - 正在下载损坏/空白文件
- jenkins - 如何使用声明式 Jenkinsfile 构建 docker 镜像
- sqlite - 离子 executeSql 不起作用