WordPress.org

Ready to get started?Download WordPress

Forums

Links shortcode
[resolved] Improved handling of link_updated (2 posts)

  1. wlindley
    Member
    Posted 2 years ago #

    This brief snippet will cause the link_updated field to be blank, and thus suppressed by the [optional ...||...] code, if it contains the default of '0000-00-00 00:00:00' -- add the lines marked by + (after line 107, the first one shown):

    $linkinfo['link_updated'] = $bm->link_updated;
    +               if (preg_match('#^[\-0 :]*$#', $linkinfo['link_updated'])) {
    +                 $linkinfo['link_updated'] = '';
    +               }
                    $linkinfo['link_rel'] = $bm->link_rel;

    The above is particularly useful with "Andy's Link Last Edited Meta Box" as described at http://fleacircusdir.livejournal.com/5498.html ... which updates WordPress's link_updated field whenever a link is created or modified. (WP allegedly reserves that field for some other sort of magic which never seems to happen. We might as well use it!)

    http://wordpress.org/extend/plugins/links-shortcode/

  2. Maarten Swemmer
    Member
    Plugin Author

    Posted 2 years ago #

    I have updated the plugin to include this functionality. making the plugin compatible with "Andy's Link Last Edited Meta Box".
    Thanks for the tip!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic