PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.2.27
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.2.27
1.2.72 1.2.71 1.2.70 1.2.69 1.2.68 1.2.67 1.2.66 1.2.65 1.2.64 1.2.63 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.23 All 172 releases
userswp / admin / class-uwp-admin-help.php

class-uwp-admin-help.php in UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP 1.2.27, at admin/class-uwp-admin-help.php

106 lines 5.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Add some content to the help tab
4 *
5 * @version 1.2.0
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit;
10 }
11
12 if( !class_exists('UsersWP_Admin_Help') ) {
13
14 class UsersWP_Admin_Help{
15
16 public function __construct() {
17 add_action( 'current_screen', array( $this, 'add_tabs' ), 50 );
18 }
19
20 public function get_screen_ids() {
21 $screen_ids = uwp_get_screen_ids();
22
23 return apply_filters( 'uwp_admin_help_screen_ids', $screen_ids );
24 }
25
26 public function add_tabs() {
27
28 $screen = get_current_screen();
29
30 $screen_ids = $this->get_screen_ids();
31
32 if ( ! $screen || ! in_array( $screen->id, $screen_ids) ) {
33 return;
34 }
35
36 $screen->add_help_tab( array(
37 'id' => 'uwp_help_support_tab',
38 'title' => __( 'Help &amp; Support', 'userswp' ),
39 'content' => $this->get_support_tab_content()
40 ) );
41
42 $screen->add_help_tab( array(
43 'id' => 'uwp_help_bugs_tab',
44 'title' => __( 'Found a bug?', 'userswp' ),
45 'content' => $this->get_bugs_tab_content()
46 ) );
47
48 $screen->add_help_tab( array(
49 'id' => 'uwp_help_onboard_tab',
50 'title' => __( 'Setup wizard', 'userswp' ),
51 'content' => $this->get_onboard_tab_content()
52 ) );
53
54 $screen->set_help_sidebar( $this->get_help_tab_sidebar_content());
55
56 $section = !empty( $_GET['section'] ) ? '_'.esc_attr($_GET['section']) : '';
57
58 do_action( 'uwp_adds_help_screen_tabs'.$section,$screen );
59
60 }
61
62 public function get_support_tab_content() {
63
64 $support_html = "<h2>".__('Help & Support','userswp')."</h2>";
65 $support_html .= "<p>".sprintf(__('Should you need help understanding, using, or extending UsersWP <a href="%1$s">please read our documentation</a>. You will find all kinds of resources including snippets, tutorials and much more.,','userswp'),'https://userswp.io/docs/?utm_source=setupwizard&utm_medium=product&utm_content=getting-started&utm_campaign=userswpplugin')."</p>";
66 $support_html .= "<p>".sprintf(__('For further assistance with UsersWP core or with premium extensions sold by UsersWP you can use our <a href="%1$s">support forums</a>.','userswp'),'https://userswp.io/support/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=userswpplugin')."</p>";
67 $support_html .= "<p>".__('Before asking for help we recommend checking the system status page to identify any problems with your configuration.','userswp')."</p>";
68 $support_html .= "<p><a class='button button-primary' href='".admin_url( 'admin.php?page=uwp_status' )."'>".__( 'System status', 'userswp' )."</a> <a class='button' href='https://userswp.io/support/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=userswpplugin'>".__( 'UsersWP support', 'userswp' )."</a></p>";
69 return apply_filters('uwp_support_help_tab_content',$support_html);
70 }
71
72 public function get_bugs_tab_content() {
73
74 $bugs_html = "<h2>".__('Found a bug?','userswp')."</h2>";
75 $bugs_html .= "<p>".sprintf(__('If you find a bug within UsersWP 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>','userswp'),'https://github.com/UsersWP/userswp/issues?state=open','https://github.com/UsersWP/userswp/blob/master/CONTRIBUTING.md',admin_url( 'admin.php?page=uwp_status' ))."</p>";
76 $bugs_html .= "<p><a href='https://github.com/UsersWP/userswp/issues?state=open' class='button button-primary'>". __( 'Report a bug', 'userswp' ) ."</a> <a href='".admin_url( 'admin.php?page=uwp_status' )."' class='button'>".__( 'System status', 'userswp' )."</a></p>";
77
78 return apply_filters('uwp_bugs_help_tab_content',$bugs_html);
79 }
80
81 public function get_onboard_tab_content() {
82
83 $onboard_html = "<h2>".__('Setup wizard','userswp')."</h2>";
84 $onboard_html .= "<p>".__('If you need to access the setup wizard again, please click on the button below.','userswp')."</p>";
85 $onboard_html .= "<p>".__('Running the wizard again will not delete your current settings. You will have the option to change any current settings.','userswp')."</p>";
86 $onboard_html .= "<p><a href='".admin_url( 'index.php?page=uwp-setup' )."' class='button button-primary'>".__('Setup wizard','userswp')."</a></p>";
87
88 return apply_filters('uwp_setup_wizard_help_tab_content',$onboard_html);
89
90 }
91
92 public function get_help_tab_sidebar_content() {
93
94 $sidebar_html = '<p><strong>' . __( 'For more information:', 'userswp' ) . '</strong></p>';
95 $sidebar_html .= '<p><a target="_blank" href="https://userswp.io/?utm_source=helptab&utm_medium=product&utm_content=about&utm_campaign=userswpplugin">'.__('About UsersWP','userswp').'</a></p>';
96 $sidebar_html .= '<p><a target="_blank" href="https://wordpress.org/plugins/userswp/">'.__('WordPress.org project','userswp').'</a></p>';
97 $sidebar_html .= '<p><a target="_blank" href="https://github.com/UsersWP/userswp">'.__('Github project','userswp').'</a></p>';
98 $sidebar_html .= '<p><a target="_blank" href="https://userswp.io/downloads/category/addons/?utm_source=helptab&utm_medium=product&utm_content=uwpextensions&utm_campaign=userswpplugin">'.__('Official extensions','userswp').'</a></p>';
99
100 return apply_filters('uwp_sidebar_help_tab_content',$sidebar_html);
101 }
102
103 }
104
105 new UsersWP_Admin_Help();
106 }