Hot answers tagged

3

If you need to modify the max depth, you could use the thread_comments_depth_max filter: /** * Set max comments depth to 15 on the discussion settings page */ add_filter( 'thread_comments_depth_max', function( $max ) { return 15; } ); then the dropdown on the discussion settings page will show the range 1 - 15. But I can imagine very deep comment ...


3

Lets try the following: By default, all posts are returned regardless of comment_status, so lets run the main query as normal, that is, query all posts regardless of comment_status. We will also run a small, but very lean secondary query where we will get all posts which have a comment_status of closed which have a meta value of not yes The returned ...


3

We could rewrite: wp_list_comments( array( 'callback' => 'bootstrap_comment_callback', )); with the null walker parameter: wp_list_comments( array( 'walker' => null, 'callback' => 'bootstrap_comment_callback', )); which means we are using the default Walker_Comment class: wp_list_comments( array( 'walker' ...


3

WordPres will not allow you, using its default comment process, to insert empty comments into the database. This is enforced by wp_handle_comment_submission() with the following unconditional code: if ( '' == $comment_content ) { return new WP_Error( 'require_valid_comment', __( '<strong>ERROR</strong>: please type a comment.' ), 200 ); } ...


2

Because comment_status is not a built-in query argument - but you can easily implement it: function wpse_214323_query_by_comment_status( $where, $wp_query ) { global $wpdb; if ( ! empty( $wp_query->query_vars['comment_status'] ) ) { $status = $wp_query->query_vars['comment_status']; if ( $status !== 'open' ) ...


2

Here are some options on how we can override the native layout for each comment: Approach #1 - Overriding start_el() with a custom walker Let's define our custom wpse comment format: // Arguments for wp_list_comments() $args = [ 'style' => 'ol', 'format' => 'html5', 'short_ping' => true, ]; // Use our custom walker if ...



Only top voted, non community-wiki answers of a minimum length are eligible