WordPress.org

Ready to get started?Download WordPress

Forums

Faster Image Insert
[resolved] Slight code improvement to get rid of NOTICE (4 posts)

  1. yonderboi
    Member
    Posted 1 year ago #

    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/

  2. I just submitted a patch for this to the developer -- http://plugins.trac.wordpress.org/ticket/1593

  3. David Frank
    Member
    Plugin Author

    Posted 1 year ago #

    should be fixed in 2.4.0, finally. Thanks George.

  4. yonderboi
    Member
    Posted 1 year ago #

    Great! Thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.