post_comment_meta_box

Definition:
function post_comment_meta_box($post) {}

Display comments for post.

Parameters

  • object $post

Source code

function post_comment_meta_box($post) {

	global $wpdb, $post_ID;



	$total = $wpdb->get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID));



	if ( 1 > $total ) {

		echo '<p>' . __('No comments yet.') . '</p>';

		return;

	}



	wp_nonce_field( 'get-comments', 'add_comment_nonce', false );



	$wp_list_table = _get_list_table('WP_Post_Comments_List_Table');

	$wp_list_table->display( true );

?>

<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /></p>

<?php

	$hidden = get_hidden_meta_boxes('post');

	if ( ! in_array('commentsdiv', $hidden) ) { ?>

		<script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>

<?php

	}

	wp_comment_trashnotice();

}

2559

post_comments_feed_link

Definition:
function post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) {}

Display the comment feed link for a post.
Prints out the comment feed link for a post. Link text is placed in the anchor. If no link text is specified, default text is used. If no post ID is specified, the current post is used.

Parameters

  • string $link_text: Descriptive text.
  • int $post_id: Optional post ID. Default to current post.
  • string $feed: Optional. Feed format.

Return values

returns:Link to the comment feed for the current post.

Defined filters

  • post_comments_feed_link_html
    apply_filters( 'post_comments_feed_link_html', "<a href='$url'>$link_text</a>", $post_id, $feed )

Source code

function post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) {

	$url = get_post_comments_feed_link($post_id, $feed);

	if ( empty($link_text) )

		$link_text = __('Comments Feed');



	echo apply_filters( 'post_comments_feed_link_html', "<a href='$url'>$link_text</a>", $post_id, $feed );

}

2557

post_class

Definition:
function post_class( $class = '', $post_id = null ) {}

Display the classes for the post div.

Parameters

  • string|array $class: One or more classes to add to the class list.
  • int $post_id: An optional post ID.

Source code

function post_class( $class = '', $post_id = null ) {

	// Separates classes with a single space, collates classes for post DIV

	echo 'class="' . join( ' ', get_post_class( $class, $post_id ) ) . '"';

}

2555

post_categories_meta_box

Definition:
function post_categories_meta_box( $post, $box ) {}

Display post categories form fields.

Parameters

  • object $post
  • $box

Source code

function post_categories_meta_box( $post, $box ) {

	$defaults = array('taxonomy' => 'category');

	if ( !isset($box['args']) || !is_array($box['args']) )

		$args = array();

	else

		$args = $box['args'];

	extract( wp_parse_args($args, $defaults), EXTR_SKIP );

	$tax = get_taxonomy($taxonomy);



	?>

	<div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv">

		<ul id="<?php echo $taxonomy; ?>-tabs" class="category-tabs">

			<li class="tabs"><a href="#<?php echo $taxonomy; ?>-all" tabindex="3"><?php echo $tax->labels->all_items; ?></a></li>

			<li class="hide-if-no-js"><a href="#<?php echo $taxonomy; ?>-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>

		</ul>



		<div id="<?php echo $taxonomy; ?>-pop" class="tabs-panel" style="display: none;">

			<ul id="<?php echo $taxonomy; ?>checklist-pop" class="categorychecklist form-no-clear" >

				<?php $popular_ids = wp_popular_terms_checklist($taxonomy); ?>

			</ul>

		</div>



		<div id="<?php echo $taxonomy; ?>-all" class="tabs-panel">

			<?php

            $name = ( $taxonomy == 'category' ) ? 'post_category' : 'tax_input[' . $taxonomy . ']';

            echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.

2553