Support » Plugins » HELP: function add_filter works at local, does't work on server

  • jdleung

    (@jdleung)


    I’m writing a plugin with similar following codes:

    add_filter( 'the_content' , 'my_function' );
    function my_function( $content ) {
    	$test_config['timeframe'] = '7d';
    	update_option('test_config',$test_config);
    	return $content;
    }

    It works well on my computer local test, but when I upload it to the server, it refuse to work.

    I tried add_action(‘wp_head’, ‘my_function’), it works.

    Any help?

    Thanks.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘HELP: function add_filter works at local, does't work on server’ is closed to new replies.