Support » Plugin: Faster Image Insert » [Plugin: Faster Image Insert] Slight code improvement to get rid of NOTICE

  • Resolved David L

    (@yonderboi)


    Great plugin! It improves significantly productivity.

    There is a PHP NOTICE (NOTICE: wp-admin/includes/template.php:854 – Trying to get property of non-object) to get rid of related to this code:

    $ptypes = explode(",",$ptype);
       foreach ($ptypes as $type) add_meta_box('fastinsert', 'Faster Insert', 'fast_insert_form', $type, 'normal', 'high');

    if there is not custom type then $ptypes is still an array with one key attached to an empty string. Therefore it still goes in the loop and executes add_meta_box function with $type being NULL, hence the NOTICE.

    You could check if $ptype is false and not execute the code above if it is.

    Thanks

    http://wordpress.org/extend/plugins/faster-image-insert/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Faster Image Insert] Slight code improvement to get rid of NOTICE’ is closed to new replies.