2012-03-25 15 views
0

スクリーンショットには、toolbar/content heightという問題が表示されます。Wordpress tinymce editorバグ

enter image description here

tinymcse関連のコード:すべてTinyMCEのフレームが_ifrが、運で終わるので

$("iframe[id$='_ifr']").height(500); // this not works 

// wordpress plugin: 

add_filter('admin_head', array($this, 'editor_tiny_mce')); 
add_filter('tiny_mce_before_init', array($this, 'change_mce_options')); 

function editor_tiny_mce() 
{ 
    wp_enqueue_script('common'); 
    wp_enqueue_script('jquery-color'); 
    wp_print_scripts('editor'); 
    if (function_exists('add_thickbox')) 
    { 
     add_thickbox(); 
    } 
    wp_print_scripts('media-upload'); 
    if (function_exists('wp_tiny_mce')) 
    { 
     wp_tiny_mce(); 
    } 
    wp_admin_css(); 
    wp_enqueue_script('utils'); 
    do_action("admin_print_styles-post-php"); 
    do_action('admin_print_styles'); 
} 

function change_mce_options($init) 
{ 
    $init['height'] = '480px'; // this not works 
    return $init; 
} 

// html code 

<?php 
echo the_editor(stripslashes($pages_about_us_content), 'pages_about_us_content'); 
?> 

私もこのコードでそれを解決してみました。これは、エディタに1つのツールバーしか表示されていない場合に発生します。

ご意見をお待ちしております。

+0

これは役立つかもしれない@stackoverflow.com/questions/1653009/how-do-i-set-a-jquery-tooltip-from-a-database-on-server-side、 – elclanrs

+0

@elclanrsありがとう関係ない! –

答えて

0

スクリーンショットが200pxの高さで撮影されていて、あなたもheight:auto !important;を試すことができ

add_filter('admin_head', 'editor_tiny_mce'); 
function editor_tiny_mce(){ 
?> 
    <style> 
    table td.mceToolbar{ 
     height:100px !important; 
    } 
    </style> 
<?php 
} 

enter image description here

(ちょうどのみエディタのツールバーのサイズのためにあなたのfunctions.php内で、このコードスニペットを追加します)、これを試してみてください 注:「wp_enqueue_style」関数を使用して、このコードでCSSファイルをエンキューすることもできます。

+1

私は汚れた解決策を見つけたと思いますが、いずれにしてもプラグインを構築しています。ハック 'functions.php'ははるかに汚い! THX :) –

+0

申し訳ありませんが、私はそれがプラグインのためのものであることに気付かなかった。 –

+0

さて、私はあなたがcssファイルを使用できると思うし、cssファイルをwss_enqueue_styleを使ってそのCSSルールと一緒に追加すると解決できるかもしれないと思っています。ありがとう。 –

関連する問題