'; } } add_action( 'wp_head', 'blogdot_pingback_header' ); /** * Breadcrumb Trail Customization */ function blogdot_breadcrumb_trail() { $breadcrumb_defaults = array( 'browse_tag' => 'h6', 'show_browse' => false, 'labels' => array( 'home' => '' ), ); if ( function_exists( 'breadcrumb_trail' ) ) : breadcrumb_trail( $breadcrumb_defaults ); endif; } /** * Add classes to navigation buttons */ add_filter( 'next_posts_link_attributes', 'blogdot_posts_link_attributes' ); add_filter( 'previous_posts_link_attributes', 'blogdot_posts_link_attributes' ); add_filter( 'next_comments_link_attributes', 'blogdot_comments_link_attributes' ); add_filter( 'previous_comments_link_attributes', 'blogdot_comments_link_attributes' ); function blogdot_posts_link_attributes() { return 'class="btn btn-sm cont-btn no-underl mb-4"'; } function blogdot_comments_link_attributes() { return 'class="btn btn-sm cont-btn no-underl mb-4"'; } /** * Check if cover section is displayed */ function blogdot_is_cover_active() { if( ! is_home() ) { return false; } if( get_theme_mod( 'blogdot_display_cover_section', true ) ) { return true; } return false; } /** * Image sanitization callback */ function blogdot_sanitize_image( $image, $setting ) { $mimes = array( 'jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'bmp' => 'image/bmp', 'tif|tiff' => 'image/tiff', 'ico' => 'image/x-icon' ); // Return an array with file extension and mime_type. $file = wp_check_filetype( $image, $mimes ); // If $image has a valid mime_type, return it; otherwise, return the default. return ( $file['ext'] ? $image : $setting->default ); } /** * Greet new users & guide them to help page */ function blogdot_admin_notice(){ if ( is_admin() ) { blogdot_greet_user(); } } $intro_notice_dismissed = get_option( 'blogdot-intro-dismissed' ); if( empty( $intro_notice_dismissed ) ) { add_action('admin_notices', 'blogdot_admin_notice'); } function blogdot_greet_user() { echo '
'; echo wp_kses_post( __( '

Welcome! Thank you for choosing Blogdot. You can always reach out to us on the support forum if you need any help. Please do take a look at the pro version of the theme. If you liked our work, please support us by providing a review with 5-star ratings.', 'blogdot' ) ); echo "

"; esc_html_e( 'Check Blogdot Pro', 'blogdot' ); echo ""; esc_html_e( 'View Pro Demo', 'blogdot' ); echo ""; esc_html_e( 'Rate us 5 stars', 'blogdot' ); echo ""; esc_html_e( 'Don\'t display this again!', 'blogdot' ); echo '

'; } // Enqueue dismiss script function blogdot_admin_scripts() { wp_enqueue_script( 'blogdot-admin', get_template_directory_uri() . '/assets/js/blogdot-admin.js' ); } $intro_notice_dismissed = get_option( 'blogdot-intro-dismissed' ); if( empty( $intro_notice_dismissed ) ) { add_action( 'admin_enqueue_scripts' , 'blogdot_admin_scripts' ); } // Update option if notice dismissed add_action( 'wp_ajax_blogdot-intro-dismissed', 'blogdot_dismiss_intro_notice' ); function blogdot_dismiss_intro_notice() { update_option( 'blogdot-intro-dismissed', 1 ); }