'Mega_Theme_Block_Comments_Loop' ); parent::__construct( __CLASS__, $args ); add_action( 'wp_enqueue_scripts', array( &$this, 'enqueue' )); } public function settings( $form ) { $form->add_control( 'Mega_Control_Number', array( 'label' => esc_html__( 'Avatar Size (px)', 'awake' ), 'value' => 70, 'name' => 'avatar_size' )); } public function enqueue() { if ( is_singular() && get_option( 'thread_comments' ) && comments_open() ) wp_enqueue_script( 'comment-reply' ); } public function callback() { echo '
'; if ( post_password_required() ) { echo '

' . esc_html__( 'This post is password protected. Enter the password to view any comments or pings.', 'awake' ) . '

'; } else { if ( have_comments() ) { echo '
'; echo '

'; comments_number(); echo '

'; if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) && mega_option( 'paginate_above_comms' )) mega_widget( 'Mega_Block_Paginate' ); echo '
'; echo ''; } mega_widget( 'Mega_Block_Comments_Form' ); if ( have_comments() && get_comment_pages_count() > 1 && get_option( 'page_comments' ) && mega_option( 'paginate_below_comms' )) mega_widget( 'Mega_Block_Paginate' ); } echo '
'; } public function block() { wp_list_comments( array( 'avatar_size' => $this->mega['settings']['avatar_size'], 'callback' => array( &$this, 'commentCallback' ))); } public function commentCallback( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) { case 'pingback' : case 'trackback' ://comment-getPing(); break; default : echo '
  • '; $this->getComment( $comment, $args, $depth ); break; } } public function getPing() { echo '
  • ', sprintf( esc_html__( 'Pingback: %s', 'awake' ), get_comment_author_link() ); edit_comment_link( esc_html__( '(Edit)', 'awake' ), ' ' ); } public function getComment( $comment, $args, $depth ) { echo '
    '; echo get_avatar( $comment, $args['avatar_size'], 'http://i.imgur.com/rysNZj0.png', $comment->comment_author ); echo '
    '; echo '
    ' . get_comment_author() . sprintf( esc_html__( ' / %s', 'awake' ), Mega_Block_Comments::getWrap( 'days', $comment )) . '
    '; comment_reply_link( wp_parse_args( $args, array( 'depth' => $depth ))); echo '
    '; comment_text(); echo '
    '; echo ''; echo '
    '; echo '
    '; } }