array( esc_html__( 'Added two new color options in Customizer > Colors.', 'cuisine-palace' ), esc_html__( 'Added three new template options, you can see them in Page Attributes option when editing a page or post.', 'cuisine-palace' ), ), ); return isset( $logs[ $theme_version ] ) ? $logs[ $theme_version ] : ''; } /** * Register theme option. */ function cuisine_palace_register_theme_options_page() { $cp_data = get_option( 'cuisine_palace_data', array() ); $theme_version = wp_get_theme()->get( 'Version' ); $logs = cuisine_palace_major_update_logs( $theme_version ); $has_read = ! empty( $cp_data[ $theme_version ]['notification']['read'] ) ? true : false; $notification = null; if ( is_array( $logs ) && ! $has_read ) { $notification .= ' '; $notification .= ''; $notification .= ''; $notification .= count( $logs ); $notification .= ''; $notification .= ''; } add_submenu_page( 'index.php', esc_html__( 'Cuisine Palace', 'cuisine-palace' ), esc_html__( 'Cuisine Palace', 'cuisine-palace' ) . $notification, 'manage_options', 'cuisine-palace', 'cuisine_palace_register_theme_options_page_callback' ); if ( ! $has_read && $logs && isset( $_GET['page'] ) && 'cuisine-palace' === $_GET['page'] ) { $cp_data[ $theme_version ]['notification']['read'] = true; update_option( 'cuisine_palace_data', $cp_data ); } } add_action( 'admin_menu', 'cuisine_palace_register_theme_options_page' ); /** * Display callback for the submenu page. */ function cuisine_palace_register_theme_options_page_callback() { $theme_name = wp_get_theme()->get( 'Name' ); $theme_version = wp_get_theme()->get( 'Version' ); $logs = cuisine_palace_major_update_logs( $theme_version ); ob_start(); if ( is_array( $logs ) && ! empty( $logs ) ) { foreach ( $logs as $log ) { echo wp_kses_post( "
  • {$log}
  • " ); } } $html = ob_get_clean(); ?>