Ich erhalte diese Fehlermeldung, wenn ich versuche, mein Plugin zu aktivieren:
call_user_func_array() erwartet, dass Parameter 1 ein gültiger Rückruf ist, die Funktion „fancy_lists_create_table“ nicht gefunden wird oder der Funktionsname in /Applications/XAMPP/xamppfiles/htdocs/intranet/wp-includes/plugin.php in Zeile 525 ungültig ist
Dies wurde von einem Plugin ausgegeben, das den häufig auftretenden Fehler „xxx Zeichen unerwarteter Ausgabe“ behebt. Ich verstehe nicht, warum die Funktion nicht gültig ist. Code unten:
namespace fancy_lists;
register_activation_hook( __FILE__, 'fancy_lists_create_table' );
function fancy_lists_create_table(){
global $wpdb;
$table_name = $wpdb->prefix.'fancy_lists';
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
$charset_collate = $wpdb->get_charset_collate();
$sql = "CREATE TABLE $table_name (
id mediumint(9) NOT NULL AUTO_INCREMENT,
created datetime DEFAULT NOW() NOT NULL,
created_by text NOT NULL,
list_name text NOT NULL,
column_config text NOT NULL,
permissions text NOT NULL,
notifications text NOT NULL,
UNIQUE KEY id (id)
) $charset_collate;";
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta( $sql );
}
}