Пример #1
0
function sp_is_bp_plugin_installed()
{
    $bp_components = sp_get_bp_components();
    // print_r_html( $bp_components );
    foreach ($bp_components as $bp_component) {
        if (sp_is_bp_plugin($bp_component)) {
            return true;
        }
    }
    return false;
}
function sp_admin_bp_plugins_tabs()
{
    global $bp;
    // Getting saved data
    $bp_seo_components = get_blog_option(SITE_ID_CURRENT_SITE, "bp_seo_plugins");
    // <===== Have to be replaced with framework !!!
    $tabs = new TK_WP_JQUERYUI_TABS();
    // Getting all active components
    $bp_components = sp_get_bp_components();
    foreach ($bp_components as $bp_component) {
        // If component is a plugin -> Add tab
        if (sp_is_bp_plugin($bp_component)) {
            $tab_name = ucwords(strtolower(str_replace('_', ' ', $bp_component)));
            $tabs->add_tab('cap_' . $bp_component, $tab_name, seopress_component_tab($bp_component));
        }
    }
    $html = $tabs->get_html();
    return $html;
}