get_contents( $changelog_file );
$changelog_list = bookstore_exhibition_parse_changelog( $changelog );
echo wp_kses_post( $changelog_list );
}
}
function bookstore_exhibition_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( 'bookstore_exhibition_getting_started_menu' ) ) :
/**
* Adding Getting Started Page in admin menu
*/
function bookstore_exhibition_getting_started_menu(){
add_theme_page(
__( 'Getting Started', 'bookstore-exhibition' ),
__( 'Bookstore Exhibition', 'bookstore-exhibition' ),
'manage_options',
'bookstore-exhibition-getting-started',
'bookstore_exhibition_getting_started_page'
);
}
endif;
add_action( 'admin_menu', 'bookstore_exhibition_getting_started_menu' );
if( ! function_exists( 'bookstore_exhibition_getting_started_admin_scripts' ) ) :
/**
* Load Getting Started styles in the admin
*/
function bookstore_exhibition_getting_started_admin_scripts( $hook ){
// Load styles only on our page
if( 'appearance_page_bookstore-exhibition-getting-started' != $hook ) return;
wp_enqueue_style( 'bookstore-exhibition-getting-started', get_template_directory_uri() . '/inc/getting-started/css/getting-started.css', false);
wp_enqueue_script( 'updates' );
wp_enqueue_script( 'bookstore-exhibition-getting-started', get_template_directory_uri() . '/inc/getting-started/js/getting-started.js', array( 'jquery' ), true );
}
endif;
add_action( 'admin_enqueue_scripts', 'bookstore_exhibition_getting_started_admin_scripts' );
if( ! function_exists( 'bookstore_exhibition_getting_started_page' ) ) :
/**
* Callback function for admin page.
*/
function bookstore_exhibition_getting_started_page(){ ?>