10 public $icon =
'dashicons-controls-forward';
16 $this->widget_description = __(
'Links to multiple pages of results.',
'gk-gravityview' );
18 $default_values = array(
'header' => 1,
'footer' => 1 );
21 'label' => __(
'Show each page number',
'gk-gravityview' ),
22 'desc' => __(
'Show every page number instead of summary (eg: 1 2 3 ... 8 ยป)',
'gk-gravityview'),
25 parent::__construct( __(
'Page Links',
'gk-gravityview' ) ,
'page_links', $default_values,
$settings );
36 $atts = shortcode_atts( array(
39 'show_all' => !empty( $this->settings[
'show_all'][
'default'] ),
40 'current' => (
int) \
GV\Utils::_GET(
'pagenum', 1 ),
41 ), $widget_args,
'gravityview_widget_page_links' );
43 $page_link_args = array(
45 'format' =>
'&pagenum=%#%',
46 'add_args' => array(),
47 'prev_text' =>
'«',
48 'next_text' =>
'»',
52 'total' => empty( $atts[
'page_size'] ) ? 0 : ceil( $atts[
'total'] / $atts[
'page_size'] ),
53 'current' => $atts[
'current'],
54 'show_all' => !empty( $atts[
'show_all'] ),
62 $page_link_args = apply_filters(
'gravityview_page_links_args', $page_link_args );
64 $page_links = paginate_links( $page_link_args );
66 if( !empty( $page_links )) {
67 $class = !empty( $widget_args[
'custom_class'] ) ? $widget_args[
'custom_class'] :
'';
68 $class = gravityview_sanitize_html_class(
'gv-widget-page-links ' .
$class );
69 echo
'<div class="'.$class.
'">'. $page_links .
'</div>';
71 gravityview()->log->debug(
'No page links; paginate_links() returned empty response.' );
render_frontend( $widget_args, $content='', $context='')
static getInstance( $passed_post=NULL)
gv_directory_link( $post=NULL, $add_pagination=true, $context=null)
$gravityview_view
array $entry array $form array $field_settings
if(empty( $field_settings['content'])) $content
new GravityView_Widget_Page_Links
gravityview()
The main GravityView wrapper function.
Widget to display page links.