HEX
Server: LiteSpeed
System: Linux premium140.web-hosting.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
User: ukqcurpj (1011)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/ukqcurpj/public_html/wp-content/plugins/buddypress/bp-friends/bp-friends-cssjs.php
<?php
/**
 * BP Friends component CSS/JS.
 *
 * @package BuddyPress
 * @subpackage FriendsScripts
 * @since 9.0.0
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

/**
 * Registers the script to manage the dynamic part of the Friends widget/block.
 *
 * @since 9.0.0
 * @since 12.0.0 Uses the `@wordpress/scripts` `index.asset.php` generated file to get dependencies.
 *
 * @param array $scripts Data about the scripts to register.
 * @return array Data about the scripts to register.
 */
function bp_friends_register_scripts( $scripts = array() ) {
	if ( ! bp_support_blocks() ) {
		return $scripts;
	}

	$asset      = array(
		'dependencies' => array(),
		'version'      => ''
	);
	$asset_path = trailingslashit( dirname( __FILE__ ) ) . 'blocks/dynamic-widget/index.asset.php';

	if ( file_exists( $asset_path ) ) {
		$asset = require $asset_path;
	}

	$scripts['bp-friends-script'] = array(
		'file'         => plugins_url( 'blocks/dynamic-widget/index.js', __FILE__ ),
		'dependencies' => $asset['dependencies'],
		'footer'       => true,
	);

	return $scripts;
}
add_filter( 'bp_core_register_common_scripts', 'bp_friends_register_scripts', 9, 1 );