PluginProbe
WP Ultimate Post Grid / 2.1
WP Ultimate Post Grid v2.1
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
wp-ultimate-post-grid / helpers / activate.php

activate.php in WP Ultimate Post Grid 2.1, at helpers/activate.php

26 lines 971 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 }