get_contents( $changelog_file ); $changelog_list = cafeteria_elementor_parse_changelog( $changelog ); echo wp_kses_post( $changelog_list ); } } function cafeteria_elementor_parse_changelog( $content ) { $content = explode ( '== ', $content ); $changelog_isolated = ''; foreach ( $content as $key => $value ) { if (strpos( $value, 'Changelog ==') === 0) { $changelog_isolated = str_replace( 'Changelog ==', '', $value ); } } $changelog_array = explode( '= ', $changelog_isolated ); unset( $changelog_array[0] ); $changelog = '
'; foreach ( $changelog_array as $value) { $value = preg_replace( '/\n+/', '', $value ); $value = '
= ' . $value . '

'; $changelog .= str_replace( '', '', $value ); } $changelog .= '
'; return wp_kses_post( $changelog ); } if( ! function_exists( 'cafeteria_elementor_getting_started_menu' ) ) : /** * Adding Getting Started Page in admin menu */ function cafeteria_elementor_getting_started_menu(){ add_theme_page( __( 'Getting Started', 'cafeteria-elementor' ), __( 'Cafeteria Elementor', 'cafeteria-elementor' ), 'manage_options', 'cafeteria-elementor-getting-started', 'cafeteria_elementor_getting_started_page' ); } endif; add_action( 'admin_menu', 'cafeteria_elementor_getting_started_menu' ); if( ! function_exists( 'cafeteria_elementor_getting_started_admin_scripts' ) ) : /** * Load Getting Started styles in the admin */ function cafeteria_elementor_getting_started_admin_scripts( $hook ){ // Load styles only on our page if( 'appearance_page_cafeteria-elementor-getting-started' != $hook ) return; wp_enqueue_style( 'cafeteria-elementor-getting-started', get_template_directory_uri() . '/inc/getting-started/css/getting-started.css', false); wp_enqueue_script( 'updates' ); wp_enqueue_script( 'cafeteria-elementor-getting-started', get_template_directory_uri() . '/inc/getting-started/js/getting-started.js', array( 'jquery' ), true ); } endif; add_action( 'admin_enqueue_scripts', 'cafeteria_elementor_getting_started_admin_scripts' ); if( ! function_exists( 'cafeteria_elementor_getting_started_page' ) ) : /** * Callback function for admin page. */ function cafeteria_elementor_getting_started_page(){ ?>