elementor_not_loaded();
}
if (did_action('elementor/loaded')) {
add_filter('plugin_action_links', array($this, 'plugin_actions_links'), 10, 2);
}
}
/**
* Add settings page link on plugins page
*
* @param array $links
* @param string $file
*
* @return array
* @since 0.0.1
*/
public function plugin_actions_links($links, $file) {
$better_payment_plugin = plugin_basename(BETTER_PAYMENT_FILE);
if ($file == $better_payment_plugin && current_user_can('manage_options')) {
$links[] = sprintf('%s', admin_url("admin.php?page=better-payment-settings"), __('Settings', 'better-payment'));
if ( ! class_exists('\Better_Payment_Pro') ) {
$links[] = sprintf('' . __('Go Pro', 'better-payment') . '');
}
}
return $links;
}
/**
* Dispatch and bind actions
*
* @return void
* @since 0.0.1
*/
public static function dispatch_actions( ) {
$menuObj = new Menu();
$menuObj->init();
$bpElementorWidgetObj = new Widget();
$bpExportObj = new Export();
// Handle select2 ajax search
add_action('wp_ajax_better_payment_select2_search_post', [$bpElementorWidgetObj, 'select2_ajax_posts_filter_autocomplete']);
add_action('wp_ajax_nopriv_better_payment_select2_search_post', [$bpElementorWidgetObj, 'select2_ajax_posts_filter_autocomplete']);
add_action('wp_ajax_better_payment_select2_get_title', [$bpElementorWidgetObj, 'select2_ajax_get_posts_value_titles']);
add_action('wp_ajax_nopriv_better_payment_select2_get_title', [$bpElementorWidgetObj, 'select2_ajax_get_posts_value_titles']);
// Elements
add_action('elementor/controls/controls_registered',[$bpElementorWidgetObj, 'register_controls']);
//Page: Transactions
add_action('wp_ajax_better-payment-transactions-export',[$bpExportObj, 'export_transactions']);
}
}