Support » Plugin: qTranslate » Bug: Custom post type without title breaks qTranslate

  • normadize

    (@normadize)


    Hi,

    If you define a custom post type that does not have/support a title (and option in the native WP API) then the edit post screen is completely broken if qTranslate is active. It seems that qTranslate expects to see a title edit field and then most of the Javascript code then fails, breaking the TniyMCE editor tabs and area too.

    Anyone else stumbled upon this?

    Cheers, and keep up the good work.

    http://wordpress.org/extend/plugins/qtranslate/

Viewing 1 replies (of 1 total)
  • Came across this trying to work out the same issue. What I wound up doing is adding title back to the custom post type and then hiding everything with CSS. Not my favorite solution, but it appears to have worked.

    add_action('init', 'pb_qt_init', 100);
    function pb_qt_init() {
        add_post_type_support('my_custom_post_type', 'title');
    }
    
    add_action('admin_head-post.php', 'pb_qt_head_post');
    add_action('admin_head-post-new.php', 'pb_qt_head_post');
    function pb_qt_head_post() {
        global $post;
    
        if ('my_custom_post_type' == $post->post_type) {
            echo '
                <style type="text/css">
                *[class*=qtrans_], div#titlediv { display:none;}
                </style>
            ';
        }
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Bug: Custom post type without title breaks qTranslate’ is closed to new replies.