' . esc_html__( 'Onboarding Services', 'makewebbetter-hubspot-for-woocommerce' ) . '';
$links_array[] = '
' . esc_html__( 'Docs', 'makewebbetter-hubspot-for-woocommerce' ) . '';
$links_array[] = '
' . esc_html__( 'KB', 'makewebbetter-hubspot-for-woocommerce' ) . '';
}
return $links_array;
}
add_filter( 'plugin_row_meta', 'hubwoo_custom_settings_at_plugin_tab', 10, 2 );
/**
* Define constant if not already set.
*
* @param string $name name for the constant.
* @param string $value value for the constant.
* @since 1.0.0
*/
function hubwoo_pro_define( $name, $value ) {
if ( ! defined( $name ) ) {
define( $name, $value );
}
}
/**
* Setting Page Link.
*
* @param array $actions actions for the plugin.
* @param string $plugin_file name of the plugin.
* @return array
* @since 1.0.0
*/
function hubwoo_pro_admin_settings( $actions, $plugin_file ) {
static $plugin;
if ( ! isset( $plugin ) ) {
$plugin = plugin_basename( __FILE__ );
}
if ( $plugin === $plugin_file ) {
$settings = array(
'settings' => '' . esc_html__( 'Settings', 'makewebbetter-hubspot-for-woocommerce' ) . '',
);
$actions = array_merge( $settings, $actions );
$premium_support = array(
'premium_support' => '' . esc_html__( 'Get Premium Support', 'makewebbetter-hubspot-for-woocommerce' ) . '',
);
$actions = array_merge( $premium_support, $actions );
}
return $actions;
}
// add link for settings.
add_filter( 'plugin_action_links', 'hubwoo_pro_admin_settings', 10, 2 );
/**
* Auto Redirection to settings page after plugin activation
*
* @since 1.0.0
* @param string $plugin name of the plugin.
* @link https://makewebbetter.com/
*/
function hubwoo_pro_activation_redirect( $plugin ) {
if ( WC()->is_rest_api_request() ) {
return;
}
if ( plugin_basename( __FILE__ ) === $plugin ) {
wp_safe_redirect( admin_url( 'admin.php?page=hubwoo&hubwoo_tab=hubwoo-overview&hubwoo_key=connection-setup' ) );
exit();
}
}
// redirect to settings page as soon as plugin is activated.
add_action( 'activated_plugin', 'hubwoo_pro_activation_redirect' );
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*/
function run_hubwoo_pro() {
// define contants if not defined..
hubwoo_pro_define_constants();
$hub_woo = new Hubwoo();
$hub_woo->run();
$GLOBALS['hubwoo'] = $hub_woo;
}
run_hubwoo_pro();
} elseif ( ! $hubwoo_pro_activated && 0 === $hubwoo_pro_flag ) {
add_action( 'admin_init', 'hubwoo_pro_plugin_deactivate' );
/**
* Call Admin notices
*
* @link https://www.makewebbetter.com/
*/
function hubwoo_pro_plugin_deactivate() {
deactivate_plugins( plugin_basename( __FILE__ ) );
add_action( 'admin_notices', 'hubwoo_pro_plugin_error_notice' );
}
/**
* Show warning message if woocommerce is not install
*
* @since 1.0.0
* @link https://www.makewebbetter.com/
*/
function hubwoo_pro_plugin_error_notice() { ?>