OwlCyberSecurity - MANAGER
Edit File: functions.php
<?php define("URL_THEME_BASE", get_stylesheet_directory_uri()); add_theme_support('category-thumbnails'); add_theme_support("post-thumbnails"); remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'rest_output_link_wp_head', 10); remove_action('wp_head', 'wp_oembed_add_discovery_links', 10); remove_action('template_redirect', 'rest_output_link_header', 11, 0); remove_action('wp_head', 'wp_resource_hints', 2); remove_action('shutdown', 'wp_ob_end_flush_all', 1); // Disable use XML-RPC add_filter( 'xmlrpc_enabled', '__return_false' ); // Disable X-Pingback to header add_filter( 'wp_headers', 'disable_x_pingback' ); function disable_x_pingback( $headers ) { unset( $headers['X-Pingback'] ); return $headers; } add_action('after_switch_theme', function () { flush_rewrite_rules(); }); // ASSETS add_action("wp_enqueue_scripts", function() { wp_enqueue_style("assets.style", URL_THEME_BASE . '/style.css'); }); /** * Returns information about the current post's discussion, with cache support. */ function blog_get_discussion_data() { static $discussion, $post_id; $current_post_id = get_the_ID(); if ( $current_post_id === $post_id ) { return $discussion; /* If we have discussion information for post ID, return cached object */ } else { $post_id = $current_post_id; } $comments = get_comments( array( 'post_id' => $current_post_id, 'orderby' => 'comment_date_gmt', 'order' => get_option( 'comment_order', 'asc' ), /* Respect comment order from Settings ยป Discussion. */ 'status' => 'approve', 'number' => 20, /* Only retrieve the last 20 comments, as the end goal is just 6 unique authors */ ) ); $authors = array(); foreach ( $comments as $comment ) { $authors[] = ( (int) $comment->user_id > 0 ) ? (int) $comment->user_id : $comment->comment_author_email; } $authors = array_unique( $authors ); $discussion = (object) array( 'authors' => array_slice( $authors, 0, 6 ), /* Six unique authors commenting on the post. */ 'responses' => get_comments_number( $current_post_id ), /* Number of responses. */ ); return $discussion; } if ( ! function_exists( 'blog_comment_form' ) ) : /** * Documentation for function. */ function blog_comment_form( $order ) { if ( true === $order || strtolower( $order ) === strtolower( get_option( 'comment_order', 'asc' ) ) ) { comment_form( array( 'logged_in_as' => null, 'title_reply' => null, ) ); } } endif; if ( ! function_exists( 'blog_discussion_avatars_list' ) ) : /** * Displays a list of avatars involved in a discussion for a given post. */ function blog_discussion_avatars_list( $comment_authors ) { if ( empty( $comment_authors ) ) { return; } echo '<ol class="discussion-avatar-list">', "\n"; foreach ( $comment_authors as $id_or_email ) { printf( "<li>%s</li>\n", twentynineteen_get_user_avatar_markup( $id_or_email ) ); } echo '</ol><!-- .discussion-avatar-list -->', "\n"; } endif;