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
- Too few arguments – wp_login action
- $wpdb->insert writes a record twice for some reason, when my custom developed plugin calls my class function once
- Using OOP in WordPress Plugin Development
- WP add_action factory
- wp_loaded hook block script enquequing
- WP nonce invalid
- woocommerce subscriptions – get expiration date [closed]
- Same log message keeps on printing to debug.log file thousand of times
- database interactions using OOP
- action is not called after a php request
- Custom filter in admin edit custom post type responding with invalid post type?
- WordPress Scheduled Event Request Blocking
- How can i upload images in an admin page?
- Append HTML Using Shortcode
- Delete a WordPress transient from a shortcode on Page/Post update
- Remove an action hook within a Class
- Ajax not working es expected (Returns 0)
- Plugin CSS not enqueing
- Customizer – Prefix Class Extension
- Create onClick Event to Re-load a Widget
- Swapping wp_dropdown_categories function with wp_category_checklist
- Accessing the database from a plugin outside of action hooks
- How to pass arguments to add_action() or retrieve return value of called function?
- Adding subdomain to home_url for “add_menu_page”
- How to show phpinfo() only in a new tab?
- How to find error in my code when the error message is pointing to WP core file?
- How to select the contents in the text view textrea in wp_editor?
- How to periodically scrape and cache strings from remote txt files. – My First Plugin
- Custom Form Processing Issue
- add_action shortcut?
- Extending the WP_Widget_Text class
- Is it acceptable to treat a filter like an action?
- How to access global variable $menu inside a class function
- Ajax – Call to undefined function get_option()
- wordpress plugin is not activating from widget
- Trying to get property of non-object “ wordpress ”
- Hide categories that are not used in the post type
- add element with add_action to posts from a specific category ID
- Automated Cart Update With Alert Box Each Time
- How can I remove a function that has been added to wordpress with add_filter?
- PHP Fatal error: Uncaught mysqli_sql_exception: Table doesn’t exist in wordpress/wp-includes/wp-db.php
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- export a csv file from the database with a cronjob
- How to sanitize any integer input field in wordpress?
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- How to prevent XSS alter custom global javascript object & methods in WordPress
- WordPress ajax doesn’t display object method on jQuery .change() function
- Custom user login page by creating a plugin
- Cron events are disappearing, or cannot be updated in WordPress
- Singelton class does not work, multiple initialization on page reload
- Saving an array of dynamic repeater data as post_meta
- what is the best practice to add new field to an api route
- filter default query to show just selected level of child pages in wordpress
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- WordPress wpform plugin submit and get multiple checked value from checkbox [closed]
- How to upload a file to a folder named after the user_id via plugin
- Reprinting tags with all attributes
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- Use custom post type for a store locator
- developing a wordpress plugin, have a few PHP Woocommerce related coding questions
- Improve page speed loading using CDN and async or defer attribute
- Trying to place a custom field after the total section in the checkout page in woocommerce
- How do I programmatically set a user as spam in BuddyPress? [closed]
- How to use $_GET function WordPress backend
- Whitelisting items from custom options page
- Add_menu_page not displaying the menu in class based plugin
- How to call plugin function per site in a multisite?
- Set meta field to publish date + 2 weeks
- Update results, Before deleting the related category [closed]
- How to make my custom widget appear within WordPress widgets? Plugin development
- Script to browser problem PHP