Bug: Custom post type without title breaks qTranslate (2 posts)

  1. normadize
    Posted 3 years ago #


    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.


  2. Ryan
    Posted 3 years ago #

    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;}

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.