2013-07-24 12:34:12 +00:00
< ? php
/**
2015-11-03 13:53:50 +00:00
* Add some content to the help tab
2013-07-24 12:34:12 +00:00
*
2014-11-30 06:52:32 +00:00
* @ package WooCommerce / Admin
2013-07-24 12:34:12 +00:00
* @ version 2.1 . 0
*/
2014-09-20 19:52:30 +00:00
if ( ! defined ( 'ABSPATH' ) ) {
2017-09-25 14:07:02 +00:00
exit ;
2014-09-20 19:52:30 +00:00
}
2013-07-24 12:34:12 +00:00
2017-09-25 14:07:02 +00:00
if ( class_exists ( 'WC_Admin_Help' , false ) ) {
return new WC_Admin_Help ();
}
2013-07-24 12:34:12 +00:00
/**
2015-11-03 12:28:01 +00:00
* WC_Admin_Help Class .
2013-07-24 12:34:12 +00:00
*/
class WC_Admin_Help {
/**
* Hook in tabs .
*/
public function __construct () {
2016-09-01 20:50:14 +00:00
add_action ( 'current_screen' , array ( $this , 'add_tabs' ), 50 );
2013-07-24 12:34:12 +00:00
}
/**
2018-01-08 18:48:25 +00:00
* Add help tabs .
2013-07-24 12:34:12 +00:00
*/
public function add_tabs () {
$screen = get_current_screen ();
2016-02-05 12:16:41 +00:00
if ( ! $screen || ! in_array ( $screen -> id , wc_get_screen_ids () ) ) {
2013-07-24 12:34:12 +00:00
return ;
2014-11-30 06:52:32 +00:00
}
2013-07-24 12:34:12 +00:00
2018-03-05 18:59:17 +00:00
$screen -> add_help_tab (
array (
'id' => 'woocommerce_support_tab' ,
'title' => __ ( 'Help & Support' , 'woocommerce' ),
'content' =>
'<h2>' . __ ( 'Help & Support' , 'woocommerce' ) . '</h2>' .
'<p>' . sprintf (
/* translators: %s: Documentation URL */
__ ( 'Should you need help understanding, using, or extending WooCommerce, <a href="%s">please read our documentation</a>. You will find all kinds of resources including snippets, tutorials and much more.' , 'woocommerce' ),
'https://docs.woocommerce.com/documentation/plugins/woocommerce/?utm_source=helptab&utm_medium=product&utm_content=docs&utm_campaign=woocommerceplugin'
) . '</p>' .
'<p>' . sprintf (
/* translators: %s: Forum URL */
2020-03-05 09:35:13 +00:00
__ ( 'For further assistance with WooCommerce core, use the <a href="%1$s">community forum</a>. For help with premium extensions sold on WooCommerce.com, <a href="%2$s">open a support request at WooCommerce.com</a>.' , 'woocommerce' ),
2018-03-05 18:59:17 +00:00
'https://wordpress.org/support/plugin/woocommerce' ,
2020-03-05 09:35:13 +00:00
'https://woocommerce.com/my-account/create-a-ticket/?utm_source=helptab&utm_medium=product&utm_content=tickets&utm_campaign=woocommerceplugin'
2018-03-05 18:59:17 +00:00
) . '</p>' .
2020-03-05 09:35:13 +00:00
'<p>' . __ ( 'Before asking for help, we recommend checking the system status page to identify any problems with your configuration.' , 'woocommerce' ) . '</p>' .
'<p><a href="' . admin_url ( 'admin.php?page=wc-status' ) . '" class="button button-primary">' . __ ( 'System status' , 'woocommerce' ) . '</a> <a href="https://wordpress.org/support/plugin/woocommerce" class="button">' . __ ( 'Community forum' , 'woocommerce' ) . '</a> <a href="https://woocommerce.com/my-account/create-a-ticket/?utm_source=helptab&utm_medium=product&utm_content=tickets&utm_campaign=woocommerceplugin" class="button">' . __ ( 'WooCommerce.com support' , 'woocommerce' ) . '</a></p>' ,
2018-03-05 18:59:17 +00:00
)
);
2013-07-24 12:34:12 +00:00
2018-03-05 18:59:17 +00:00
$screen -> add_help_tab (
array (
'id' => 'woocommerce_bugs_tab' ,
'title' => __ ( 'Found a bug?' , 'woocommerce' ),
'content' =>
'<h2>' . __ ( 'Found a bug?' , 'woocommerce' ) . '</h2>' .
/* translators: 1: GitHub issues URL 2: GitHub contribution guide URL 3: System status report URL */
'<p>' . sprintf ( __ ( 'If you find a bug within WooCommerce core you can create a ticket via <a href="%1$s">Github issues</a>. Ensure you read the <a href="%2$s">contribution guide</a> prior to submitting your report. To help us solve your issue, please be as descriptive as possible and include your <a href="%3$s">system status report</a>.' , 'woocommerce' ), 'https://github.com/woocommerce/woocommerce/issues?state=open' , 'https://github.com/woocommerce/woocommerce/blob/master/.github/CONTRIBUTING.md' , admin_url ( 'admin.php?page=wc-status' ) ) . '</p>' .
2019-10-17 19:28:01 +00:00
'<p><a href="https://github.com/woocommerce/woocommerce/issues/new?template=4-Bug-report.md" class="button button-primary">' . __ ( 'Report a bug' , 'woocommerce' ) . '</a> <a href="' . admin_url ( 'admin.php?page=wc-status' ) . '" class="button">' . __ ( 'System status' , 'woocommerce' ) . '</a></p>' ,
2015-10-05 22:26:59 +00:00
2018-03-05 18:59:17 +00:00
)
);
2015-10-05 22:26:59 +00:00
2018-03-05 18:59:17 +00:00
$screen -> add_help_tab (
array (
'id' => 'woocommerce_onboard_tab' ,
'title' => __ ( 'Setup wizard' , 'woocommerce' ),
'content' =>
'<h2>' . __ ( 'Setup wizard' , 'woocommerce' ) . '</h2>' .
'<p>' . __ ( 'If you need to access the setup wizard again, please click on the button below.' , 'woocommerce' ) . '</p>' .
'<p><a href="' . admin_url ( 'index.php?page=wc-setup' ) . '" class="button button-primary">' . __ ( 'Setup wizard' , 'woocommerce' ) . '</a></p>' ,
2013-07-24 12:34:12 +00:00
2018-03-05 18:59:17 +00:00
)
);
2013-07-24 12:34:12 +00:00
$screen -> set_help_sidebar (
'<p><strong>' . __ ( 'For more information:' , 'woocommerce' ) . '</strong></p>' .
2018-01-08 18:48:25 +00:00
'<p><a href="https://woocommerce.com/?utm_source=helptab&utm_medium=product&utm_content=about&utm_campaign=woocommerceplugin" target="_blank">' . __ ( 'About WooCommerce' , 'woocommerce' ) . '</a></p>' .
'<p><a href="https://wordpress.org/plugins/woocommerce/" target="_blank">' . __ ( 'WordPress.org project' , 'woocommerce' ) . '</a></p>' .
2018-04-20 18:20:39 +00:00
'<p><a href="https://github.com/woocommerce/woocommerce/" target="_blank">' . __ ( 'Github project' , 'woocommerce' ) . '</a></p>' .
2018-01-10 09:45:03 +00:00
'<p><a href="https://woocommerce.com/storefront/?utm_source=helptab&utm_medium=product&utm_content=wcthemes&utm_campaign=woocommerceplugin" target="_blank">' . __ ( 'Official theme' , 'woocommerce' ) . '</a></p>' .
2018-01-08 18:48:25 +00:00
'<p><a href="https://woocommerce.com/product-category/woocommerce-extensions/?utm_source=helptab&utm_medium=product&utm_content=wcextensions&utm_campaign=woocommerceplugin" target="_blank">' . __ ( 'Official extensions' , 'woocommerce' ) . '</a></p>'
2013-07-24 12:34:12 +00:00
);
}
}
2014-08-27 20:43:12 +00:00
return new WC_Admin_Help ();