id; $pname = get_option( 'aff_pname', AFFILIATES_PNAME ); $show_affiliates_help = false; $title = '

'; $title .= esc_html__( 'Affiliates', 'affiliates' ); $title .= '

'; $help = apply_filters( 'affiliates_help_tab_title', $title ); switch ( $screen_id ) { case 'toplevel_page_affiliates-admin' : case 'affiliates_page_affiliates-admin-affiliates': case 'affiliates_page_affiliates-admin-hits' : case 'affiliates_page_affiliates-admin-hits-affiliate' : case 'affiliates_page_affiliates-admin-totals' : case 'affiliates_page_affiliates-admin-referrals' : case 'affiliates_page_affiliates-admin-options' : $show_affiliates_help = true; break; default: $show_affiliates_help = strpos( $screen_id, 'affiliates_page_affiliates' ) !== false || apply_filters( 'affiliates_admin_help_show_screen', false, $screen_id ); } $help .= self::affiliates_help_tab_footer( false ); if ( !defined( 'AFFILIATES_PRO_PLUGIN_DOMAIN' ) && !defined( 'AFFILIATES_ENTERPRISE_PLUGIN_DOMAIN' ) ) { $help .= '

'; $help .= esc_html__( 'We highly appreciate it if you support our work by using our commercial software.', 'affiliates' ); $help .= '

'; $help .= '

'; $help .= affiliates_donate( false, true ); $help .= '

'; } if ( $show_affiliates_help ) { $screen->add_help_tab( array( 'id' => 'affiliates', 'title' => esc_html__( 'Affiliates', 'affiliates' ), 'content' => $help ) ); } } } /** * Returns or renders the common footer for help tabs. * * @param boolean $render * * @return string or nothing */ public static function affiliates_help_tab_footer( $render = true ) { $prefix = '

'; $prefix .= esc_html__( 'The complete documentation is available on the Documentation pages …', 'affiliates' ); $prefix .= '

'; $footer = '
' . sprintf( '%s', esc_url( 'https://docs.itthinx.com/document/affiliates/' ), esc_html__( 'Online documentation', 'affiliates' ) ) . '
'; $footer = apply_filters( 'affiliates_help_tab_footer', $footer ); $footer = $prefix . $footer; if ( $render ) { echo $footer; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } else { return $footer; } } } Affiliates_Admin_Help::init();