From 310a74ade4777089816ef0136a93bc74da3b1b54 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 30 Jan 2018 13:48:43 -0800 Subject: [PATCH] Opt to inline the descending-ordering comment logic since temporary --- amp.php | 7 ++---- assets/js/amp-admin-comments.js | 16 -------------- includes/admin/functions.php | 2 +- includes/class-amp-theme-support.php | 33 ++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 22 deletions(-) delete mode 100644 assets/js/amp-admin-comments.js diff --git a/amp.php b/amp.php index f77ac34d28c..4eb441f77cf 100644 --- a/amp.php +++ b/amp.php @@ -88,17 +88,14 @@ function amp_after_setup_theme() { } add_action( 'init', 'amp_init' ); - add_action( 'widgets_init', 'AMP_Theme_Support::register_widgets' ); + add_action( 'widgets_init', 'AMP_Theme_Support::register_widgets' ); // @todo Let this be called by AMP_Theme_Support::init(). + add_action( 'init', 'AMP_Theme_Support::setup_commenting' ); // @todo Let this be called by AMP_Theme_Support::init(). add_action( 'admin_init', 'AMP_Options_Manager::register_settings' ); add_filter( 'amp_post_template_analytics', 'amp_add_custom_analytics' ); add_action( 'wp_loaded', 'amp_post_meta_box' ); add_action( 'wp_loaded', 'amp_add_options_menu' ); add_action( 'parse_query', 'amp_correct_query_when_is_front_page' ); AMP_Post_Type_Support::add_post_type_support(); - add_filter( 'option_comment_order', function() { - return 'desc'; - }, PHP_INT_MAX ); - add_action( 'admin_print_footer_scripts-options-discussion.php', 'amp_comments_order_disable_scripts' ); } add_action( 'after_setup_theme', 'amp_after_setup_theme', 5 ); diff --git a/assets/js/amp-admin-comments.js b/assets/js/amp-admin-comments.js deleted file mode 100644 index 4f58f3c8b53..00000000000 --- a/assets/js/amp-admin-comments.js +++ /dev/null @@ -1,16 +0,0 @@ -(function( $ ) { - 'use strict'; - - /** - * Move the notice below the selector and disable selector. - */ - $( document ).on( 'ready', function() { - var orderSelect = $( '#comment_order' ), - notice = $( '#amp-comment-notice' ); - if ( orderSelect.length && notice.length ) { - orderSelect.prop( 'disabled', true ); - notice.appendTo( orderSelect.parent() ); - } - } ); - -})( jQuery ); diff --git a/includes/admin/functions.php b/includes/admin/functions.php index d6f87d7f76e..2cd5ac73e78 100644 --- a/includes/admin/functions.php +++ b/includes/admin/functions.php @@ -162,7 +162,7 @@ function amp_comments_order_disable_scripts() { true ); ?> -

support ascending comments with newer entries appearing at the bottom.', 'amp' ) ); ?>

+ +

support ascending comments with newer entries appearing at the bottom.', 'amp' ) ); ?>

+ +