• Resolved net-buoy

    (@net-buoy)


    I use Shortcode Ultimate, and wanted to use Easy Footnotes as well.
    This requires editing current line 43 in easy-footnotes.php, for example, changing your code:
    add_shortcode( 'note', array($this, 'easy_footnote_shortcode') );
    to
    add_shortcode( 'fnote', array($this, 'easy_footnote_shortcode') );
    allowing one to use [fnote]This is my footnote[/fnote]
    It would be handy if this was either addressed as an opiton in the plugin, or specific info on where to find the code was provided (apologies if it was mentioned, its just that I didn’t find it).

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

    (@yingling017)

    A unique prefix for the note shortcode is on the bucket list for updates. As “note” is too generic. Still working out the best ways to maintain backwards compatibility and add a new shortcode going forward. Likely it would be [efn_note][/efn_note].

    Thread Starter net-buoy

    (@net-buoy)

    Shortcodes Ultimate uses [su_note][/su_note] so I was somewhat surprised that changing your code worked (I am worrying that there is something else in my installation that is using [note]). I think efn_note would work great, but I do think you should make sure that users can change it easily in case they have a conflict.
    Thanks

    Plugin Author Jason Yingling

    (@yingling017)

    I’d probably leave both shortcodes for the time being. Just need to do some testing and see how it effects the overall count and output.

    JohnP

    (@johnp)

    Any progress on this Jason?

    I (and presumably 2000+ others) need to replace the apparently abandoned Simple Footnotes plugin, which uses [ref][/ref].

    With dozens of authors trained to use this, I would like to avoid having to search & replace all the shortcodes then try and re-educate them to use [note][/note].

    Plugin Author Jason Yingling

    (@yingling017)

    Hi John,

    I’ve got the next version set to add the [efn_note] shortcode, but need to do some testing and wrap up some other open items before it’s released.

    If you’d like to set up Easy Footnotes to use the [ref] shortcode you could put the following code in your theme or child theme’s functions.php. That should make Easy Footnotes read the [ref] shortcode as well.

    global $easyFootnotes;
    add_shortcode( 'ref', array( $easyFootnotes, 'easy_footnote_shortcode' ) );

    Note: If you use a theme that receives updates I’d strongly recommend creating a child theme so these changes don’t get overwritten.

    Given you’re familiar with running a search and replace I imagine you’re familiar with child themes, but wanted to throw that out there for anyone that may stumble upon this thread in the future.

    Thread Starter net-buoy

    (@net-buoy)

    easier to just add the change to the plugin, as I did in the first place,

    public function __construct() {
    		$footnoteSettings = array(
    			'footnoteLabel' => 'Footnotes',
    			'useLabel' => false,
    			'hide_easy_footnote_after_posts' => false
    		);
    
    		add_option('easy_footnotes_options', $footnoteSettings);
    here-->		add_shortcode( 'efn_note', array($this, 'easy_footnote_shortcode') );
    		add_filter('the_content', array($this, 'easy_footnote_after_content'), 20);
    		add_filter('the_content', array($this, 'easy_footnote_reset'), 999);
    		add_action('wp_enqueue_scripts', array($this, 'register_qtip_scripts'));
    		add_action('admin_menu', array($this, 'easy_footnotes_admin_actions'));
    		add_action( 'admin_enqueue_scripts', array($this, 'easy_footnotes_admin_scripts') );
    	}

    but it might be handy for those with legacy use, to be able to change the code to allow multiple shortcodes to serve the same function?

    Plugin Author Jason Yingling

    (@yingling017)

    That’s how I’m adding in the [efn_note] shortcode in the next version. I’ll just be keeping the [note] shortcode as well to maintain backwards compatibility.

    The functions.php code above was in case you wanted Easy Footnotes to recognize the [ref] shortcode after deactivating Simple Footnotes rather than doing a search and replace.

    You should be safe with your edit in place to update to the next version once it’s released.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Changing shortcode’ is closed to new replies.