I am going to suggest that what you are doing is overly complex, at least insofar as I understand you.
You can determine whether your shortcode has been registered using the Core function shortcode_exists
, which returns a boolean
. As far as I can tell, using that should provide completely equivalent functionality to your code above.
Related Posts:
- How can I see all the actions attached to an “add_action” hook?
- Which hook callback has priority if both plugin and theme use the same hook?
- WordPress Plugin Boilerplate – add_action hook in static “activate” function
- How to Use Parameters with a Do_Action Function Within PHP Tags
- How to stop or remove an action being called inside a function of an extended class
- Automatically add attributes to woocommerce product?
- wordpress plugin is not activating from widget
- Removing an action from wp_footer called in a class that’s inside a bigger class
- add_action in a custom plugin
- What is @Action in WordPress?
- How passing values to construct function with Actions?
- add_action into another add_action not working
- Are there action hooks for comments?
- Hooking into the HTML header container
- Get post content inside plugin class method
- Ajax call to php function doesn’t work PHP code
- Creating Admin Submenu Page via Class Method
- plugins_loaded action is not working properly
- Plugin Hook: Get posts
- How to execute init or woocommerce_init only for checkout page
- Uncaught Error: Call to undefined function wp_generate_attachment_metadata() @ wp-cron
- Using require_once in a Plugin?
- How to call plugin path in JS?
- Get Current user email as a return string value
- Stackoverflow type of badge plugin giving warnings in WordPress 3.5
- Plugin.php: PHP Notice: Undefined offset: 0 in
- How to save Clicks of a download link button while it doesn’t matter if we refresh the page or again login/logout
- Very stubborn wp_register_script / add_action vs remove
- Is there an action that is called when a post is restored from the trash?
- Add multiple attributes to product from php
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- Add category to body class
- Plugin Development sqlite or WordPress’ database
- How to review WordPress website php version compatibility?
- Overwrite or Replace code in WP_Footer
- WooCommerce get_price returning wrong price when used via ajax
- Open Post Thumbnail in New Child Theme File in WordPress
- woocommerce 3.2.1 not sending order notification emails
- WordPress on AWS with ELB
- Executing my function once on a specific time
- How to access data in wordpress database externally using php
- WooCommerce: Building a page with user input which is used to query order status and external API and return a result
- Problem with PHP wordpress, Undefined index: in C:\xampp\htdocs\wordpress\wp-content\plugins\epoch\classes\core.php on line 190 [closed]
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Why “Call to a member function on a non-object” in plugin only?
- After upgrade to php 7 plugin/them updates broke [closed]
- How to echo text in browser instead of download junk file?
- WordPress 4.8.1 php getting commented
- Finding the screen id of a page generated with add_menu_page
- Issue running db create table query from static method
- Integrating boxtal PHP library into a custom WordPress Plugin
- How to get specific string/value from an array? php [closed]
- Background Music WP [closed]
- How to remove products-links after the product title using remove_action
- Why is it important to check for isset and is_array before checking in_array in this example?
- ACF – How to set the menu order for the relationship field
- Custom search search does not work?
- How to call external functions from a PHP script in a WordPress plugin?
- Passing PHP Variables to AJAX Loaded Pages
- How to add custom function to pluggable.php
- WooCommerce – new order email hook
- How to list datas from database in a topic?
- Woocommerce add products to cart
- How to hide an option from dropdown in filter module
- How use wp_insert_post and add og:custom tags?
- Display pagination in reservation Plugin and and Print table as pdf
- How to change “Read More” text?
- How to change a wordress plugin php code in my child’s functions.php file?
- Using id to show item
- WP Migrate DB Pro plugin cannot transfer Media files to remote server
- Woocommerce – Change variations output
- WordPress Plugin PHP Not Calling Function
- load plugin in code snippet
- Is admin section completely customizable in terms of styling?
- Why should I need to add init action to include PHP file to WordPress Plugin?
- How to echo meta_key in easy digital downloads receipt (Purchase Confirmation page)
- Plugin error “array_key_exists(): The first argument should be either a string or an integer” [closed]
- Migrating custom php we wrote from functions.php into a site-specific plugin
- What is the correct entry point for capturing coverage data
- Am I using an action hook correctly?
- How to create a dashboard for logged-in users with custom functionality? [closed]
- Cannot access variables within a widget
- How to Set Limit with WordPress Get Bookmarks Shortcode
- Filter for modifying image on upload
- Postal address auto-complete on profile page
- avatar displays outside of targeted area
- WordPress Related Plugin – Adding an image
- How wordpress plugin hooks works? [duplicate]
- ACF: Hide a div or template section when a custom field (in a field group) is empty
- How to delete remain data in WP database after deleting custom post via admin interface
- Populate Woocommerce order notes with custom field value
- Woocommerce Product Add-ons – Auto-select first option
- Strict Standards: Non-static method in sidebar generator
- Fast Tranfering my WordPress site to another server
- Duplicating wordpress install issue
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Posts in Admin only display 1 Post instead of all Post in admin area
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- WordPress Throwing Deprecated Errors on its own Files
- plugin doesn’t retrieve data from database