WordPress.org

Ready to get started?Download WordPress

Forums

Visual Editor not working.. Just another reason (1 post)

  1. x128
    Member
    Posted 1 year ago #

    My visual editor was blank (not working). The reason was found: I have WP options home and siteurl set to relative uri /wordpress instead of http://example.com/wordpress (since I have a complex system of sharing different tables between websites).

    There are different ways to make it work. I've chosen to make a with a very simple plugin:

    add_filter('includes_url', 'my_full_includes_url', 10, 2);
    function my_full_includes_url($url, $path)
    {
        if ($path == 'js/tinymce' && !empty($url) && substr($url, 0, 1) == '/' && isset($_SERVER['HTTP_HOST']))
            $url = 'http://' . $_SERVER['HTTP_HOST'] . $url;
        return $url;
    }

    That's it. Works for the latest 3.4.2. If you are in 2014 having problems with WP 4.5.7, please check setting the TinyMCE base url, something like

    self::$baseurl = includes_url('js/tinymce');

    in the _WP_Editors class, and add an action inside includes_url().

Topic Closed

This topic has been closed to new replies.

About this Topic