| 1 |
<?php |
| 2 |
|
| 3 |
class WPUPG_Activate { |
| 4 |
|
| 5 |
public function __construct() |
| 6 |
{ |
| 7 |
register_activation_hook( WPUltimatePostGrid::get()->pluginFile, array( $this, 'activate_plugin' ) ); |
| 8 |
} |
| 9 |
|
| 10 |
public function activate_plugin() |
| 11 |
{ |
| 12 |
WPUltimatePostGrid::addon( 'custom-templates' )->default_templates( true ); // Reset default templates |
| 13 |
|
| 14 |
// Don't show the activation notice if the new user notice is displayed |
| 15 |
if( get_user_meta( get_current_user_id(), '_wpupg_hide_new_notice', true ) != '' ) { |
| 16 |
$this->activation_notice(); |
| 17 |
} |
| 18 |
} |
| 19 |
|
| 20 |
public function activation_notice() { |
| 21 |
$notice = '<strong>WP Ultimate Post Grid</strong><br/>'; |
| 22 |
$notice .= '<a href="'.admin_url( 'edit.php?post_type=' . WPUPG_POST_TYPE. '&page=wpupg_faq&sub=whats_new' ).'">Check out our latest changes on the <strong>Grids > FAQ</strong> page</a>'; |
| 23 |
|
| 24 |
WPUltimatePostGrid::get()->helper( 'notices' )->add_admin_notice( $notice ); |
| 25 |
} |
| 26 |
} |