我在主题定制器中有一个自定义字段,允许定义自己的版权信息。我创建了一个显示当前年份的短代码。当有人将短代码粘贴到textarea中时,如何使其工作?
我使用Kirki框架创建主题选项。
Kirki::add_field( \'my_customizer\', array(
\'type\' => \'editor\',
\'settings\' => \'copyright\',
\'label\' => __( \'Content\', \'mytheme\' ),
\'section\' => \'section_footer\',
\'default\' => __( \'Copyright ⓒ All rights reserved.\', \'mytheme\' ),
\'description\' => __( \'You can use [current-year] shortcode if you want.\', \'mytheme\' ),
) );
要显示以上选项,我将其添加到页脚。php:
echo Kirki::get_option( \'my_customizer\', \'copyright\' );
我在网站上看到的内容:
Copyright ⓒ [current-year] All rights reserved.
All rights reserved. ⓒ [current-year] by XYZ
All rights reserved. ⓒ 2016 - [current-year]
我需要实现的目标:
Copyright ⓒ 2019 All rights reserved.
All rights reserved. ⓒ 2019 by XYZ
All rights reserved. ⓒ 2016 - 2019
有什么解决方案/想法吗?谢谢