admin管理员组

文章数量:1123882

I want to disable the automatic embed system of WordPress for block editor and classic editor.

This is what I tried:

function disable_embeds_editor_support() {
    remove_action('pre_oembed_result', 'wp_filter_pre_oembed_result');
}
add_action('admin_init', 'disable_embeds_editor_support');

function disable_embeds_classic_editor($plugins) {
    if (is_array($plugins)) {
        return array_diff($plugins, array('wpembed'));
    } else {
        return array();
    }
}
add_filter('tiny_mce_plugins', 'disable_embeds_classic_editor');

本文标签: oembedDisable the buildin embed only in the editor