args = array(
'page_title' => __( 'PageNavi Settings', 'anchor' ),
'menu_title' => __( 'PageNavi', 'anchor' ),
'page_slug' => 'pagenavi',
);
}
function validate( $options ) {
foreach ( array( 'style', 'num_pages', 'num_larger_page_numbers', 'larger_page_numbers_multiple' ) as $key )
$options[$key] = absint( @$options[$key] );
foreach ( array( 'use_pagenavi_css', 'always_show' ) as $key )
$options[$key] = (bool) @$options[$key];
return $options;
}
function page_content() {
$rows = array(
array(
'title' => __( 'Text For Number Of Pages', 'anchor' ),
'type' => 'text',
'name' => 'pages_text',
'extra' => 'size="50"',
'desc' => '
%CURRENT_PAGE% - ' . __( 'The current page number.', 'anchor' ) . '
%TOTAL_PAGES% - ' . __( 'The total number of pages.', 'anchor' )
),
array(
'title' => __( 'Text For Current Page', 'anchor' ),
'type' => 'text',
'name' => 'current_text',
'desc' => '
%PAGE_NUMBER% - ' . __( 'The page number.', 'anchor' )
),
array(
'title' => __( 'Text For Page', 'anchor' ),
'type' => 'text',
'name' => 'page_text',
'desc' => '
%PAGE_NUMBER% - ' . __( 'The page number.', 'anchor' )
),
array(
'title' => __( 'Text For First Page', 'anchor' ),
'type' => 'text',
'name' => 'first_text',
'desc' => '
%TOTAL_PAGES% - ' . __( 'The total number of pages.', 'anchor' )
),
array(
'title' => __( 'Text For Last Page', 'anchor' ),
'type' => 'text',
'name' => 'last_text',
'desc' => '
%TOTAL_PAGES% - ' . __( 'The total number of pages.', 'anchor' )
),
array(
'title' => __( 'Text For Previous Page', 'anchor' ),
'type' => 'text',
'name' => 'prev_text',
),
array(
'title' => __( 'Text For Next Page', 'anchor' ),
'type' => 'text',
'name' => 'next_text',
),
array(
'title' => __( 'Text For Previous ...', 'anchor' ),
'type' => 'text',
'name' => 'dotleft_text',
),
array(
'title' => __( 'Text For Next ...', 'anchor' ),
'type' => 'text',
'name' => 'dotright_text',
),
);
$out =
html( 'h3', __( 'Page Navigation Text', 'anchor' ) )
.html( 'p', __( 'Leaving a field blank will hide that part of the navigation.', 'anchor' ) )
.$this->table( $rows );
$rows = array(
array(
'title' => __( 'Use pagenavi-css.css', 'anchor' ),
'type' => 'checkbox',
'name' => 'use_pagenavi_css',
),
array(
'title' => __( 'Page Navigation Style', 'anchor' ),
'type' => 'select',
'name' => 'style',
'values' => array( 1 => __( 'Normal', 'anchor' ), 2 => __( 'Drop-down List', 'anchor' ) ),
'text' => false
),
array(
'title' => __( 'Always Show Page Navigation', 'anchor' ),
'type' => 'checkbox',
'name' => 'always_show',
'desc' => __( "Show navigation even if there's only one page.", 'anchor' )
),
array(
'title' => __( 'Number Of Pages To Show', 'anchor' ),
'type' => 'text',
'name' => 'num_pages',
'extra' => 'class="small-text"'
),
array(
'title' => __( 'Number Of Larger Page Numbers To Show', 'anchor' ),
'type' => 'text',
'name' => 'num_larger_page_numbers',
'extra' => 'class="small-text"',
'desc' =>
'
' . __( 'Larger page numbers are in addition to the normal page numbers. They are useful when there are many pages of posts.', 'anchor' ) .
'
' . __( 'For example, WP-PageNavi will display: Pages 1, 2, 3, 4, 5, 10, 20, 30, 40, 50.', 'anchor' ) .
'
' . __( 'Enter 0 to disable.', 'anchor' )
),
array(
'title' => __( 'Show Larger Page Numbers In Multiples Of', 'anchor' ),
'type' => 'text',
'name' => 'larger_page_numbers_multiple',
'extra' => 'class="small-text"',
'desc' =>
'
' . __( 'For example, if mutiple is 5, it will show: 5, 10, 15, 20, 25', 'anchor' )
),
);
$out .=
html( 'h3', __( 'Page Navigation Options', 'anchor' ) )
.$this->table( $rows );
echo $this->form_wrap( $out );
}
}