', esc_url( get_bloginfo( 'pingback_url' ) ) ); } } add_action( 'wp_head', 'appointment_management_pingback_header' ); /** * Get all posts for customizer Post content type. */ function appointment_management_get_post_choices() { $appointment_management_choices = array( '' => esc_html__( '--Select--', 'appointment-management' ) ); $appointment_management_args = array( 'numberposts' => -1 ); $appointment_management_posts = get_posts( $appointment_management_args ); foreach ( $appointment_management_posts as $appointment_management_post ) { $appointment_management_id = $appointment_management_post->ID; $appointment_management_title = $appointment_management_post->post_title; $appointment_management_choices[ $appointment_management_id ] = $appointment_management_title; } return $appointment_management_choices; } /** * Get all pages for customizer Page content type. */ function appointment_management_get_page_choices() { $appointment_management_choices = array( '' => esc_html__( '--Select--', 'appointment-management' ) ); $appointment_management_pages = get_pages(); foreach ( $appointment_management_pages as $appointment_management_page ) { $appointment_management_choices[ $appointment_management_page->ID ] = $appointment_management_page->post_title; } return $appointment_management_choices; } /** * Get all categories for customizer Category content type. */ function appointment_management_get_post_cat_choices() { $appointment_management_choices = array( '' => esc_html__( '--Select--', 'appointment-management' ) ); $appointment_management_cats = get_categories(); foreach ( $appointment_management_cats as $appointment_management_cat ) { $appointment_management_choices[ $appointment_management_cat->term_id ] = $appointment_management_cat->name; } return $appointment_management_choices; } /** * Get all donation forms for customizer form content type. */ function appointment_management_get_post_donation_form_choices() { $appointment_management_choices = array( '' => esc_html__( '--Select--', 'appointment-management' ) ); $appointment_management_posts = get_posts( array( 'post_type' => 'give_forms', 'numberposts' => -1, ) ); foreach ( $appointment_management_posts as $appointment_management_post ) { $appointment_management_choices[ $appointment_management_post->ID ] = $appointment_management_post->post_title; } return $appointment_management_choices; } if ( ! function_exists( 'appointment_management_excerpt_length' ) ) : /** * Excerpt length. */ function appointment_management_excerpt_length( $appointment_management_length ) { if ( is_admin() ) { return $appointment_management_length; } return get_theme_mod( 'appointment_management_excerpt_length', 20 ); } endif; add_filter( 'excerpt_length', 'appointment_management_excerpt_length', 999 ); if ( ! function_exists( 'appointment_management_excerpt_more' ) ) : /** * Excerpt more. */ function appointment_management_excerpt_more( $appointment_management_more ) { if ( is_admin() ) { return $appointment_management_more; } return '…'; } endif; add_filter( 'excerpt_more', 'appointment_management_excerpt_more' ); if ( ! function_exists( 'appointment_management_sidebar_layout' ) ) { /** * Get sidebar layout. */ function appointment_management_sidebar_layout() { $appointment_management_sidebar_position = get_theme_mod( 'appointment_management_sidebar_position', 'right-sidebar' ); $appointment_management_sidebar_position_post = get_theme_mod( 'appointment_management_post_sidebar_position', 'right-sidebar' ); $appointment_management_sidebar_position_page = get_theme_mod( 'appointment_management_page_sidebar_position', 'right-sidebar' ); if ( is_home() ) { $appointment_management_sidebar_position = $appointment_management_sidebar_position_post; } elseif ( is_page() ) { $appointment_management_sidebar_position = $appointment_management_sidebar_position_page; } return $appointment_management_sidebar_position; } } if ( ! function_exists( 'appointment_management_is_sidebar_enabled' ) ) { /** * Check if sidebar is enabled. */ function appointment_management_is_sidebar_enabled() { $appointment_management_sidebar_position = get_theme_mod( 'appointment_management_sidebar_position', 'right-sidebar' ); $appointment_management_sidebar_position_post = get_theme_mod( 'appointment_management_post_sidebar_position', 'right-sidebar' ); $appointment_management_sidebar_position_page = get_theme_mod( 'appointment_management_page_sidebar_position', 'right-sidebar' ); $appointment_management_sidebar_enabled = true; if ( is_single() || is_archive() || is_search() ) { if ( 'no-sidebar' === $appointment_management_sidebar_position ) { $appointment_management_sidebar_enabled = false; } } elseif ( is_home() ) { if ( 'no-sidebar' === $appointment_management_sidebar_position || 'no-sidebar' === $appointment_management_sidebar_position_post ) { $appointment_management_sidebar_enabled = false; } } elseif ( is_page() ) { if ( 'no-sidebar' === $appointment_management_sidebar_position || 'no-sidebar' === $appointment_management_sidebar_position_page ) { $appointment_management_sidebar_enabled = false; } } return $appointment_management_sidebar_enabled; } } if ( ! function_exists( 'appointment_management_get_homepage_sections ' ) ) { /** * Returns homepage sections. */ function appointment_management_get_homepage_sections() { $appointment_management_sections = array( 'banner' => esc_html__( 'Banner Section', 'appointment-management' ), 'services' => esc_html__( 'Services Section', 'appointment-management' ), ); return $appointment_management_sections; } } /** * Renders customizer section link */ function appointment_management_section_link( $appointment_management_section_id ) { $appointment_management_section_name = str_replace( 'appointment_management_', ' ', $appointment_management_section_id ); $appointment_management_section_name = str_replace( '_', ' ', $appointment_management_section_name ); $appointment_management_starting_notation = '#'; ?> false, 'show_title' => true, 'show_browse' => false, ); breadcrumb_trail( $appointment_management_args ); } add_action( 'appointment_management_breadcrumb', 'appointment_management_breadcrumb', 10 ); /** * Add separator for breadcrumb trail. */ function appointment_management_breadcrumb_trail_print_styles() { $appointment_management_breadcrumb_separator = get_theme_mod( 'appointment_management_breadcrumb_separator', '/' ); $appointment_management_style = ' .trail-items li::after { content: "' . $appointment_management_breadcrumb_separator . '"; }'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $appointment_management_style = apply_filters( 'appointment_management_breadcrumb_trail_inline_style', trim( str_replace( array( "\r", "\n", "\t", ' ' ), '', $appointment_management_style ) ) ); if ( $appointment_management_style ) { echo "\n" . '' . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } add_action( 'wp_head', 'appointment_management_breadcrumb_trail_print_styles' ); /** * Pagination for archive. */ function appointment_management_render_posts_pagination() { $appointment_management_is_pagination_enabled = get_theme_mod( 'appointment_management_enable_pagination', true ); if ( $appointment_management_is_pagination_enabled ) { $appointment_management_pagination_type = get_theme_mod( 'appointment_management_pagination_type', 'default' ); if ( 'default' === $appointment_management_pagination_type ) : the_posts_navigation(); else : the_posts_pagination(); endif; } } add_action( 'appointment_management_posts_pagination', 'appointment_management_render_posts_pagination', 10 ); /** * Pagination for single post. */ function appointment_management_render_post_navigation() { the_post_navigation( array( 'prev_text' => ' %title', 'next_text' => '%title ', ) ); } add_action( 'appointment_management_post_navigation', 'appointment_management_render_post_navigation' ); /** * Adds footer copyright text. */ function appointment_management_output_footer_copyright_content() { $appointment_management_theme_data = wp_get_theme(); $appointment_management_copyright_text = get_theme_mod('appointment_management_footer_copyright_text'); if (!empty($appointment_management_copyright_text)) { $appointment_management_text = $appointment_management_copyright_text; } else { $appointment_management_default_text = ' ' . esc_html($appointment_management_theme_data->get('Name')) . '' . ' ' . esc_html__('by', 'appointment-management') . ' ' . esc_html(ucwords($appointment_management_theme_data->get('Author'))) . ''; /* translators: %s: WordPress.org URL */ $appointment_management_default_text .= sprintf(esc_html__(' | Powered by %s', 'appointment-management'), 'WordPress. '); $appointment_management_text = $appointment_management_default_text; } ?>
admin_url( 'admin-ajax.php' ) ) ); wp_enqueue_style( 'appointment-management-notice-style', get_template_directory_uri() . '/resource/css/notice.css' ); } add_action( 'admin_enqueue_scripts', 'appointment_management_getpage_css' ); add_action('wp_ajax_appointment_management_dismissable_notice', 'appointment_management_dismissable_notice'); function appointment_management_switch_theme() { delete_user_meta(get_current_user_id(), 'appointment_management_dismissable_notice'); } add_action('after_switch_theme', 'appointment_management_switch_theme'); function appointment_management_dismissable_notice() { update_user_meta(get_current_user_id(), 'appointment_management_dismissable_notice', true); die(); } function appointment_management_deprecated_hook_admin_notice() { global $appointment_management_pagenow; // Check if the current page is the one where you don't want the notice to appear if ( $appointment_management_pagenow === 'themes.php' && isset( $_GET['page'] ) && $_GET['page'] === 'appointment-management-getting-started' ) { return; } $appointment_management_dismissed = get_user_meta( get_current_user_id(), 'appointment_management_dismissable_notice', true ); if ( !$appointment_management_dismissed) { ?>