WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi
[resolved] admin.php fix to account for strict notice... (3 posts)

  1. Mike Stop Continues
    Member
    Posted 9 months ago #

    validate method should be compatible with scbAdminPage::validate...

    function validate( $new_data, $old_data ) {
    		foreach ( array( 'style', 'num_pages', 'num_larger_page_numbers', 'larger_page_numbers_multiple' ) as $key )
    			$new_data[$key] = absint( @$new_data[$key] );
    
    		foreach ( array( 'use_pagenavi_css', 'always_show' ) as $key )
    			$new_data[$key] = (bool) @$new_data[$key];
    
    		return $new_data;
    	}

    http://wordpress.org/plugins/wp-pagenavi/

  2. Tom J Nowell
    Member
    Posted 8 months ago #

    Same issue here, very annoying, but easily fixed, here's my version which removes the @

    function validate( $options, $old_data  ) {
    		foreach ( array( 'style', 'num_pages', 'num_larger_page_numbers', 'larger_page_numbers_multiple' ) as $key ) {
    			if ( isset( $options[$key] ) ) {
    				$options[$key] = absint( $options[$key] );
    			} else {
    				$options[$key] = 0;
    			}
    		}
  3. Lester Chan
    Member
    Plugin Author

    Posted 8 months ago #

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.