Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter TBean

    (@tbean)

    ?? You’ve truly made my day! Thank you for solving this!

    I do have a capability manager plugin so that’s probably what changed the structure.

    I like your solution of checking for the moderate_comments capability rather than checking the roles so I substituted with that. And thanks too for the tip about reading the var_dump in page source! Otherwise it looked like a mess of text!

    Many thanks again for your help! Now I feel a lot less stuck ??

    Thread Starter TBean

    (@tbean)

    I added the line. A lot of text is displaying which I suppose are the various capabilities linked to the accounts?

    You can see the new output here

    I see the comment from the other administrator has significantly more text than the subscriber.

    Thread Starter TBean

    (@tbean)

    Crossed my fingers and toes but I couldn’t get it to work on my site yet.

    Maybe I didn’t place it correctly? Here’s a snippet of part of the function. The global $post you mentioned is also found here earlier in the code.

    function twentytwelve_comment( $comment, $args, $depth ) {
    	$GLOBALS['comment'] = $comment;
    	switch ( $comment->comment_type ) :
    		case 'pingback' :
    		case 'trackback' :
    		// Display trackbacks differently than normal comments.
    	?>
    	<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
    		<p><?php _e( 'Pingback:', 'twentytwelve' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?></p>
    	<?php
    			break;
    		default :
    		// Proceed with normal comments.
    		global $post;
    	?>
    	<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    		<article id="comment-<?php comment_ID(); ?>" class="comment">
    			<header class="comment-meta comment-author vcard">
    				<?php
    					echo get_avatar( $comment, 88 );
    					if ( $comment->user_id === $post->post_author ) {
    						$ca_label = '<span> ' . __( 'Moderator', 'twentytwelve' ) . '</span>';
    					} else {
    						$commentator_id = $comment->user_id;
    						$commentator_info = get_userdata( $commentator_id );
    						if ($commentator_info) {
    							$capabilities = $commentator_info->wp_capabilities;
    							if ( array_key_exists('editor', $capabilities ) || array_key_exists('administrator', $capabilities )) {
    								$ca_label = '<span> ' . __( 'Moderator', 'twentytwelve' ) . '</span>';
    							} else {
    							//commenter is not post author, admin, nor editor
    							$ca_label = '';
    							}
    						} else {
    						//commenter was not logged in user
    							$ca_label = '';
    						}
    					}
    					printf( '<cite><b class="fn">%1$s</b> %2$s</cite>',
    						get_comment_author_link(), $ca_label );
    					printf( '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
    						esc_url( get_comment_link( $comment->comment_ID ) ),
    						get_comment_time( 'c' ),
    						/* translators: 1: date, 2: time */
    						sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() )
    					);
    				?>
    			</header><!-- .comment-meta -->

    The test site I’m working on is here. So far only the post author is showing the badge. The last comment is also from an administrator and should display a Moderator badge as well.

    Thread Starter TBean

    (@tbean)

    Thanks for the reply bcworkz! ??

    The logic of your code looks exactly like we had in mind!
    I tried the above code on our test site, however it still only added the badge to the authors comments, and not the other administrators comments.

    Thread Starter TBean

    (@tbean)

    That’s good to hear I look forward to 1.2 ??

    Thread Starter TBean

    (@tbean)

    Oh I see it now! Thank you ??

    Now the plugin is exactly what I need!! Perfect!

    tozq – Can you explain how you did the different rates for UPS and FedEx? I can’t find the explanation in https://www.artprojectgroup.es/como-se-configura-woocommerce-apg-weight-and-postcodestatecountry-shipping

    Thank you!

    Thread Starter TBean

    (@tbean)

    Awesome! Works perfect and is my favorite countdown plugin thus far for my purposes. And I’ve tested too many to count over the years, both free and paid. Thanks again!

    Thread Starter TBean

    (@tbean)

    I originally tried the shortcode in a clean install of WP and the twenty fourteen theme and that’s when I discovered it didn’t work unfortunately. Thanks for looking into this!

Viewing 9 replies - 1 through 9 (of 9 total)