Skip to:
Content

BuddyPress.org

Ticket #6716: 6716.patch

File 6716.patch, 1.8 KB (added by imath, 10 years ago)
  • src/bp-templates/bp-legacy/buddypress-functions.php

    diff --git src/bp-templates/bp-legacy/buddypress-functions.php src/bp-templates/bp-legacy/buddypress-functions.php
    index c5974e2..425cac2 100644
    class BP_Legacy extends BP_Theme_Compat { 
    267267                                }
    268268                        }
    269269                }
     270
     271                /**
     272                 * Fires when the BP Legacy stylesheets are enqueued
     273                 *
     274                 * @since  2.4.?
     275                 *
     276                 * @param  array $value {
     277                 *     @type string $handle   The buddypress.css handle name
     278                 *     @type array  $location The buddypress.css location uri
     279                 * }
     280                 */
     281                do_action( 'bp_legacy_styles_enqueued', isset( $rtl ) ? $rtl : $ltr );
    270282        }
    271283
    272284        /**
    function bp_legacy_theme_cover_image( $params = array() ) { 
    19261938                }
    19271939        ';
    19281940}
     1941
     1942/**
     1943 * Back Compat bp-screen-reader-text class for themes overriding buddypress.css
     1944 *
     1945 * @since  2.4.?
     1946 *
     1947 * @param  array  $css An associative array containing the css handle and location
     1948 * @return string inline style
     1949 */
     1950function bp_legacy_theme_styles_enqueued( $css = array() ) {
     1951        if ( ! isset( $css['handle'] ) || 0 === strpos( $css['handle'], 'bp-legacy' ) ) {
     1952                return;
     1953        }
     1954
     1955        wp_add_inline_style( $css['handle'], '
     1956                /**
     1957                 * Back Compat BP Screen Reader Class
     1958                 *
     1959                 * If you are already using this class inside your custom buddypress.css
     1960                 * you can remove this inline style using:
     1961                 * remove_action( \'bp_legacy_styles_enqueued\', \'bp_legacy_theme_styles_enqueued\', 10, 1 )
     1962                 */
     1963                .bp-screen-reader-text {
     1964                        position: absolute;
     1965                        margin: -1px;
     1966                        padding: 0;
     1967                        height: 1px;
     1968                        width: 1px;
     1969                        overflow: hidden;
     1970                        clip: rect(0 0 0 0);
     1971                        border: 0;
     1972                        word-wrap: normal !important;
     1973                }
     1974        ' );
     1975}
     1976add_action( 'bp_legacy_styles_enqueued', 'bp_legacy_theme_styles_enqueued', 10, 1 );