具有特定属性的Wordpress短代码导致服务器错误

具有特定属性的Wordpress短代码导致服务器错误,wordpress,shortcode,Wordpress,Shortcode,我有列出社交图标的快捷代码。我已经注释掉了shortcode函数,以防止由shortcode回调函数引起的任何错误。我有很多短代码选项,因此我们有以下短代码: [socials profiles="facebook twitter linked in youtube vimeo stackoverflow pagelines weibo yelp bitcoin foursquare maxcdn stackexchange xing bitbucket trello github flickr

我有列出社交图标的快捷代码。我已经注释掉了shortcode函数,以防止由shortcode回调函数引起的任何错误。我有很多短代码选项,因此我们有以下短代码:

[socials profiles="facebook twitter linked in youtube vimeo stackoverflow pagelines weibo yelp bitcoin foursquare maxcdn stackexchange xing bitbucket trello github flickr google plus pinterest tumblr dribbble instagram dropbox skype renren" size="small" colored_bg="yes" active_bg="yes" jump="yes" jump_bg="yes" round=yes]
短代码函数本身:

    <?php
add_shortcode('socials', 'shortcode_socials');

function shortcode_socials($atts, $content = null)
{

    $str = 'a';

    return $str;
}

你试过用更少的$atts吗?“linkedin”也不应该是“linkedin”吗?是的,我试过了,更少的ATT有效。不,如果是文本,则属性中的内容无关紧要。正如您所看到的,它们无论如何都不会在shortcode函数中处理。我在“Windows平台上发现了这个问题,因为Apache的默认堆栈大小较小。通常在使用分配了大量堆栈的php代码时会发生此问题。要解决此问题,请在Apache配置文件httpd.conf的末尾添加以下内容”,非常感谢你提供的信息。奇怪的是,那个短代码属性并没有这么长时间造成内存问题,很奇怪。在WP属性解析算法中可能有一些不好的地方,我也会这么说。它只返回一个字符字符串(a),所以其余的字符应该是无关的(除了将atts字符串放入$atts变量之外)。要记住的一点是,无论WordPress运行了多少bug,管理改进和安全更新仍然只是一个博客平台。记住,正确的工具适合正确的工作,如果你没有建立博客,有一个比WordPress更好的选择。