', esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'aster_startup_pingback_header' ); /** * Get all posts for customizer Post content type. */ function aster_startup_get_post_choices() { $aster_startup_choices = array( '' => esc_html__( '--Select--', 'aster-startup' ) ); $aster_startup_args = array( 'numberposts' => -1 ); $aster_startup_posts = get_posts( $aster_startup_args ); foreach ( $aster_startup_posts as $aster_startup_post ) { $aster_startup_id = $aster_startup_post->ID; $aster_startup_title = $aster_startup_post->post_title; $aster_startup_choices[ $aster_startup_id ] = $aster_startup_title; } return $aster_startup_choices; } /** * Get all pages for customizer Page content type. */ function aster_startup_get_page_choices() { $aster_startup_choices = array( '' => esc_html__( '--Select--', 'aster-startup' ) ); $aster_startup_pages = get_pages(); foreach ( $aster_startup_pages as $aster_startup_page ) { $aster_startup_choices[ $aster_startup_page->ID ] = $aster_startup_page->post_title; } return $aster_startup_choices; } /** * Get all categories for customizer Category content type. */ function aster_startup_get_post_cat_choices() { $aster_startup_choices = array( '' => esc_html__( '--Select--', 'aster-startup' ) ); $aster_startup_cats = get_categories(); foreach ( $aster_startup_cats as $aster_startup_cat ) { $aster_startup_choices[ $aster_startup_cat->term_id ] = $aster_startup_cat->name; } return $aster_startup_choices; } /** * Get all donation forms for customizer form content type. */ function aster_startup_get_post_donation_form_choices() { $aster_startup_choices = array( '' => esc_html__( '--Select--', 'aster-startup' ) ); $aster_startup_posts = get_posts( array( 'post_type' => 'give_forms', 'numberposts' => -1, ) ); foreach ( $aster_startup_posts as $aster_startup_post ) { $aster_startup_choices[ $aster_startup_post->ID ] = $aster_startup_post->post_title; } return $aster_startup_choices; } if ( ! function_exists( 'aster_startup_excerpt_length' ) ) : /** * Excerpt length. */ function aster_startup_excerpt_length( $aster_startup_length ) { if ( is_admin() ) { return $aster_startup_length; } return get_theme_mod( 'aster_startup_excerpt_length', 20 ); } endif; add_filter( 'excerpt_length', 'aster_startup_excerpt_length', 999 ); if ( ! function_exists( 'aster_startup_excerpt_more' ) ) : /** * Excerpt more. */ function aster_startup_excerpt_more( $aster_startup_more ) { if ( is_admin() ) { return $aster_startup_more; } return '…'; } endif; add_filter( 'excerpt_more', 'aster_startup_excerpt_more' ); if ( ! function_exists( 'aster_startup_sidebar_layout' ) ) { /** * Get sidebar layout. */ function aster_startup_sidebar_layout() { $aster_startup_sidebar_position = get_theme_mod( 'aster_startup_sidebar_position', 'right-sidebar' ); $aster_startup_sidebar_position_post = get_theme_mod( 'aster_startup_post_sidebar_position', 'right-sidebar' ); $aster_startup_sidebar_position_page = get_theme_mod( 'aster_startup_page_sidebar_position', 'right-sidebar' ); if ( is_home() ) { $aster_startup_sidebar_position = $aster_startup_sidebar_position_post; } elseif ( is_page() ) { $aster_startup_sidebar_position = $aster_startup_sidebar_position_page; } return $aster_startup_sidebar_position; } } if ( ! function_exists( 'aster_startup_is_sidebar_enabled' ) ) { /** * Check if sidebar is enabled. */ function aster_startup_is_sidebar_enabled() { $aster_startup_sidebar_position = get_theme_mod( 'aster_startup_sidebar_position', 'right-sidebar' ); $aster_startup_sidebar_position_post = get_theme_mod( 'aster_startup_post_sidebar_position', 'right-sidebar' ); $aster_startup_sidebar_position_page = get_theme_mod( 'aster_startup_page_sidebar_position', 'right-sidebar' ); $aster_startup_sidebar_enabled = true; if ( is_single() || is_archive() || is_search() ) { if ( 'no-sidebar' === $aster_startup_sidebar_position ) { $aster_startup_sidebar_enabled = false; } } elseif ( is_home() ) { if ( 'no-sidebar' === $aster_startup_sidebar_position || 'no-sidebar' === $aster_startup_sidebar_position_post ) { $aster_startup_sidebar_enabled = false; } } elseif ( is_page() ) { if ( 'no-sidebar' === $aster_startup_sidebar_position || 'no-sidebar' === $aster_startup_sidebar_position_page ) { $aster_startup_sidebar_enabled = false; } } return $aster_startup_sidebar_enabled; } } if ( ! function_exists( 'aster_startup_get_homepage_sections ' ) ) { /** * Returns homepage sections. */ function aster_startup_get_homepage_sections() { $aster_startup_sections = array( 'banner' => esc_html__( 'Banner Section', 'aster-startup' ), 'product' => esc_html__( 'Product Section', 'aster-startup' ), ); return $aster_startup_sections; } } /** * Renders customizer section link */ function aster_startup_section_link( $aster_startup_section_id ) { $aster_startup_section_name = str_replace( 'aster_startup_', ' ', $aster_startup_section_id ); $aster_startup_section_name = str_replace( '_', ' ', $aster_startup_section_name ); $aster_startup_starting_notation = '#'; ?> false, 'show_title' => true, 'show_browse' => false, ); breadcrumb_trail( $aster_startup_args ); } add_action( 'aster_startup_breadcrumb', 'aster_startup_breadcrumb', 10 ); /** * Add separator for breadcrumb trail. */ function aster_startup_breadcrumb_trail_print_styles() { $aster_startup_breadcrumb_separator = get_theme_mod( 'aster_startup_breadcrumb_separator', '/' ); $aster_startup_style = ' .trail-items li::after { content: "' . $aster_startup_breadcrumb_separator . '"; }'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $aster_startup_style = apply_filters( 'aster_startup_breadcrumb_trail_inline_style', trim( str_replace( array( "\r", "\n", "\t", ' ' ), '', $aster_startup_style ) ) ); if ( $aster_startup_style ) { echo "\n" . '' . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } add_action( 'wp_head', 'aster_startup_breadcrumb_trail_print_styles' ); /** * Pagination for archive. */ function aster_startup_render_posts_pagination() { $aster_startup_is_pagination_enabled = get_theme_mod( 'aster_startup_enable_pagination', true ); if ( $aster_startup_is_pagination_enabled ) { $aster_startup_pagination_type = get_theme_mod( 'aster_startup_pagination_type', 'default' ); if ( 'default' === $aster_startup_pagination_type ) : the_posts_navigation(); else : the_posts_pagination(); endif; } } add_action( 'aster_startup_posts_pagination', 'aster_startup_render_posts_pagination', 10 ); /** * Pagination for single post. */ function aster_startup_render_post_navigation() { the_post_navigation( array( 'prev_text' => '⟵ ', 'next_text' => ' ⟶', ) ); } add_action( 'aster_startup_post_navigation', 'aster_startup_render_post_navigation' ); /** * Adds footer copyright text. */ function aster_startup_output_footer_copyright_content() { $aster_startup_theme_data = wp_get_theme(); $aster_startup_copyright_text = get_theme_mod('aster_startup_footer_copyright_text'); if (!empty($aster_startup_copyright_text)) { $aster_startup_text = esc_html($aster_startup_copyright_text); } else { $aster_startup_default_text = ' ' . esc_html($aster_startup_theme_data->get('Name')) . '' . ' ' . esc_html__('by', 'aster-startup') . ' ' . esc_html(ucwords($aster_startup_theme_data->get('Author'))) . ''; /* translators: %s: a link to WordPress */ $aster_startup_default_text .= sprintf(esc_html__(' | Powered by %s', 'aster-startup'), 'WordPress. '); $aster_startup_text = $aster_startup_default_text; } ?>
admin_url( 'admin-ajax.php' ) ) ); wp_enqueue_style( 'aster-startup-notice-style', get_template_directory_uri() . '/resource/css/notice.css' ); } add_action( 'admin_enqueue_scripts', 'aster_startup_getpage_css' ); add_action('wp_ajax_aster_startup_dismissable_notice', 'aster_startup_dismissable_notice'); function aster_startup_switch_theme() { delete_user_meta(get_current_user_id(), 'aster_startup_dismissable_notice'); } add_action('after_switch_theme', 'aster_startup_switch_theme'); function aster_startup_dismissable_notice() { update_user_meta(get_current_user_id(), 'aster_startup_dismissable_notice', true); die(); } function aster_startup_deprecated_hook_admin_notice() { global $pagenow; // Check if the current page is the one where you don't want the notice to appear if ( $pagenow === 'themes.php' && isset( $_GET['page'] ) && $_GET['page'] === 'aster-startup-getting-started' ) { return; } $dismissed = get_user_meta( get_current_user_id(), 'aster_startup_dismissable_notice', true ); if ( !$dismissed) { ?>