Plugin Directory

Changeset 3038110


Ignore:
Timestamp:
02/19/2024 06:12:36 PM (2 years ago)
Author:
gosuccess
Message:

Paginated posts and pages are now also included in the XML sitemap.

Location:
xml-cache
Files:
26 added
3 edited

Legend:

Unmodified
Added
Removed
  • xml-cache/trunk/includes/sitemap.php

    r3027275 r3038110  
    108108            if ( ! empty( $permalink ) ) {
    109109                $this->sitemap_urls[] = $permalink;
     110
     111                /**
     112                 * Check if post has multiple pages.
     113                 */
     114                if ( 'get_permalink' === $permalink_callable ) {
     115                    $postdata = \generate_postdata( $id );
     116                    $slash = str_ends_with( $permalink, '/' ) ? '' : '/';
     117
     118                    if ( false !== $postdata && 1 === $postdata['multipage'] ) {
     119                        $numpage = $postdata['numpages'];
     120
     121                        while ( $numpage > 1 ) {
     122                            $this->sitemap_urls[] = $permalink . $slash . $numpage;
     123                            $numpage--;
     124                        }
     125                    }
     126                }
    110127            }
    111128        }
  • xml-cache/trunk/readme.txt

    r3027275 r3038110  
    44Tags: xml, cache, sitemap, litespeed cache, pagespeed
    55Requires at least: 6.0
    6 Tested up to: 6.4.2
    7 Stable tag: 1.0.0
     6Tested up to: 6.4.3
     7Stable tag: 1.1.0
    88Requires PHP: 8.0
    99License: GPLv3 or later
     
    4949== Changelog ==
    5050
     51= 1.1.0 =
     52* Paginated posts and pages are now also included in the XML sitemap.
     53
    5154= 1.0.0 =
    5255* Initial release.
  • xml-cache/trunk/xml-cache.php

    r3027275 r3038110  
    66 * Plugin Name:       XML Cache
    77 * Description:       Generates an XML sitemap for cache plugins.
    8  * Version:           1.0.0
     8 * Version:           1.1.0
    99 * Requires at least: 6.0
    1010 * Requires PHP:      8.0
Note: See TracChangeset for help on using the changeset viewer.