There doesn’t seem to be anything wrong with your code. First thing to check is whether it is evaluated at all by adding something like echo "WPSE!!" in the function and see if that string turns up in the source code.
If it does turn up, the problem must be in get_shop_name returning empty. That would be a problem with WooCommerce rather than WordPress proper.
If it does not turn up, the problem most likely is that shortcodes are not evaluated at all in the input field where you are using it. Only in the content field and the default text widget shortcodes are evaluated automatically. In other cases you must specify it like this:
add_filter ( 'input_field_name', 'do_shortcode' );)
Related Posts:
- Conditionally enqueue a widget’s script/stylesheet in HEAD (only when present on page!)
- Is it possible to “freeze” a WordPress blog?
- Auto Load Plugin Hooks inside Must Use Plugin
- Best practice way to delete user meta data during plugin uninstall?
- Upload specific images to specific folder
- Plugin (or Theme) containing its own Plugins?
- Remove Google Fonts Which Are (Probably) Added By Plugins
- Adding a text domain to every __(), _e() and __n() gettext call without a plan to create own translations
- How to create extendable wordpress plugins
- Delete Custom Dashboard Widgets
- What exactly does $wp_filesystem->abspath() return?
- Adding a Wizard to My Plugin
- Get User ID from within a plugin
- Moving customized core code into plugins?
- Custom Post Type Statuses
- Why users disable the WordPress update?
- Plugin for “Was This Helpful” at end of post? [closed]
- $woocommerce->cart is null inside WordPress Rest API
- WordPress shortcodes & performance
- Adding a post shortcode to a page template?
- send_headers don’t work on wordpress multisite
- Woocommerce sidebar not loading in theme
- Getting the Product object in a custom loop
- Enable Full SSL for WordPress
- Disable a WordPress site
- how to retrieve wordpress event manager plugin’s event detail using php? [closed]
- Changing comments avatar
- How to arrange the order of plugins displaying under every post?
- WordPress plugin changelog RSS
- Retrieving a Value from a wp-database
- Internal Linking Plugin or code
- Input with spaces in Shortcode attributes overwritten by defaults
- Theme’s default styles are overriding my plugin’s custom CSS
- How to set taxonomy in custom plugin?
- Mq translate plugin custom post type issue
- Echo user id of users in seperate table
- How to upload multiple files/images when developing a wordpress plugin?
- HelpDesk solution for WordPress [closed]
- Best practice for including plugin output in a template without using shortcode?
- Recommend a flexible lightbox that allows an image or HTML to be used
- How to apply next/previous classes to LIs for pagination links?
- WordPress reliability
- How do I avoid having duplicate of plugin in trunk?
- How to create wordpress widget that is fixed position on the home page
- Php page with filters for custom fields
- How can I fetch data from another website to my wordpress website with mysql database
- Large amount image data transfer
- CMB2 field not showing on front end category page
- is it possible to hook every page style?
- translate “load more” button
- I need a lightbox plugin that will apply to gallery [closed]
- Override translation of 1 word
- How to add a link to our wp.org profile from wordpress.org plugin page?
- How can I remove the welcome message generated by the New User Approve plugin?
- how to make a wplang for network fill automatically
- Adding a Tag Parameter / Filter to My Shortcode
- How to write to the plugin’s directory?
- Edit all $wp_scripts at once to $in_footer = false
- Ajax call not working in wordpress through a plugin
- Custom plugin places html head content in body
- Setting Author on CPT
- Cannot run script properly with my custom plugin
- Cookie value changes back to previous value after changing
- HTTP Error upload ( localhost )
- Hide Plugin Custom Post Type Menu Link
- Can you add a shortcode to a custom post type that gets the post_title, post_content, etc. and then passes that to a plugin function?
- Highlight admin menu items that are parent of existing core items
- wp-admin/admin-ajax.php 400 (Bad Request) plugin
- Set up new WordPress domain using unclear files
- Getting all woocommerce products from REST API call in plugin
- WP Rest Api GET method restriction on route, but POST method also works
- Cannot install plugins
- Accounting for search terms that may include a space, using SearchWP
- how does a plugin get active in wordpress
- How do I run my custom function in my plugin when a wordpress user is deleted?
- Page Contents showing in Footer Area
- Update (a function) post’s featured image as soon as $image_url changes
- Widget logic using woocommerce product category
- Using activated_plugin to run code
- Surviving WordPress and plugin updates
- How to order users alphabetically by name? in plugin UPME
- Space in WordPress Attribute Causing Problems
- Is it possible to setup Category wise Subsciption?
- WordPress Background Audio – Continous AutoPlay
- Why won’t the Comprehensive Google Map Plugin load?
- How to change a specific page to custom page?
- Being notified when some YouTube video in some post becomes unavailable
- How use Dynamic hyperlink on each wordpress post?
- Why do I get this “peer’s certificate issuer not recognised” error when trying to install a theme?
- How do I activate my child theme, as I do not see it in developer tools
- How to execute init or woocommerce_init only for checkout page
- wordpress jquery is not defined because the head tag is empty
- Questions about using Disqus or Jetpack for comments [closed]
- WordPress plugin header already sent
- Order custom post type by posts with most likes first
- WordPress website is redirecting on some different shopping page
- Pulsing circle before the post title (Breaking news flash)
- Adding fontAwesome to Primary Menu returns after saving the menu
- I start to make custom plugin but for some reason is not working, i get no error. Can someone help me? Thanks
- WP Crowdfunding login redirect fails