To run this code to test it you can use the wp-cli tool with the eval-file command. wp-cli eval-file
loads up the whole WordPress infrastructure then runs your PHP file so you can use WordPress calls like wp_remote_request
without having to put this code in a page or pulgin. E.g. write a file called test.php that instantiates the class and calls the methods, then run that with:
wp-cli eval-file test.php
I see that @rudtek has answered how to get the data from the shortcode into your code.
Related Posts:
- How to run a function on plugin’s options page?
- wordpress JSONAPI introspector always limits number at 10?
- Showing results from json-string in WordPress search results page
- WP API users per page
- Do you see any problems (mainly security-related) with how I’ve used wp_ajax_* actions?
- How can I interact with a third party service that sends POST requests to me in response to the order information that I send them?
- External api call using wordpress
- Methods of Integrating Plugin Data with Themes
- Custom Widget function in Plugin not working?
- Single functions.php or split into many small files?
- Accessing plugin settings in gutenberg
- Strategies to implement selective loading of plugins
- Using OOP plugin’s methods throughout the website
- Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?
- Managing two editable fields in gutenberg
- lodash dependency in a Gutenberg plugin
- Naming Admin Menus and Submenus
- How can I add/append content to the_content on the home page via a plugin?
- Endpoint on Specific Page Slug
- Plugin vs Settings load order (woocommerce dependency)
- How can I free up the memory used by update_post_meta?
- add javascript button to order place button
- How to register activation and deactivation hook in plugin using OOP pattern
- Does add_filter work outside functions.php
- Is it possible to modify the media library admin screen?
- What function to hook for changes made in status and visibility of a post
- In woocommerce who is responsible for sending the receipt email?
- How to restore WP 5.4 behaviour where a numeric string could added to each page URL and parsed as “page” in WP 5.5?
- Block: attributes not saving
- Callback function is being called twice
- Show dialog box in TinyMCE plugin and use WordPress php functions in it
- PHP 7 – Class Method Compatibility Issue
- Change reset password URL returned by wp_lostpassword_url() via plugin
- Plugin development: How many plugin and WordPress version combinations to support?
- Hook to get image filename when it is uploaded
- How to print raw query from WP_Query class just like in CodeIgniter
- dbDelta() Error – Incorrect index name ” for query ALTER TABLE
- Is it safe to call do_action and apply_filters for built-in hooks?
- Clearing cached plugin data if it is using an external object cache
- Creating a Link Text like Submit Button in Admin Page
- wp_scheduled_event being removed mysteriously
- Sub Menu content is being duplicated
- how to append custom metabox field with the ACF custom fields id in wordpress development
- How to extend WooCommerce API to show bookable product availability rules?
- Memberpress Hooks and Activity
- WordPress allows multiple users to have same email ID; and I’ve a problem with it!
- Enumerating shortcode attributes in JavaScript
- Adding fields to category manager. Does a method exist to get the link to the category edit screen?
- Delist entries in the_loop
- wordpress add_submenu_page adds broken link
- WP Enqueue style on all plug-in pages
- Wp-admin Custom User Management
- Can we intercept user_login and user_pass from a wp_login_form?
- Can we use a library under MIT license in a WooCommerce plugin?
- How do I find the page/url where a search came from when using pre_get_posts filter?
- Shortcode conflicts
- How to output functions from plugin inside theme
- Why does comments_open() return false when publishing a scheduled post?
- Using delete_post_meta for deleting multiple selected options
- Workflow for new importer plugin – your advices?
- Including template in shortcodes
- Should I put my plugin javascript inline?
- Can / should a widget plugin define its own Widget Area?
- How to automatically activate a plugin on install
- disable defaault wordpress comments from a plugin
- WordPress plugin development theme issue
- How to get the `comment_post_ID`?
- Can someone explain what’s the use of parse request function in WordPress?
- add_editor_style to the blog editor view (Gutenberg?)
- Securing custom rest API endpoints with public access from PWA
- By adding “?login – failed” code unable to access my dashboard
- jQueryUI draggable doesn’t work in WordPress plugin
- call funcution when clicking submit
- WooCommerce – Stop assigning order numbers
- How to prevent users from deleting their accounts?
- How do I get a reference to the HTML memory buffer while the page is being constructed?
- Is it possible to restore an expired transient?
- How to Maintain url on form submit
- Post Pagination does not working on WP-Query
- Publish, Save Draft and Preview buttons do not work after being moved with jQuery
- Plugin options page: grouping checkboxes
- I can’t write in my DB using $wpdb->insert
- woocommerce single product page hook not working
- Plugin translation not being displayed
- How do I build a settings panel under the plugin
- Show Metabox Images in slideshow instead of static
- Multiple Users Logged In Causing Incorrect Account Returned
- Displaying $_FILES data (simlar to $_POST)
- Plugin options page – save two related options as one entry
- I want to display the content of a text field only if it has been entered
- How to remove city field from order in dashboard?
- How do i code exit popup plugin?
- Invalid Menu Items
- Custom Nav Walker $item->url producing malformed hyperlinks
- Extend Plugin that creates an endpoint for GET request to also accepts POST requests
- Personalized URL for non-logged in WordPress
- WordPress Breadcrumb Taxonomy Display
- How to manage different tier plugin subscriptions to users
- Plugin submission denied for “Calling file locations poorly” when using WP_PLUGIN_DIR constant
- Do plugin auto-updates also run for a lower version?