Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/262.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
Php Wordpress下一步删除;“设置下一个功能图像”;从编辑页面_Php_Wordpress_Nextgen Gallery - Fatal编程技术网

Php Wordpress下一步删除;“设置下一个功能图像”;从编辑页面

Php Wordpress下一步删除;“设置下一个功能图像”;从编辑页面,php,wordpress,nextgen-gallery,Php,Wordpress,Nextgen Gallery,我正在为一些图库使用NextGen,并注意到自从加载此插件后,在“特色图像”元框下的编辑页面区域中,现在有一个指向“设置NextGen特色图像”的链接。我不想混淆用户(通过有两个“设置特色图像”链接,所以我想删除NextGEN选项,只留下一个默认的WP链接来设置特色图像) 我找到了关于如何更改标准WordPress“Set Featured Image”元框文本的教程,但没有找到关于如何删除NextGEN链接的教程(我确实找到了一篇文章,介绍了如何添加插件来删除它:) 但是,我只想在functi

我正在为一些图库使用NextGen,并注意到自从加载此插件后,在“特色图像”元框下的编辑页面区域中,现在有一个指向“设置NextGen特色图像”的链接。我不想混淆用户(通过有两个“设置特色图像”链接,所以我想删除NextGEN选项,只留下一个默认的WP链接来设置特色图像)

我找到了关于如何更改标准WordPress“Set Featured Image”元框文本的教程,但没有找到关于如何删除NextGEN链接的教程(我确实找到了一篇文章,介绍了如何添加插件来删除它:)

但是,我只想在functions.php文件中删除它(不使用插件)

我在functions.php文件中尝试了以下操作:

remove_meta_box
remove_filter
remove_action
但我不能100%确定我需要使用哪一个(到目前为止还没有一个有效)

将此函数添加到页面编辑区域的文件为:

我意识到我只是注释掉这个文件中产生链接的文本,但是如果我更新插件,它就会被覆盖


非常感谢您提供的任何帮助或建议!谢谢。

如果您没有/需要为特色图像元框定制任何内容,只需删除所有过滤器即可:

function so_23984689_remove_nextgen_post_thumbnail_html() {

    remove_all_filters( 'admin_post_thumbnail_html' );
}

add_action( 'do_meta_boxes', 'so_23984689_remove_nextgen_post_thumbnail_html' );

如果您希望保留任何其他筛选器,则必须在筛选器数组中循环并删除相应的元素:

function so_23984689_remove_nextgen_post_thumbnail_html() {

    global $wp_filter;

    if ( ! isset( $wp_filter[ 'admin_post_thumbnail_html' ] ) ) {
        return;
    }

    foreach ( $wp_filter[ 'admin_post_thumbnail_html' ] as $priority => $filters ) {
        foreach ( $filters as $id => $filter ) {
            if (
                isset( $filter[ 'function' ] )
                && is_object( $filter[ 'function' ][ 0 ] )
                && $filter[ 'function' ][ 0 ] instanceof nggPostThumbnail
            ) {
                unset( $wp_filter[ 'admin_post_thumbnail_html' ][ $priority ][ $id ] );
            }
        }
    }
}

add_action( 'do_meta_boxes', 'so_23984689_remove_nextgen_post_thumbnail_html' );

最简单的方法是加载隐藏
#set ngg post缩略图的样式表。