render_block_core_comments_pagination

函式
render_block_core_comments_pagination ( $attributes, $content )
引數
  • (array) $attributes Block attributes.
    Required:
  • (string) $content Block default content.
    Required:
返回值
  • (string) Returns the wrapper for the Comments pagination.
定義位置
相關方法
render_block_core_comments_pagination_nextregister_block_core_comments_paginationrender_block_core_comments_pagination_numbersrender_block_core_comments_pagination_previousregister_block_core_comments_pagination_next
引入
-
棄用
-

render_block_core_comments_pagination: 這個函式用來渲染WordPress中的評論分頁塊。評論分頁塊是用來在評論的頁面之間進行導航的: 這個函式負責生成評論分頁塊的HTML標記。

在伺服器上呈現`core/comments-pagination’區塊。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function render_block_core_comments_pagination( $attributes, $content ) {
if ( empty( trim( $content ) ) ) {
return '';
}
if ( post_password_required() ) {
return;
}
return sprintf(
'<div %1$s>%2$s</div>',
get_block_wrapper_attributes(),
$content
);
}
function render_block_core_comments_pagination( $attributes, $content ) { if ( empty( trim( $content ) ) ) { return ''; } if ( post_password_required() ) { return; } return sprintf( '<div %1$s>%2$s</div>', get_block_wrapper_attributes(), $content ); }
function render_block_core_comments_pagination( $attributes, $content ) {
	if ( empty( trim( $content ) ) ) {
		return '';
	}

	if ( post_password_required() ) {
		return;
	}

	return sprintf(
		'<div %1$s>%2$s</div>',
		get_block_wrapper_attributes(),
		$content
	);
}

常見問題

FAQs
檢視更多 >