Fix in visual-editor-custom-buttons

Please fix errors:

  1.  in loop “function _add_my_quicktags” if(!isset($post)) continue;Снимок
  2. in function vecb_register_button :
    for ($i = 1; $i <= $count_posts; $i++) {
           //$count ++; ?????????
           array_push($buttons, "vecb_button" . $i);
       }

    in function vecb_add_plugin :

    for ($i = 1; $i <= $count_posts; $i++) {
    
        //$count ++;??????????
    
        $blog_id = get_current_blog_id();
    
        $plugin_array['vecb_button' . $i] = $url . '/js/button-' . $blog_id . '-' . $i . '.js';
    }

     

    Снимок2

  3. in function  vecb_editor_options :
    global $post;
            if(!isset($post)) return;
            $custom = get_post_custom($post->ID);
            $rich_editor = isset($custom["rich_editor"][0]) ? $custom["rich_editor"][0] : "";
            $html_editor = isset($custom["html_editor"][0]) ? $custom["html_editor"][0] : "";
            $icon = isset($custom["icon"][0]) ? $custom["icon"][0] : "";
            $custom_icon = isset($custom["custom_icon"][0]) ? $custom["custom_icon"][0] : "";
            $quicktag = isset($custom["quicktag"][0]) ? $custom["quicktag"][0] : "";

    and

    if (is_dir($uploaddir)) {
        $uploadfiles = scandir($uploaddir);
    
        if (count($uploadfiles) > 2) {
            //$customicons[] = "-----------------";
    
            foreach ($uploadfiles as $file) {
                if ($file != "." && $file != "..") {
                    $customicons[] = $file;
                }
            }
    
            //$customicons[] = "-----------------";
        }
    }

    and in next lines need will be check variable the “$customicons” on null. I think , there need create one more method for customicons , which will return array with custom icons Снимок3

  4. in function  vecb_tag_options :
    global $post;
     if(!isset($post)) return;
     $custom = get_post_custom($post->ID);
     $left_tag = isset($custom["left_tag"][0])?$custom["left_tag"][0] : '';
     $right_tag = isset($custom["right_tag"][0])? $custom["right_tag"][0] : "";
     $block_content = isset($custom["block_content"][0]) ? $custom["block_content"][0] : "";
     $radio = isset($custom["content-type"][0]) ? $custom["content-type"][0] : "" ;

    in function vecb_styling_options:  $styling = isset($custom["styling_content"][0]) ? $custom["styling_content"][0] : "";

     

    Снимок4

 

There all fixes which I  found  in  your plugin .

https://gist.github.com/andxbes/dd57f3096892cfa5f9df

Sorry for my English .

Leave a Reply

Your email address will not be published. Required fields are marked *

Этот сайт использует Akismet для борьбы со спамом. Узнайте как обрабатываются ваши данные комментариев.