Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
GD Star评级激活时Wordpress功能不工作_Wordpress - Fatal编程技术网

GD Star评级激活时Wordpress功能不工作

GD Star评级激活时Wordpress功能不工作,wordpress,Wordpress,这是我的错误: Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'my_scripts_method_2' was given in /home/www/domain.com/wp-includes/plugin.php on line 406 这是给出错误的函数: add_action('wp_enqueue_

这是我的错误:

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'my_scripts_method_2' was given in /home/www/domain.com/wp-includes/plugin.php on line 406
这是给出错误的函数:

add_action('wp_enqueue_scripts', 'my_scripts_method_2');
function catch_that_image() {
  global $post, $posts;
  $first_img = '';
  ob_start();
  ob_end_clean();
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
  $first_img = $matches [1] [0];
  if(empty($first_img)){ //Defines a default image
    $first_img = "http://domain.com/wp-content/uploads/2013/07/billede.jpg";
  }
  return $first_img;
}
add_action('wp_排队_脚本','my_脚本_方法_2');
函数catch_that_image(){
全球$员额,$员额;
$first_img='';
ob_start();
ob_end_clean();
$output=preg_match_all('//i',$post->post_content,$matches);
$first_img=$matches[1][0];
if(empty($first_img)){//定义默认图像
$first_img=”http://domain.com/wp-content/uploads/2013/07/billede.jpg";
}
返回$first\u img;
}

我只在启用GD star评级时收到错误。此外,问题不太可能是“我的脚本”和“方法”已经在使用中。我多次更改名称,仍然给出错误。

事实上,它的名称和功能都很糟糕。似乎是这样。如果没有,我不会得到任何错误。如果没有
wp\u head()
,依赖于此挂钩的插件将无法工作。您是否有函数
my\u scripts\u method\u 2
,在您的示例中它不可用。当我删除my\u scripts\u method\u 2时,它也会给出一个错误。您如何处理此队列和
ob\u start\u end\u clean()
?如果您删除了提供的示例代码,并且错误仍然存在,则问题在别处,不是吗?