0

我已经使用了 register_activation_hook 但它没有用。

<?php
  /*
  * Plugin Name: practice
  * Plugin URI: http://ramguiao.tk
  * Description: practice
  * Version: 1.0
  * Author: Ram Guiao
  * Author URI: http://ramguiao.tk 
  */

 register_activation_hook(_FILE_,"showMessage");

 function showMessage(){
     echo "activated";
 }

?>

谢谢!

4

1 回答 1

3

改变:

register_activation_hook(_FILE_,"showMessage");

至:

register_activation_hook(__FILE__,"showMessage");
于 2012-05-17T04:04:05.433 回答