• Resolved ClubMagellano

    (@clubmagellano)


    Hi tehre,
    today I’ve made a shortcodes and I used some PHP functions so I’ve put them in the relative section. But I’have to load this shortcode at least 2 times per page so I got an error because, according to my log, I’m trying do define twice the functions.
    I’ve resolved putting functions in functions.php but I hope there’s a way to solve this problem in the plugin.
    Looking forward in hearing you.
    Riccardo.

    https://www.ads-software.com/extend/plugins/my-shortcodes/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author David Cramer

    (@desertsnowman)

    Hi There,

    I know about this problem and do need to make a fix.

    For now you can wrap your function in this:

    if(!function_exists('your-first-function-name')){
    
    // all your functions go here
    
    }

    this will allow it to be used multiple times. I will get a patch up asap, I’m just a little busy at the moment.

    ~David

    Thread Starter ClubMagellano

    (@clubmagellano)

    Ok thank you very much!

    Plugin Author David Cramer

    (@desertsnowman)

    You’re welcome.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: My Shortcodes] PHP functions double inserted’ is closed to new replies.