WP_Compat::using_block_function_row( string $plugin_file, array $plugin_data )
Action hooked to after_plugin_row to display plugins that may not work properly.
Parameters
- $plugin_file
-
(Required)
- $plugin_data
-
(Required)
Return
(void)
Source
File: wp-includes/classicpress/class-wp-compat.php
public function using_block_function_row( $plugin_file, $plugin_data ) {
$plugins_using_blocks = get_option( 'plugins_using_blocks', array() );
if ( ! array_key_exists( dirname( $plugin_file ), $plugins_using_blocks ) && ! array_key_exists( $plugin_file, $plugins_using_blocks ) ) {
return;
}
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
$active = is_plugin_active( $plugin_file ) ? 'active' : '';
$shadow = isset( $plugin_data['new_version'] ) ? 'style="box-shadow: none;"' : '';
?>
<tr class="plugin-update-tr <?php echo $active; ?>">
<td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="plugin-update colspanchange" <?php echo $shadow; ?>>
<div class="notice inline notice-warning">
<p>
<?php
// Translators: %1$s is the plugin name.
printf( esc_html__( '%1$s uses block-related functions and may have issues.' ), $plugin_data['Name'] );
?>
<a href="https://docs.classicpress.net/user-guides/using-classicpress/settings-general-screen/#blocks-compatibility"><?php _e( 'Learn more' ); ?></a> |
<a href="https://forums.classicpress.net/new-topic?category=plugins/plugin-support&tags=blocks-compatibility&title=<?php echo urlencode( $plugin_data['Name'] ); ?>+blocks+compatibility"><?php _e( 'Report an issue ›' ); ?></a>
</p>
</div>
</td>
</tr>
<script>
document.querySelector('tr[data-plugin="<?php echo $plugin_file; ?>"').classList.add('update');
</script>
<?php
}