该插件在激活期间生成了 880 个字符的意外输出。如果您注意到“标头已发送”消息、联合提要问题或其他问题,请尝试停用或删除此插件。
安装插件时出现此错误,请任何人都可以帮助这里是代码
<?php
/*
Plugin Name: Post Bottom Content Generator
Plugin URI: NULL
Description: This will add a image with url at the end of the post content.
Version: 1.0
Author: All Marketing Solutions
Author URI:
*/
//table creation in the wordpress database
global $AMS_post_plugin_db_version;
$AMS_post_plugin_db_version = "1.0";
function create_AMS_table ()
{
global $wpdb;
$table_name = $wpdb->prefix . "AMS_post_plugin";
$sql = "CREATE TABLE $table_name (
AMS_post_plugin_id mediumint(9) NOT NULL AUTO_INCREMENT,
AMS_post_plugin_time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
AMS_post_plugin_name VARCHAR(55) NOT NULL,
AMS_post_plugin_url VARCHAR(55) NOT NULL,
AMS_post_plugin_path VARCHAR(200) NOT NULL,
UNIQUE KEY id (id)
);";
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($sql);
add_option("AMS_post_plugin_db_version", $AMS_post_plugin_db_version);
}
function insert_AMS_table()
{
global $wpdb;
$name = "talha";
$url = "talha";
$path="talha";
$rows_affected = $wpdb->insert( $table_name, array( 'AMS_post_plugin_time' => current_time('mysql'), 'AMS_post_plugin_name' => $name, 'AMS_post_plugin_url' => $url, 'AMS_post_plugin_path' => $path ) );
}
///these will activate these functions when plugin install
register_activation_hook(__FILE__,'create_AMS_table');
register_activation_hook(__FILE__,'insert_AMS_table');
?>