From d83c3aefd62d052b02c04ba25dd2680414f58b9b Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Tue, 14 May 2019 15:03:27 -0400 Subject: [PATCH] Remove 'templates used' code breaking ssl --- functions.php | 62 --------------------------------------------------- 1 file changed, 62 deletions(-) diff --git a/functions.php b/functions.php index 536ce6c..f3bbbef 100644 --- a/functions.php +++ b/functions.php @@ -414,66 +414,4 @@ function get_county_page_children($countyPageId = false) { ), ARRAY_A ); } return $countyChildren; -} - -function templates_used() { - add_menu_page( - __( 'Templates Used', 'textdomain' ), - 'Templates Used', - 'manage_options', - 'templates-used.php', - 'list_templates_used', - plugins_url( '' ), - 999 - ); -} -add_action( 'admin_menu', 'templates_used' ); - -function list_templates_used( ) { - global $post; - echo "

Templates Used

"; - list_templates_by_type( 'page' ); - list_templates_by_type( 'post' ); - //list_templates_by_type( 'custom-post-type' ); -} - -function list_templates_by_type( $type = 'page' ) { - - $args = array( 'post_type' => $type, 'posts_per_page' => -1 ); - $posts = get_posts( $args ); - $count = 0; - - $output = ''; - $output .= '

\''. $type .'\' List

'; - - foreach ($posts as $post) { - setup_postdata( $post ); - if ( get_page_template_slug( $post->ID ) ) { - if ( $count == 0 ) { - $output .= ' Every '. $type .' not listed below has template "Default".

'; - $output .= ' '; - $output .= ' '; - } - $count++; - $output .= ''; - $output .= ''; - $output .= ''; - $output .= ''; - $output .= ''; - $output .= ''; - $output .= ''; - - $output .= ''; - } - - } - $output .= ''; - $output .= '
IDNameSlugTemplate
' . $post->ID . '' . $post->post_title . '' . $post->post_name . '' . get_page_template_slug( $post->ID ) . 'EditView
'; - - if ( $count == 0 ) { - $output .= ' Either there are no posts with type "' . $type . '", or none of them have custom templates set (and have the Default template). '; - } - - wp_reset_postdata(); - echo $output; } \ No newline at end of file -- 2.17.1