The first example you have looks like it’s missing global $easyFootnotes. from the top line and only has Footnotes;.
global $easyFootnotes;
add_shortcode( 'fn', array( $easyFootnotes, 'easy_footnote_shortcode' ) );
Should be the full code. Was that just a copy paste error or is it not working with that full code?
Thread Starter
vishae
(@vishae)
It wasn’t working with the full code; I pasted the wrong thing in my original post, but I did paste the full code in the functionality.php
Thread Starter
vishae
(@vishae)
technically, if I was to change the code in plugin from:
`add_shortcode( ‘efn_note’, array( $this, ‘easy_footnote_shortcode’ ) );’
to:
add_shortcode( 'ref', array( $this, 'easy_footnote_shortcode' ) );
it should take [ref][/ref] as the new shortcode? Or is it more complicated than that?
I dropped the code below in the functions.php on a test theme and things worked as expected using the [fn][/fn] shortcode. Is there another plugin oyu have that uses that?
global $easyFootnotes;
add_shortcode( 'fn', array( $easyFootnotes, 'easy_footnote_shortcode' ) );
Updating the code directly in the plugin should work as well but you’ll run into an issue if you update the plugin as it will get overwritten and you’ll have to make the change again.
Thread Starter
vishae
(@vishae)
okay, now I feel stupid. This is entirely user error – I was editing the functionality.php on one site while checking the result on another, which was why my changes weren’t going through.
Yes, your code works perfectly fine, it was me, not you.
Thank you for taking the time to answer my question.