使用AdvancedCustomFields插件创建base64网址

时间:2016-12-20 03:48:53

标签: php wordpress advanced-custom-fields

我正在使用AdvancedCustomFields WordPress插件,我想创建一个来自此字段的URL,URL base64:

<?php echo get_post_meta($post->ID, 'author-link', true); ?>

示例链接为:https://www.youtube.com/watch?v=u-oxmQxNBeQ

它应该在帖子上显示:aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj11LW94bVF4TkJlUQ==

1 个答案:

答案 0 :(得分:0)

只需使用base64_encode()编码字符串,如下所示。

DF <- structure(list(months = c("January", "February", "March", "April", 
"May", "June"), year = c("01", "01", "01", "01", "01", "01"), 
   value = c(23875, 15343.25, 9584.25, 19026.33, 26324, 31228
   )), .Names = c("months", "year", "value"), class = "data.frame", row.names = c(NA, -6L))