You appear to be a bot. Output may be restricted
Description
Paginate a multivalue fieldProcessing depends on the field type
Type | Processing |
---|---|
textarea | treat each line as a separate entry |
other | handle multiple entries |
Usage
bw_navi_field( $field, $atts, $posts_per_page );
Parameters
- $field
- ( string ) required – the name of the post_meta_field to paginate
- $atts
- ( array ) required – shortcode parameters
- $posts_per_page
- ( mixed ) required –
Returns
voidSource
File name: oik/shortcodes/oik-navi.phpLines:
1 to 27 of 27
function bw_navi_field( $field, $atts, $posts_per_page ) { $content_array = bw_navi_fetch_field_content( $field, $atts ); $bwscid = bw_get_shortcode_id( false ); $page = bw_check_paged_shortcode( $bwscid ); $count = count( $content_array ); if ( $posts_per_page ) { $pages = ceil( $count / $posts_per_page ); $start = ( $page-1 ) * $posts_per_page; $end = min( $start + $posts_per_page, $count ) -1 ; bw_navi_s2eofn( $start, $end, $count ); $content_array = array_slice( $content_array, $start, $posts_per_page ); bw_trace2( $content_array, "content_array" ); } foreach ( $content_array as $content ) { if ( false === strpos( $content, "[" ) ) { e( $content ); } else { e( bw_do_shortcode( $content ) ); } } if ( $posts_per_page ) { bw_navi_paginate_links( $bwscid, $page, $pages ); } }View on GitHub View on Trac