Plugin throws error due to recent changes in php 7
-
I have the following setup:
php: 7.2.24-0ubuntu0.18.04.6
wordpress: 5.4.2Opening the plugin management page in admin area throws this error:
PHP Fatal error: Uncaught Error: [] operator not supported for strings in /wp-content/plugins/easy-image-collage/helpers/plugin_action_link.php:12 Stack trace: #0 /wp-includes/class-wp-hook.php(289): EIC_Plugin_Action_Link->action_links('<') #1 /wp-includes/plugin.php(206): WP_Hook->apply_filters('<', Array) #2 /wp-admin/includes/class-wp-plugins-list-table.php(826): apply_filters('plugin_action_l...', '<', 'easy-image-coll...', Array, 'search') #3 /wp-admin/includes/class-wp-plugins-list-table.php(605): WP_Plugins_List_Table->single_row(Array) #4 /wp-admin/includes/class-wp-list-table.php(1273): WP_Plugins_List_Table->display_rows() #5 /wp-admin/includes/class-wp-list-table.php(1204): WP_List_Table->display_rows_or_placeholder() #6 /var/www/html/v2/wp-admin/plugins.php(637): WP_List_Table->display() #7 {main} thrown in /wp-content/plugins/easy-image-collage/helpers/plugin_action_link.php on line 12It seems to be related to a recent change in php that handles
[]operator differently: https://www.php.net/manual/en/language.types.array.php#language.types.array.syntax.modifying (see notes)Line #12 throws the error:
<?php class EIC_Plugin_Action_Link { public function __construct() { add_filter( 'plugin_action_links_' . EasyImageCollage::get()->corePath . '/easy-image-collage.php', array( $this, 'action_links' ) ); } public function action_links( $links ) { $links[] = '<a href="'. get_admin_url(null, 'options-general.php?page=eic_settings') .'">'.__( 'Settings', 'easy-image-collage' ).'</a>'; return $links; } }%
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Plugin throws error due to recent changes in php 7’ is closed to new replies.