So this turned out to be the problem:
After running using WP_DEBUG on the live site it turned out $this was not defined in the following line:
public function __construct(){
add_action('init', function(){
add_shortcode('bbit', array($this, 'shortcode_handler'));
});
}
shortcode_handler is a non-static function here, and this code was all called in a static context. It seems there are some differences in my local XAMPP configuration and the servers configuration. I fixed it by removing the old code and adding the following code outside of the class:
add_action('init', function(){
add_shortcode('bbit', array('BBIT_ShortCode', 'shortcode_handler'));
});
After that I just needed to make the shortcode_handler method static and there was a fix.
Related Posts:
- convert it into short code & explan how? [closed]
- What does extract( shortcode_atts( array( do?
- How do I escape a ‘]’ in a short code?
- Redirect function inside a Shortcode
- Remove wpautop from shortcode content / remove whitespace in buffering
- Shortcode in shortcode: How to append variable?
- How can i put an array as variable in shortcode_atts?
- Using action hooks inside of a shortcode
- Using shortcodes in PHP
- Remove width and height attributes from [gallery] output
- Is it possible not to define category on function.php and add the shortcode [shortcode cat=1] to display the products?
- Add_shortcode as a Class to pass arguments to a function
- Prevent add_shortcode from escaping a tag
- Shortcodes not working in an AJAX call
- How do I require a file in a shortcode?
- Remove HTML content if attribute is not set / variable attributes
- Legacy Audio Shortcode
- Extending the Audio Shortcode
- How resource intensive is wp_register_script()?
- Convert shortcode into html form [closed]
- Numbering Image List in Gallery
- Using API to generate short link
- How to enable shortcodes in text retrieved from get_theme_mod
- Register visits of my pages in wordpresss
- List monthy archives for specific year with wp_get_archives
- How can I included CSS to a page or a shortcode? [closed]
- Two Shortcodes in one page not working
- Call Shortcode inside another Shortcodes callback
- Creating a shortcode in a plugin that includes JS
- Shortcode to delete post from front end
- MathJax inside shortcode
- How to parse shortcodes within returned content
- Hook WP_Embed run_shortcode
- Create a shortcode that creates a form for users to edit their information
- How to split text text text into array
- WordPress Vue Js Shortcodes
- Shortcode multiple values
- How do you stop a shortcode from firing in the editor?
- menu item to display the most recent post
- Documentation for adding a tinyMCE view for visual live preview of custom shortcode?
- How can I implement shortcode on click event
- Gravity forms – get shortcode attribute from post content
- Login form from shortcode doesn’t redirect after successful login
- do_shortcode via ajax
- How to list users by custom field?
- Form Shortcode not saving data to WP database
- Single post content custom order
- Adding a class to shortcode API
- Pass data back to TinyMCE from Thickbox
- Forcing WP to embedd a video when using a shortcode
- Shortcode for output of wp_get_archives displays at top of post
- How can I execute shortcode outside the loop?
- Gutenberg Shortcode Fail
- How to add “get_theme_mod” inside a shortcode?
- How to create shortcode to display perticular word from page title
- Shortcode is not returned correctly
- Echo HTML in custom shortcode
- How do I make a shortcode?
- Echoing Shortcode content inside the loop
- Short code inside the page not working in WordPress
- How can I list only custom shortcodes?
- Add inline style to pages where shortcode was used
- add new attributes into existing shortcodes
- Anchor text in Short code →
- Theme Icons not visible on http://domain.com, works on http://ipaddress
- Add variable in between do_shortcode
- How to pass an array as attribute of shortcode to work properly shortcode parser?
- Using shortcodes in the Site Title
- Use atributes of shortcode in get template part
- Problem parsing long parameter in shortcode
- Is there any way to set the Featured image in wordpress post editor, using a Getty images embed code
- How I can add placeholder in shortcode
- I’m using rtMedia and Youzer. Can Shortcodes be used to display a video gallery?
- Help with a function to create a shortcode
- How to use strip_shortcodes() from a spawned process?
- How to completely prevent WordPress from destroying/modifying my shortcode outputs?
- Term Description Echo or Return – display problems
- Same Shortcode not executing second time
- Check if Page=current user page via shortcode
- Is it inefficient to repeat a Shortcode 100 times on a page?
- Shortcode with multiple paramaters
- tinymce custom button
- Custom shortcode is not working inside tabs
- WordPress Payment link will not transform PHP vars into values
- Referring to site URL in shortcode argument
- Does a String Replacing script affect shortcode output?
- Shortcode for showing childpages
- How to create shortcode for auto login after registration
- How WordPress Displaying Shortcode In Post Content?
- Shortcode not accepting atts
- the_time function inside HTML dom parser
- Shortcodes in Options Panel textareas
- How to Convert Shortcode into a link?
- wp_register_script and wp_register_style when shortcode is used
- Insert shortcode in widget area
- Wpautop stops working after get_the_excerpt
- Hook into existing shortcodes to manipulate the attributes?
- How can I hide the ACF shortcode when empty
- Using variable as shortcode parameter
- How to handle Ajax Calls, when using same shortcodes (with different parameters, e.g. ‘post-type’)?