• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Yoast SEO a2z

Yoast SEO a2z

WordPress SEO a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / WPSEO_Sitemaps::register_sitemap() – Register your own sitemap. Call this during ‘init’.

You appear to be a bot. Output may be restricted

Description

Register your own sitemap. Call this during 'init'.

Usage

WPSEO_Sitemaps::register_sitemap( $name, $function, $rewrite );

Parameters

$name
( string ) required – The name of the sitemap.
$function
( callback ) required – Function to build your sitemap.
$rewrite
( string ) optional – Optional. Regular expression to match your sitemap with.

Returns

void

Source

File name: wordpress-seo/inc/sitemaps/class-sitemaps.php
Lines:

1 to 6 of 6
  public function register_sitemap( $name, $function, $rewrite = '' ) {
    add_action( 'wpseo_do_sitemap_' . $name, $function );
    if ( ! empty( $rewrite ) ) {
      add_rewrite_rule( $rewrite, 'index.php?sitemap=' . $name, 'top' );
    }
  }
 

 View on GitHub View on Trac

Published: 27th November 2019 | Last updated: 27th November 2019

Primary Sidebar

Information

Function name: WPSEO_Sitemaps::register_sitemap
Class ref: WPSEO_Sitemaps
Plugin ref: Yoast SEO
Version: 15.4
Sourcefile: inc/sitemaps/class-sitemaps.php
File ref: inc/sitemaps/class-sitemaps.php
Deprecated?: No
API Letters: R,S,W

Footer

Yoast SEO a2z
Yoast SEO a2z
WordPress SEO a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wordpress-seo.wp-a2z.org
© Copyright Yoast SEO a2z 2017-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites