i am trying to call a callable function that will write a file when plugin is activated
this is my code
register_activation_hook( __FILE__, 'ordero_create');
function ordero_create(){
$file = plugin_dir_path( __FILE__ ) . '/errors.txt';
$open = fopen( $file, "a" );
with above code, plugin is successfully activated but ordero_create() function is not being called.
when i change register_activation_hook to become like this
register_activation_hook( __FILE__, ordero_create());
the plugin is successfully activated and ordero_create() function is being called. but there is a warning like this
The plugin generated 230 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.
i'm sure there is no space or new line after ?> or before <?php