I am experimenting with creating a simple plugin to create a custom post type named project but am having some trouble with the rewrite rules not been flushed on activation.
I have the main plugin file with this function:
register_activation_hook( __FILE__, 'Project_Custom_Post_Type::activate' );
Then within my class I have this:
public function activate() {
flush_rewrite_rules();
}
My class has a construct of:
public function __construct() {
add_action( 'init', array( $this, 'register_post_type' ), 0 );
}
I cannot see why it is not working? My deactivation flush works fine.
'Project_Custom_Post_Type::activate'
is not a valid callable type in PHP