init_hooks();
$this->init_components();
}
/**
* Initialize core WordPress hooks.
*/
private function init_hooks() {
add_filter( 'plugin_action_links_' . TSFS_BASENAME, array( $this, 'plugin_action_links' ) );
}
/**
* Add action links on plugins.php page.
*/
public function plugin_action_links( $links ) {
$custom_links = array(
'' . esc_html__( 'Dashboard', 'techsolution-form-studio' ) . '',
'' . esc_html__( 'Add New', 'techsolution-form-studio' ) . '',
);
return array_merge( $custom_links, $links );
}
/**
* Initialize plugin functional sub-systems.
*/
private function init_components() {
// Upgrade DB schema if needed
TSFS_DB::maybe_upgrade_schema();
// Admin & Public handlers
if ( is_admin() ) {
$this->admin = new TSFS_Admin();
}
$this->public = new TSFS_Public();
$this->ajax = new TSFS_AJAX();
TSFS_Privacy::init();
/**
* Fires after the core plugin is loaded. Add-ons register field types from here.
*/
do_action( 'tsfs_loaded' );
}
}
/**
* Initialize the plugin.
*/
function tsfs_plugin() {
return TSFS_Plugin::instance();
}
// Kick off the plugin
tsfs_plugin();