WordPress.org

Plugin Directory

Changeset 630510


Ignore:
Timestamp:
11/27/12 03:38:26 (17 months ago)
Author:
jeremyfelt
Message:

Update to 1.7, see https://github.com/jeremyfelt/Custom-Posts-Per-Page for development log

Location:
custom-posts-per-page/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • custom-posts-per-page/trunk/custom-posts-per-page.php

    r614406 r630510  
    44Plugin URI: http://jeremyfelt.com/wordpress/plugins/custom-posts-per-page/ 
    55Description: Shows a custom set number of posts depending on the type of page being viewed. 
    6 Version: 1.6 
     6Version: 1.7 
    77Author: Jeremy Felt 
    88Author URI: http://jeremyfelt.com 
     
    222222    public function register_settings() { 
    223223        register_setting( 'cpppc_options', 'cpppc_options', array( $this, 'validate_options' ) ); 
     224 
    224225        add_settings_section( 'cpppc_section_main', '', array( $this, 'output_main_section_text' ), 'cpppc' ); 
    225226        add_settings_section( 'cpppc_section_custom', '', array( $this, 'output_custom_section_text' ), 'cpppc_custom' ); 
    226         add_settings_field( 'cpppc_index_count', __( 'Main Index posts per page:', 'custom-posts-per-page' ), array( $this, 'output_index_count_text' ), 'cpppc', 'cpppc_section_main' ); 
    227         add_settings_field( 'cpppc_category_count', __( 'Category posts per page:', 'custom-posts-per-page' ), array( $this, 'output_category_count_text' ), 'cpppc', 'cpppc_section_main' ); 
    228         add_settings_field( 'cpppc_archive_count', __( 'Archive posts per page:', 'custom-posts-per-page' ), array( $this, 'output_archive_count_text' ), 'cpppc', 'cpppc_section_main' ); 
    229         add_settings_field( 'cpppc_tag_count', __( 'Tag posts per page:', 'custom-posts-per-page' ), array( $this, 'output_tag_count_text' ), 'cpppc', 'cpppc_section_main' ); 
    230         add_settings_field( 'cpppc_author_count', __( 'Author posts per page:', 'custom-posts-per-page' ), array( $this, 'output_author_count_text' ), 'cpppc', 'cpppc_section_main' ); 
    231         add_settings_field( 'cpppc_search_count', __( 'Search posts per page:', 'custom-posts-per-page' ), array( $this, 'output_search_count_text' ), 'cpppc', 'cpppc_section_main' ); 
    232         add_settings_field( 'cpppc_default_count', __( 'Default posts per page:', 'custom-posts-per-page' ), array( $this, 'output_default_count_text' ), 'cpppc', 'cpppc_section_main' ); 
     227 
     228        add_settings_field( 'cpppc_index_count',     __( 'Main Index posts per page:', 'custom-posts-per-page' ), array( $this, 'output_index_count_text' ),    'cpppc', 'cpppc_section_main' ); 
     229        add_settings_field( 'cpppc_category_count',  __( 'Category posts per page:', 'custom-posts-per-page' ),   array( $this, 'output_category_count_text' ), 'cpppc', 'cpppc_section_main' ); 
     230        add_settings_field( 'cpppc_archive_count',   __( 'Archive posts per page:', 'custom-posts-per-page' ),    array( $this, 'output_archive_count_text' ),  'cpppc', 'cpppc_section_main' ); 
     231        add_settings_field( 'cpppc_tag_count',       __( 'Tag posts per page:', 'custom-posts-per-page' ),        array( $this, 'output_tag_count_text' ),      'cpppc', 'cpppc_section_main' ); 
     232        add_settings_field( 'cpppc_author_count',    __( 'Author posts per page:', 'custom-posts-per-page' ),     array( $this, 'output_author_count_text' ),   'cpppc', 'cpppc_section_main' ); 
     233        add_settings_field( 'cpppc_search_count',    __( 'Search posts per page:', 'custom-posts-per-page' ),     array( $this, 'output_search_count_text' ),   'cpppc', 'cpppc_section_main' ); 
     234        add_settings_field( 'cpppc_default_count',   __( 'Default posts per page:', 'custom-posts-per-page' ),    array( $this, 'output_default_count_text' ),  'cpppc', 'cpppc_section_main' ); 
     235 
    233236        add_settings_field( 'cpppc_post_type_count', '', array( $this, 'output_post_type_count_text' ), 'cpppc_custom', 'cpppc_section_custom' ); 
    234237    } 
     
    469472     * posts we need to return to the query in order for core to calculate the correct number of pages required. 
    470473     * 
     474     * It should be noted here that found_posts is modified if the value of posts per page is different for page 1 
     475     * than subsequent pages. This is intended to resolve pagination issues in popular WordPress plugins, but can 
     476     * possibly cause related issues for other things that are depending on an exact found posts value. 
     477     * 
    471478     * @param $found_posts int The number of found posts 
    472479     * @return mixed The number of posts to report as found for real 
     
    478485 
    479486        // We don't have the same issues if our first page and paged counts are the same as the math is easy then 
    480         if ( $this->final_options['set_count'] == $this->final_options['set_count_paged'] ) 
     487        if ( $this->final_options['set_count'] === $this->final_options['set_count_paged'] ) 
    481488            return $found_posts; 
    482489 
  • custom-posts-per-page/trunk/readme.txt

    r614406 r630510  
    44Donate link: http://jeremyfelt.com/wordpress/plugins/custom-posts-per-page/ 
    55Tags: admin, administration, settings, archives, posts-per-page, paged, posts, count, number, custom-post-type 
    6 Requires at least: 3.2.1 
     6Requires at least: 3.3 
    77Tested up to: 3.5 
    8 Stable tag: 1.6 
     8Stable tag: 1.7 
    99 
    1010Custom Posts Per Page provides a settings page in your WordPress admin that allows you to specify how many posts are displayed for different views. 
     
    4040 
    4141== Frequently Asked Questions == 
     42= What are you doing with found_posts? = 
     43 
     44* An issue was appearing in plugins that assisted with pagination when the setting for posts per page was different from subsequent pages. To resolve this issue, we do some math and return an incorrect found_posts value when that scenario occurs. This doesn't affect any core WordPress functionality, but could confuse other plugins that are looking for a correct value. I wouldn't worry about this much, but keep it in mind if you are seeing issues *and* have two different values entered as described. 
     45 
    4246= Should I keep using WordPress 3.2.1? = 
    4347 
    44 * No. I'm being nice for now, but when 3.5 comes out, I'm totally removing the last piece of code that ties this plugin to 3.2.1. Sorry. :) 
    45  
    46 = Why aren't there any FAQs? = 
    47  
    48 *  Because nobody has asked a question yet. 
     48* No. The next release of this plugin, version 1.8, will *not* support WordPress 3.2.1. 
    4949 
    5050== Screenshots == 
Note: See TracChangeset for help on using the changeset viewer.