'; echo '
%2$s
', esc_attr( $class ), esc_html( $message ) ); } add_action( 'admin_notices', 'kis_admin_notice__info' ); } /** * Disable output of kirki styles if the plugin is disabled or removed. */ if ( ! class_exists( 'Kirki' ) ) { /** * Function to remove Kirki styles. */ function kis_remove_kirki_styles() { wp_dequeue_style( 'kis_no-kirki' ); wp_deregister_style( 'kis_no-kirki' ); } add_action( 'wp_enqueue_scripts', 'kis_remove_kirki_styles', 20 ); } /** * Give #wpadminbar a fixed position from 600px and under, using inline style since we can't use #wpadminbar in CSS. */ function kis_wp_adminbar() { $wp_adminbar = ' @media screen and (max-width: 600px) { #wpadminbar { position: fixed; } }'; wp_add_inline_style( 'kis-layout', $wp_adminbar ); } add_action( 'wp_enqueue_scripts', 'kis_wp_adminbar' ); /** * Provide a fallback menu featuring a 'Home' link, if no other menu has been provided. * Add 'Create a new menu' link only if the current_user_can('edit_theme_options'). */ function kis_fallback_menu() { $html = ' '; echo wp_kses( $html, array( 'ul' => array( 'id' => array(), 'class' => array(), ), 'li' => array( 'class' => array(), ), 'a' => array( 'href' => array(), ), ) ); } /** * Generate custom search form * * @param string $form Form HTML. * @return string Modified form HTML. * * @link https://developer.wordpress.org/reference/functions/get_search_form/#comment-369 */ function kis_search_form( $form ) { $form = ''; return $form; } add_filter( 'get_search_form', 'kis_search_form' ); /** * Allow to upload and use SVG. * * @see https://themeisle.com/blog/add-svg-to-wordpress/ * @param string $file_types SVG. */ function kis_add_file_types_to_uploads( $file_types ) { $new_filetypes = array(); $new_filetypes['svg'] = 'image/svg+xml'; $file_types = array_merge( $file_types, $new_filetypes ); return $file_types; } add_action( 'upload_mimes', 'kis_add_file_types_to_uploads' ); /** * Modify The Read More Link Text. * * @see https://codex.wordpress.org/Customizing_the_Read_More */ function kis_read_more_link() { return ' [ Read more ] '; } add_filter( 'the_content_more_link', 'kis_read_more_link' ); /** * Filter the excerpt length to 20 words. * * @see https://developer.wordpress.org/reference/functions/the_excerpt/#comment-325 * @param int $length Excerpt length. * @return int (Maybe) modified excerpt length. */ function wpdocs_custom_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'wpdocs_custom_excerpt_length', 999 ); /** * Replaces the excerpt "Read More" text by a link. * * @see https://codex.wordpress.org/Customizing_the_Read_More * @param string $more Link to the article. */ function kis_excerpt_more( $more ) { global $post; return ' [ Read more ] '; } add_filter( 'excerpt_more', 'kis_excerpt_more' ); /** * Change the HTML5 output of comments. * * @see wp_list_comments() * * @param WP_Comment $comment Comment to display. * @param array $args An array of arguments. * @param int $depth Depth of the current comment. */ function kis_comments_callback( $comment, $args, $depth ) { $tag = ( 'div' === $args['style'] ) ? 'div' : 'li'; ?> < id="comment-" >