当我将此插件安装到我的一个使用Themify Builder的站点时,它显示以下错误。
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘wp_gallery_custom_links’ not found or invalid function name in /home/content/xxxxx/wp-includes/class-wp-hook.php on line 298您或任何人以前是否遇到过此错误?有什么快速的解决方案吗?
此外,我检查了Themify,发现他们在兼容文件中添加了插件代码,如下所示。
// WP Gallery Custom Links if( $this->is_plugin_active( \'wp-gallery-custom-links/wp-gallery-custom-links.php\' ) ) { add_filter( \'themify_builder_image_link_before\', \'wp_gallery_custom_links\', 10, 3 ); } function wp_gallery_custom_links( $link_before, $image, $settings ) { $attachment_meta = get_post_meta( $image->ID, \'_gallery_link_url\', true ); if( $attachment_meta ) { $link_before = preg_replace( \'/href="(.*)"/\', \'href="\' . $attachment_meta . \'"\', $link_before ); } $attachment_meta = get_post_meta( $image->ID, \'_gallery_link_target\', true ); if( $attachment_meta ) { $link_before = str_replace( \'>\', \' target="\' . $attachment_meta . \'">\', $link_before ); } return $link_before; }请对此进行调查,并尽快让我知道解决方案。
谢谢