• I’ve been using FD Footnotes, and the plugin still works, but hasn’t been updated for a year. Easy Footnotes sounds like a perfect replacement, but I have a site with thousands of blog posts, and it would be nice if your plugin could convert the FD Footnotes code.

    Your code is [note]…. [/note]
    Theirs is [2. …] IOW, anything in square brackets that has a number followed by a period and space, then text is interpreted as a footnote. It really is easy, but your system looks good too, and I’d like to be able to switch over, since you are keeping yours up-to-date.

Viewing 1 replies (of 1 total)
  • Plugin Author Jason Yingling

    (@yingling017)

    Hi, thanks for taking a look at easy footnotes. I don’t have anything built in to convert, but it is something you could do using regular expressions.

    This code would find all shortcodes that start with a number followed by a . and space. \[[0-9][.]\s([^\]]*)\]

    Then you would be able to replace that with [note]$1[/note] to output the data in the shortcode.

    If you’re not running a find and replace on your database you could create a filter on the_content to replace the strings. That would look something like this:

    function ef_convert_fd_notes($content) {
        $pattern = "/\[[0-9][.]\s([^\]]*)\]/";
        $replace = "[note]$1[/note]";
        $content = preg_replace( $pattern, $replace, $content );
    
        return $content;
    }
    
    add_filter( 'the_content', 'ef_convert_fd_notes', 0);

    That should convert the FD footnotes shortcode to Easy Footnotes before they’re output.

    I haven’t had a chance to do a thorough debugging of that code. Setting the priority to 0 seems to work with both plugins active, but I’d suggest you deactivate FD Footnotes and set the priority to 10 in the add_filter function.

Viewing 1 replies (of 1 total)
  • The topic ‘Pick up FD Footnote tags?’ is closed to new replies.