| | 1763 | * bp_core_get_theme_warning() |
| | 1764 | * |
| | 1765 | * Returns a warning if the current theme could maybe incompatible with BuddyPress |
| | 1766 | * |
| | 1767 | * @package BuddyPress Core |
| | 1768 | * @uses current_theme_supports() Check if the current theme supports a feature |
| | 1769 | */ |
| | 1770 | function bp_core_get_theme_warning() { |
| | 1771 | if ( false == function_exists( "current_theme_supports" ) ) |
| | 1772 | return; |
| | 1773 | |
| | 1774 | if ( current_theme_supports( "buddypress" ) ) |
| | 1775 | return; |
| | 1776 | |
| | 1777 | if ( isset( $_GET["dismiss_theme_warning"] ) ) |
| | 1778 | update_site_option("dismiss_theme_warning", "1"); |
| | 1779 | |
| | 1780 | if ( is_site_admin() && "1" != get_site_option("dismiss_theme_warning") ) |
| | 1781 | echo '<div style="color:red;" id="update-nag">' . __( 'WARNING: Your current theme could be maybe incompatible with BuddyPress. Please contact the theme author.', 'buddypress' ) . ' <a href="index.php?dismiss_theme_warning=true">' . __( "Dismiss", "buddypress" ) . '</a></div>'; |
| | 1782 | } |
| | 1783 | |
| | 1784 | add_action( 'admin_notices', 'bp_core_get_theme_warning' ); |
| | 1785 | |
| | 1786 | /** |
| | 1787 | * bp_core_set_theme_warning() |
| | 1788 | * |
| | 1789 | * Set the warning if the current theme could maybe incompatible with BuddyPress |
| | 1790 | * |
| | 1791 | * @package BuddyPress Core |
| | 1792 | * @uses current_theme_supports() Check if the current theme supports a feature |
| | 1793 | */ |
| | 1794 | function bp_core_set_theme_warning( $theme ) { |
| | 1795 | if ( false == function_exists( "current_theme_supports" ) ) |
| | 1796 | return; |
| | 1797 | |
| | 1798 | if ( current_theme_supports( "buddypress" ) ) |
| | 1799 | return; |
| | 1800 | |
| | 1801 | update_site_option("dismiss_theme_warning", $theme); |
| | 1802 | } |
| | 1803 | |
| | 1804 | add_action( "switch_theme", "bp_core_set_theme_warning" ); |
| | 1805 | |
| | 1806 | /** |