This function has been deprecated. BuddyPress 2.8.0 instead.
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
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
- $file
-
(Required) Plugin filename. buddypress/bp-loader.php.
- $plugin_data
-
(Required) Data about the BuddyPress plugin, as returned by the plugins API.
Source
File: bp-core/deprecated/buddypress/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.', 'buddyboss' ) . ' ' .
sprintf( __( 'See <a href="%s">the Codex guide</a> for more information.', 'buddyboss' ), '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>";
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 2.8.0 | BuddyPress 2.8.0 |
| BuddyPress 2.7.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.