Warning: This function has been deprecated.

bp_core_admin_php52_plugin_row( string $file, array $plugin_data )

Outputs a replacement for WP’s default update notice, when site is not running PHP 5.3 or greater.


Description Description

When we see that a site is not running PHP 5.3 and is trying to update to BP 2.8+, we replace WP’s default notice with our own, which both provides a link to our documentation of the requirement, and removes the link that allows a single plugin to be updated.


Parameters Parameters

$file

(Required) Plugin filename. buddypress/bp-loader.php.

$plugin_data

(Required) Data about the BuddyPress plugin, as returned by the plugins API.


Top ↑

Source Source

File: bp-core/deprecated/2.8.php

function bp_core_admin_php52_plugin_row( $file, $plugin_data ) {
	_deprecated_function( __FUNCTION__, '2.8' );

	if ( is_multisite() && ! is_network_admin() ) {
		return;
	}

	$current = get_site_transient( 'update_plugins' );
	if ( ! isset( $current->response[ $file ] ) ) {
		return false;
	}

	$response = $current->response[ $file ];

	// No need to do this if update is for < BP 2.8.
	if ( version_compare( $response->new_version, '2.8', '<' ) ) {
		return false;
	}

	$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );

	if ( is_network_admin() ) {
		$active_class = is_plugin_active_for_network( $file ) ? ' active' : '';
	} else {
		$active_class = is_plugin_active( $file ) ? ' active' : '';
	}

	// WP 4.6 uses different markup for the plugin row notice.
	if ( function_exists( 'wp_get_ext_types' ) ) {
		$p = '<p>%s</p>';

	// WP < 4.6.
	} else {
		$p = '%s';

		// Ugh.
		$active_class .= ' not-shiny';
	}

	echo '<tr class="plugin-update-tr' . $active_class . '" id="' . esc_attr( $response->slug . '-update' ) . '" data-slug="' . esc_attr( $response->slug ) . '" data-plugin="' . esc_attr( $file ) . '"><td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange"><div class="update-message inline notice notice-error notice-alt">';

	printf( $p,
		esc_html__( 'A BuddyPress update is available, but your system is not compatible.', 'buddypress' ) . ' ' .
		sprintf( __( 'See <a href="%s">the Codex guide</a> for more information.', 'buddypress' ), 'https://codex.buddypress.org/getting-started/buddypress-2-8-will-require-php-5-3/' )
	);

	echo '</div></td></tr>';

	/*
	 * JavaScript to disable the bulk upgrade checkbox.
	 * See WP_Plugins_List_Table::single_row().
	 */
	$checkbox_id = 'checkbox_' . md5( $plugin_data['Name'] );
	echo "<script type='text/javascript'>document.getElementById('$checkbox_id').disabled = true;</script>";
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.8.0 This function has been deprecated.
2.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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