脚本宝典收集整理的这篇文章主要介绍了php – 强制WordPress库使用媒体文件链接而不是附件链接,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
remove_shortcode('gallery','gallery_shortcode'); // removes the original shortcode add_shortcode('gallery','my_awesome_gallery_shortcode'); // add your own shortcode function my_awesome_gallery_shortcode($attr) { $output = 'Codex is your friend' ; return $output; }
在自定义功能中,你可以设置你想要的任何东西..看看original gallery shortcode.
另一种方法是实际过滤属性(如果你将转到上面的链接,你会看到一个过滤器钩子)
add_shortcode( 'gallery','my_gallery_shortcode' ); function my_gallery_shortcode( $atts ) { $atts['link'] = 'file'; return gallery_shortcode( $atts ); }
以上是脚本宝典为你收集整理的php – 强制WordPress库使用媒体文件链接而不是附件链接全部内容,希望文章能够帮你解决php – 强制WordPress库使用媒体文件链接而不是附件链接所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。