render_block_core_query_pagination

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

render_block_core_query_pagination: 這個函式用來渲染WordPress中的查詢塊的分頁連結。分頁連結允許使用者瀏覽多頁的結果,這個函式負責生成這些連結的HTML標記。

渲染伺服器上的`core/query-pagination`區塊。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function render_block_core_query_pagination( $attributes, $content ) {
if ( empty( trim( $content ) ) ) {
return '';
}
$wrapper_attributes = get_block_wrapper_attributes(
array(
'aria-label' => __( 'Pagination' ),
)
);
return sprintf(
'<nav %1$s>%2$s</nav>',
$wrapper_attributes,
$content
);
}
function render_block_core_query_pagination( $attributes, $content ) { if ( empty( trim( $content ) ) ) { return ''; } $wrapper_attributes = get_block_wrapper_attributes( array( 'aria-label' => __( 'Pagination' ), ) ); return sprintf( '<nav %1$s>%2$s</nav>', $wrapper_attributes, $content ); }
function render_block_core_query_pagination( $attributes, $content ) {
	if ( empty( trim( $content ) ) ) {
		return '';
	}

	$wrapper_attributes = get_block_wrapper_attributes(
		array(
			'aria-label' => __( 'Pagination' ),
		)
	);

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

常見問題

FAQs
檢視更多 >