BP_Members_Admin::enqueue_scripts()

Add some specific styling to the Edit User and Edit User’s Profile page.


Description Description


Source Source

File: bp-members/classes/class-bp-members-admin.php

648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
public function enqueue_scripts() {
    if ( ! in_array( get_current_screen()->id, $this->screen_id ) ) {
        return;
    }
 
    $min = bp_core_get_minified_asset_suffix();
    $css = $this->css_url . "admin{$min}.css";
 
    /**
     * Filters the CSS URL to enqueue in the Members admin area.
     *
     * @since 2.0.0
     *
     * @param string $css URL to the CSS admin file to load.
     */
    $css = apply_filters( 'bp_members_admin_css', $css );
 
    wp_enqueue_style( 'bp-members-css', $css, array(), bp_get_version() );
 
    wp_style_add_data( 'bp-members-css', 'rtl', 'replace' );
    if ( $min ) {
        wp_style_add_data( 'bp-members-css', 'suffix', $min );
    }
 
    // Only load JavaScript for BuddyPress profile.
    if ( get_current_screen()->id == $this->user_page ) {
        $js = $this->js_url . "admin{$min}.js";
 
        /**
         * Filters the JS URL to enqueue in the Members admin area.
         *
         * @since 2.0.0
         *
         * @param string $js URL to the JavaScript admin file to load.
         */
        $js = apply_filters( 'bp_members_admin_js', $js );
        wp_enqueue_script( 'bp-members-js', $js, array( 'jquery' ), bp_get_version(), true );
    }
 
    /**
     * Fires after all of the members JavaScript and CSS are enqueued.
     *
     * @since 2.0.0
     *
     * @param string $id        ID of the current screen.
     * @param array  $screen_id Array of allowed screens to add scripts and styles to.
     */
    do_action( 'bp_members_admin_enqueue_scripts', get_current_screen()->id, $this->screen_id );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.