WordPress.org

Ready to get started?Download WordPress

Forums

WP-Footnotes
Undefined index: symbol (4 posts)

  1. andrewrjones
    Member
    Posted 3 years ago #

    With debug enabled, I get the following notice:

    NOTICE: wp-content/plugins/wp-footnotes/footnotes.php:200 - Undefined index: symbol

    http://wordpress.org/extend/plugins/wp-footnotes/

  2. Covi
    Member
    Posted 2 years ago #

    In fact, the plugin needs a few improvements as default values for arrays, compact these arrays...
    but, in this case and in a quickly way, line 200 change by this:

    if ( !empty($identifiers[$i]['text']) )
    	$footnotes[$identifiers[$i]['use_footnote']]['text']	= $identifiers[$i]['text'];
    if ( !empty($identifiers[$i]['symbol']) )
    	$footnotes[$identifiers[$i]['use_footnote']]['symbol']	= $identifiers[$i]['symbol'];

    ;)

    And... a new small code improvement (right after):
    Change this redundant and innecessary code:

    // Footnotes and identifiers are stored in the array
    $use_full_link		= false;
    if ( is_feed() ) $use_full_link	= true;
    if ( is_preview() ) $use_full_link = false;

    $use_full_link is set to false except if is_feed(), we dont't need set to false, again, if is_preview().
    So, set allways to false and true if is_feed():

    // Footnotes and identifiers are stored in the array
    $use_full_link		= (bool) is_feed() ? true : false;

    or more strict:

    // Footnotes and identifiers are stored in the array
    $use_full_link		= (bool) !is_feed() ? false : true;
  3. Covi
    Member
    Posted 2 years ago #

    More improvements, 2 internal - private helpers _getLinkFormat() for links and _getCurrentOption():
    http://pastebin.com/TVNgrM7W

  4. Covi
    Member
    Posted 2 years ago #

    More (perfomance): We don't need call extra functions in each instance of loop for static values as permalink...

    Near line 208:
    [Code moderated as per the Forum Rules. Please use the pastebin]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic