Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in
/home/www/_blog.bluecygnet.com/wp-content/plugins/wp-syntax/wp-syntax.php on line
380
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in
/home/www/_blog.bluecygnet.com/wp-content/plugins/wp-syntax/wp-syntax.php on line
380
我在一个基于wordpress的blog上用了flickrRSS的插件,这个插件还是不错的。不过升级到2.7后,图片就显示不出来了。看了一下,开发者没有进行修正,只好找hack了。
修改的办法如下:
Replace:
1
| if(preg_match('<img src="([^"]*)" [^/]*/>', $item['description'],$imgUrlMatches)) { |
if(preg_match('<img src="([^"]*)" [^/]*/>', $item['description'],$imgUrlMatches)) {
With:
1
2
3
4
5
6
7
| // Hack to switch regular expression based on WordPress Version
if (get_bloginfo('version')=='2.7') {
$pattern = '/img src=(.*) width/';
} else {
$pattern = '<img src="([^"]*)" [^/]*/>';
}
if(preg_match($pattern, $item['description'],$imgUrlMatches)) { |
// Hack to switch regular expression based on WordPress Version
if (get_bloginfo('version')=='2.7') {
$pattern = '/img src=(.*) width/';
} else {
$pattern = '<img src="([^"]*)" [^/]*/>';
}
if(preg_match($pattern, $item['description'],$imgUrlMatches)) {