diff --git a/admin/hooks/admin-print-styles.php b/admin/hooks/admin-print-styles.php new file mode 100644 index 00000000..c6d1f780 --- /dev/null +++ b/admin/hooks/admin-print-styles.php @@ -0,0 +1,54 @@ +id != 'settings_page_sportspress' ): + + if ( isset( $_GET['sportspress_installed'] ) ): + update_option( 'sportspress_installed', $_GET['sportspress_installed'] ); + endif; + + if ( ! get_option( 'sportspress_installed' ) ): + add_action( 'admin_notices', 'sportspress_admin_install_notices' ); + endif; + + endif; + + $template = get_option( 'template' ); + + if ( ! current_theme_supports( 'sportspress' ) && ! in_array( $template, array( 'twentyfourteen', 'twentythirteen', 'twentyeleven', 'twentytwelve', 'twentyten' ) ) ): + + if ( ! empty( $_GET['hide_sportspress_theme_support_check'] ) ): + update_option( 'sportspress_theme_support_check', $template ); + return; + endif; + + if ( get_option( 'sportspress_theme_support_check' ) !== $template ): + add_action( 'admin_notices', 'sportspress_theme_check_notice' ); + endif; + + endif; + +} +add_action( 'admin_print_styles', 'sportspress_admin_notices_styles' ); + +/** + * sportspress_admin_install_notices function. + * + * @access public + * @return void + */ +function sportspress_admin_install_notices() { + include( dirname( SPORTSPRESS_PLUGIN_FILE ) . '/admin/includes/notice-install.php' ); +} + +/** + * sportspress_theme_check_notice function. + * + * @access public + * @return void + */ +function sportspress_theme_check_notice() { + include( dirname( SPORTSPRESS_PLUGIN_FILE ) . '/admin/includes/notice-theme-support.php' ); +} diff --git a/admin/hooks/plugin-action-links.php b/admin/hooks/plugin-action-links.php index 804c2687..a5c3e6a6 100644 --- a/admin/hooks/plugin-action-links.php +++ b/admin/hooks/plugin-action-links.php @@ -1,9 +1,10 @@ ' . __( 'Settings', 'sportspress' ) . ''; - $themes_link = '' . __( 'Themes', 'sportspress' ) . ''; + $docs_link = '' . __( 'Docs', 'sportspress' ) . ''; + $themes_link = '' . __( 'Themes', 'sportspress' ) . ''; - array_unshift( $links, $settings_link, $themes_link ); + array_unshift( $links, $settings_link, $docs_link, $themes_link ); return $links; } diff --git a/admin/includes/notice-install.php b/admin/includes/notice-install.php new file mode 100644 index 00000000..b242cd29 --- /dev/null +++ b/admin/includes/notice-install.php @@ -0,0 +1,10 @@ + +
+

+

+ + +

+
\ No newline at end of file diff --git a/admin/includes/notice-theme-support.php b/admin/includes/notice-theme-support.php new file mode 100644 index 00000000..45662965 --- /dev/null +++ b/admin/includes/notice-theme-support.php @@ -0,0 +1,10 @@ + +
+

Your theme does not declare SportsPress support – if you encounter layout issues please read our integration guide or choose a SportsPress theme :)', 'sportspress' ); ?>

+

+ + +

+
diff --git a/sportspress.php b/sportspress.php index a59dc974..a6996384 100644 --- a/sportspress.php +++ b/sportspress.php @@ -81,6 +81,7 @@ require_once dirname( __FILE__ ) . '/admin/hooks/wp-enqueue-scripts.php'; // Admin request actions require_once dirname( __FILE__ ) . '/admin/hooks/admin-menu.php'; require_once dirname( __FILE__ ) . '/admin/hooks/admin-enqueue-scripts.php'; +require_once dirname( __FILE__ ) . '/admin/hooks/admin-print-styles.php'; require_once dirname( __FILE__ ) . '/admin/hooks/admin-head.php'; // Administrative actions