• Resolved Austin

    (@austyfrosty)


    add_shortcode should really be called in the init function and inside your init or at least __constructor methods.

    Calling the the shortcode with staticly generates an error since it’s not a static method.

    I would suggest moving it into the plugin class or at least calling the object you created just before the add_shortcode function $EDD_Software_Specs like so:
    add_shortcode( 'edd-software-specs', array( $EDD_Software_Specs, 'edd_software_specs_shortcode' ) );

    https://wordpress.org/plugins/easy-digital-downloads-software-specs/

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

    (@isabel104)

    Sorry for the delay. Thanks for pointing out the error. I’ll fix this sometime within the next few days. I have to change the line to:

    add_shortcode( 'edd-software-specs', array( EDD_Software_Specs::get_instance(), 'edd_software_specs_shortcode' ) );

    Note:
    I leave “add_shortcode” outside the class because of the example in the WordPress codex.

    Thread Starter Austin

    (@austyfrosty)

    Your object $EDD_Software_Specs is your class with instance since you called it before as $EDD_Software_Specs = EDD_Software_Specs::get_instance(). So it’s the same thing. 🙂

    Plugin Author isabel104

    (@isabel104)

    Thanks again. Version 1.7.1 (just released) fixes this. I hope this helps.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Shortcode called incorrect’ is closed to new replies.