I didn’t call the class yet, this code is now working
class Scheduler {
public $setup;
public static $instance;
public function __construct()
{
self::$instance =& $this;
add_action('scheduler', [$this, 'etf_scheduler_func']);
}
public function etf_scheduler_func() {
$this->setup = new Setup();
$this->setup->set_table();
}
public static function &get_instance()
{
if ( ! isset( self::$instance ) )
self::$instance = new self;
return self::$instance;
}
}
Scheduler::get_instance();
Related Posts:
- Does an activated plugin automatically mean its methods are available to other WP functions?
- add_meta_boxes action with refresh on save
- Use wc_enqueue_js only on specific pages – nested add_action
- OOP Plugin Development. Including external object
- Does wp-cron runs all tasks scheduled at same time together or one after other?
- How to access function from outside of a class within this class in WP plugin?
- Extend a class of a plugin
- action hook wp_head higher priority as all other plugins/hooks
- Adding Default Settings to Theme My Login plugin
- Adding widgets to my plugin page instead of WordPress dashboard
- WP CRON duplicate wp_insert_post with has < and > tag
- How wp-cron can run in background if PHP is single threaded?
- Adding function to Genesis genesis_header [closed]
- Extend Woocommerce Widget Class – WC_Widget_Product_Categories
- Undefined method class::construct() when creating a plugin
- Usage of call back function of add_meta_box()
- Scheduling an event inside plugin class is not working
- Cant register rest routs from class instance
- How to Schedule Cronjobs for start of every month and year
- Action Hook Inside WordPress Plugin Shortcode
- Woocommerce custom Plugin in wordpress [closed]
- Call to “admin_notices” hook from a static method
- Use PHP Class in WordPress functions
- post_exists stops working in a scheduled event
- How do I remove an action hook inside a class that is called by another class?
- Get post content inside plugin class method
- Submit to itself don’t work
- PHP calling function within a class
- Issues separating my Plugin pages into different files
- Should I use spl_autoload_register() in my plugin?
- How can I save a multiple select array with the settings API for a plug-in options page?
- Using register_activation_hook in classes
- Is there a way for a plugin to add an attribute to the tag of a theme?
- Gutenberg Blocks doesn’t render correctly when using do_blocks
- Initialize WordPress environment to use in a real cron script
- How to make sure that only one wp_cron() runs at a time?
- How to Remove a Filter from the Admin List Table?
- wp_delete_auto_drafts() deletes links in menus
- My shortcode is showing up twice
- Database “Migration” for Plugins?
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- When is is_admin() available?
- Making Quote Plugin more efficient
- How do I use the Simple HTML DOM Parser in plugin when other plugin already uses it?
- Will simple function names in a class structure conflict with other plugins?
- Instantiate class to be available to all plugin functions
- How to test nonce with AJAX – Plugin development
- WP nonce invalid
- How can i upload images in an admin page?
- Ajax not working es expected (Returns 0)
- add_action shortcut?
- wordpress plugin is not activating from widget
- add element with add_action to posts from a specific category ID
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Reprinting tags with all attributes
- developing a wordpress plugin, have a few PHP Woocommerce related coding questions
- Trying to place a custom field after the total section in the checkout page in woocommerce
- Update results, Before deleting the related category [closed]
- running wp-cron.php using php not wget
- how to update and display an option without reloading the page
- jQuery code not working when included in functions.php
- How to obtain the current website URL in my theme?
- Plugin Generate Unexpected output during activation
- Hook called before text widget save
- zip unzip attachments in wordpress
- wpdb prepare insert table doesn’t work
- Can not add admin notices from the edit_user_profile_update hook (notices not being displayed)?
- Using admin-post.php for admin form but it directs me to admin-post.php white screen
- How can I display Custom Post type Custom Columns and its Content in a Dashboard Widget?
- Adding Additional Variables on Menus Page
- custom plugin with upload files does not work
- What is the difference between Null vs Empty (Zero Length) string?
- send popup after wp_redirect()
- no_rest_route error on custom routes
- How to correctly escape an echo
- Can/should we delete wordpress cron jobs with no action?
- Create ACF Checkbox to get all ACF Values from Parent Page
- File is executed twice if plugin is activating
- product_type_options get saved value [closed]
- WordPress How do I pass a variable from one add_action to another?
- Display a custom name when the user has no name settle in his account
- Multiple cron jobs vs daily cron job doing multiple things? Which one yields better performance and scalability?
- get Woocommerce product format json for WP_Query
- Sum All the Post Meta of Published posts of Current Logged in user
- Cron not sending wp-mail()
- Use WP Cron to Clear a Page Cache?
- The plugin generated 225 characters of unexpected output during activation
- Autoloading Classes in Plugins
- remove_action() not working in page template – Genesis
- Unable to pass arguments to function used in add_action
- Update all posts in custom post types with wp_cron()?
- Sort WooCommerce data with WP-CRON?
- Comparing Dates within plugin using PHP If statement
- Singleton plugin activation; create database
- How to get WordPress Adminmenu items?
- display php code in header using wp_head()
- base64_encode conflict with convert_smilies in wordpress
- Properly process a custom WP REST API request (Authenticate, Authorize + Validate)?
- Login user into magento using wordpress account
- Customize create table SQL statement in any WordPress plugin