| 1 |
<?php |
| 2 |
/** |
| 3 |
* Class Displays the message What's Next. |
| 4 |
* |
| 5 |
* @since 4.1.6 |
| 6 |
* |
| 7 |
* @package responsive_menu_pro |
| 8 |
*/ |
| 9 |
|
| 10 |
class RMNextUpdateMessage { |
| 11 |
|
| 12 |
|
| 13 |
/** |
| 14 |
* Main Construct Function |
| 15 |
* |
| 16 |
* Adds the notice check to init and then check to display message |
| 17 |
* |
| 18 |
* @since 4.1.6 |
| 19 |
*/ |
| 20 |
public function __construct() { |
| 21 |
if ( isset( $_GET['rm_next_update_notice_close'] ) && 'close' === $_GET['rm_next_update_notice_close'] ) { |
| 22 |
add_action( 'admin_init', array( $this, 'close_next_updates_message' ) ); |
| 23 |
} |
| 24 |
if ( isset( $_GET['post_type'] ) && 'rmp_menu' === $_GET['post_type'] ) { |
| 25 |
add_action( 'in_admin_footer', array( $this, 'display_next_updates_message' ) ); |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
|
| 30 |
/** |
| 31 |
* Check if next update message closed |
| 32 |
* |
| 33 |
* @since 4.1.6 |
| 34 |
* @return int The amount of menus needed to display message |
| 35 |
*/ |
| 36 |
public function close_next_updates_message() { |
| 37 |
add_user_meta( get_current_user_id(), 'rm_next_update_notice_close', true, true ); |
| 38 |
} |
| 39 |
|
| 40 |
/** |
| 41 |
* Displays the next update message for next updates |
| 42 |
*/ |
| 43 |
public function display_next_updates_message() { |
| 44 |
if ( get_user_meta( get_current_user_id(), 'rm_next_update_notice_close' ) ) { |
| 45 |
return; |
| 46 |
} |
| 47 |
$update_url = 'https://next.expresstech.io/responsive-menu/updates'; |
| 48 |
$roadmap_url = 'https://next.expresstech.io/responsive-menu'; |
| 49 |
$ideas_url = 'https://next.expresstech.io/responsive-menu#/ideas'; |
| 50 |
$close_url = add_query_arg( 'rm_next_update_notice_close', 'close' ); ?> |
| 51 |
<div class=' notice-responsive-menu-next notice-info is-dismissible'> |
| 52 |
<h3><?php echo esc_html__( "What's Next", 'responsive-menu' ); ?></h3> |
| 53 |
<p><?php echo esc_html__( 'This page shows what has been planned for the Responsive Menu plugin. You can vote on the roadmap cards or add your own idea.', 'responsive-menu' ); ?></p> |
| 54 |
<p><strong><em><?php echo esc_html__( '~ RM Team', 'responsive-menu' ); ?></em></strong></p> |
| 55 |
<a target="_blank" rel="noopener" href="<?php echo esc_url( $roadmap_url ); ?>" class="rm-btn-link" rel="noopener"><?php echo esc_html__( 'Roadmap', 'responsive-menu' ); ?></a> |
| 56 |
<span class="rm-btn-link-seprate">|</span> |
| 57 |
<a target="_blank" rel="noopener" href="<?php echo esc_url( $update_url ); ?>" class="rm-btn-link" rel="noopener"><?php echo esc_html__( 'Updates', 'responsive-menu' ); ?></a> |
| 58 |
<span class="rm-btn-link-seprate">|</span> |
| 59 |
<a target="_blank" rel="noopener" href="<?php echo esc_url( $ideas_url ); ?>" class="rm-btn-link" rel="noopener"><?php echo esc_html__( 'Ideas', 'responsive-menu' ); ?></a> |
| 60 |
<a href="<?php echo esc_url( $close_url ); ?>" class="notice-dismiss"><span class="screen-reader-text"><?php echo esc_html__( 'Dismiss this notice.', 'responsive-menu' ); ?></span></a> |
| 61 |
</div> |
| 62 |
<?php |
| 63 |
} |
| 64 |
} |
| 65 |
|
| 66 |
$rm_xext_update_message = new RMNextUpdateMessage(); |
| 67 |
|