| 1 |
<?php |
| 2 |
|
| 3 |
class WPUPG_Faq { |
| 4 |
|
| 5 |
public function __construct() |
| 6 |
{ |
| 7 |
// Actions |
| 8 |
add_action( 'admin_menu', array( $this, 'faq_menu' ), 20 ); |
| 9 |
} |
| 10 |
|
| 11 |
public function faq_menu() { |
| 12 |
add_submenu_page( 'edit.php?post_type=' . WPUPG_POST_TYPE, 'WP Ultimate Post Grid ' . __( 'FAQ', 'wp-ultimate-post-grid' ), __( 'FAQ', 'wp-ultimate-post-grid' ), 'edit_posts', 'wpupg_faq', array( $this, 'faq_page' ) ); |
| 13 |
} |
| 14 |
|
| 15 |
public function faq_page() { |
| 16 |
if ( !current_user_can( 'edit_posts' ) ) { |
| 17 |
wp_die( 'You do not have sufficient permissions to access this page.' ); |
| 18 |
} |
| 19 |
|
| 20 |
// Hide the new user notice |
| 21 |
update_user_meta( get_current_user_id(), '_wpupg_hide_new_notice', get_option( WPUltimatePostGrid::get()->pluginName . '_version') ); |
| 22 |
include( WPUltimatePostGrid::get()->coreDir . '/static/faq.php' ); |
| 23 |
} |
| 24 |
} |