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
- Getting the action’s tag name within the action
- How to do conditional publishing?
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- WordPress Scheduled Event Request Blocking
- Cron events are disappearing, or cannot be updated in WordPress
- Saving an array of dynamic repeater data as post_meta
- wp query foreach deleting record returning only first or last item
- action theme mailchimp subscriber fields
- Setup wp_schedule_event within a custom plugin
- add_action taking an array with the 2nd argument?
- What exactly do this function declared into functions.php file of a WP theme?
- How to use html inside a functions.php code?
- Nested “do” and “add” Actions is possible?
- WordPress Environment: Dynamic Page using shortcode – how to change the page name for sharing
- plugin add action hook is not working :
- zip unzip attachments in wordpress
- wordpress admin plugin menu custom css
- how to Update 15k products on plugin activation with meta_option
- Hooks for post saving make a post-new.php to load latest post’s data
- Adding Additional Variables on Menus Page
- WordPress cron is running with previously set time intervals and not the updated one
- Using flickr api in custom wordpress plugin
- Toolbar Hidden in a Virtual Page
- PHP: $_SESSION destroyed after page reload for my custom session
- How to correctly escape an echo
- add_action in namespace not working
- Payment field disappears on custom Paypal plugin
- WordPress Post Block Element not properly parsed with the_content filter
- Adding image upload in tag section – WordPress plugin development
- How to Remove Theme Style CSS inside Custom Plugin?
- Creating plugin with front-end pages
- How to Send Pingbacks for all Posts in WordPress?
- I am having errors with checkout on wordpress
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- 400 bad request admin-ajax file upload
- get Woocommerce product format json for WP_Query
- Update user meta when an external link in admin notice is clicked
- Is there an option to execute javascript file only on plugin activation
- Automatically delete posts one by one depending on published time
- The plugin generated 225 characters of unexpected output during activation
- Hook into all password resets in WordPress and get password before hashing?
- Why should I need to add init action to include PHP file to WordPress Plugin?
- Ajax in a class instantiated via shortcode
- Parsing webhook from Shopify in WordPress
- remove_action() not working in page template – Genesis
- How to hook into the subscriber /wp-admin/index.php page?
- Add two or multiple functions in WordPress Post or Page
- Shortcode Works for Logged in Users but Not Working for Guest
- WordPress / PhpStorm / XDebug and plugin_dir_path issues
- Send data from plugin to external database
- WordPress HTML Helper
- Property value of null when value is assigned inside a method hooked to the wp action hook
- See output of a sql query while plugin installation in wordpress
- Why this plugin is not working?
- Permission error on plugin save
- MySQL update text field with ‘
- how can I make content from a plugin hidden when user is logged in? [duplicate]
- display php code in header using wp_head()
- How to pass and validate nonce in custom REST routes
- Error resetting database index using ALTER TABLE in $wpdb->query
- ajax problems on loading page [closed]
- wp_mail – send emails after 24 hours from users registration
- add_action() not working for admin
- Compare user meta values before update them
- Capture the Selected Radio Button Value between two files in wordpress theme
- Start a long running PHP process via JS/Ajax and monitor progress on admin page
- How to change product SKU’s in bulk with a plugin
- JQuery UI Autocomplete showing as bullets
- Add Imports to Existing WordPress Import Map
- Custom plugin with dynamic child pages listing database records