最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom post types - Visual editor issue by having multiple tiny mce editors in a CPT

programmeradmin0浏览0评论

I have a custom post type in which I have added multiple wysiwyg editors, when I click on visual, the content of the editor (button, text, title) get inside of the wysiwyg editor.. it's odd.

It looks like I'm adding the old-style tiny-mce editors in the wrong fashion.

I'm adding an editor like this:

    function addProgramDescriptionEditor() {
        global $post;
        $custom = get_post_custom($post->ID);        
        $x = self::ATTRIBUTE_PROGRAMMA_DESCRIPTION;
        $program_content = $custom[$x][0];
        wp_editor($program_content, self::ATTRIBUTE_PROGRAMMA_DESCRIPTION, $settings = array('textarea_name' => self::ATTRIBUTE_PROGRAMMA_DESCRIPTION));
    }

And then on the adminInit:

        add_meta_box(self::ATTRIBUTE_PROGRAMMA_DESCRIPTION, self::TITLE_PROGRAMMA_DESCRIPTION, self::class . "::addProgramDescriptionEditor", self::TYPE_SLUG, 'normal', 'high');

Is there another way of adding the visual/mce editor to your custom post type? In a way that it doesn't break when you switch to Visual editing.

Or is my implementation the cause of the newly added editors (besides the main one on top) breaking when switching to the visual editor?

发布评论

评论列表(0)

  1. 暂无评论