• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Jetpack a2z

Jetpack a2z

Jetpack a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Jetpack_Sitemap_Manager::callback_action_do_robotstxt() – Callback to add sitemap to robots.txt.

You appear to be a bot. Output may be restricted

Description

Callback to add sitemap to robots.txt.

Usage

Jetpack_Sitemap_Manager::callback_action_do_robotstxt();

Parameters

Returns

void

Source

File name: jetpack/modules/sitemaps/sitemaps.php
Lines:

1 to 54 of 54
  public function callback_action_do_robotstxt() {

    
/**
 * Filter whether to make the default sitemap discoverable to robots or not. Default true.
 *
 * @module sitemaps
 * @since 3.9.0
 * @deprecated 7.4.0
 *
 * @param bool $discover_sitemap Make default sitemap discoverable to robots.
 */
    $discover_sitemap = apply_filters_deprecated( 'jetpack_sitemap_generate', array( true ), 'jetpack-7.4.0', 'jetpack_sitemap_include_in_robotstxt' );

    
/**
 * Filter whether to make the default sitemap discoverable to robots or not. Default true.
 *
 * @module sitemaps
 * @since 7.4.0
 *
 * @param bool $discover_sitemap Make default sitemap discoverable to robots.
 */
    $discover_sitemap = apply_filters( 'jetpack_sitemap_include_in_robotstxt', $discover_sitemap );

    if ( true === $discover_sitemap ) {
      $sitemap_url = $this->finder->construct_sitemap_url( 'sitemap.xml' );
      echo 'Sitemap: ' . esc_url( $sitemap_url ) . "\n";
    }

    
/**
 * Filter whether to make the news sitemap discoverable to robots or not. Default true.
 *
 * @module sitemaps
 * @since 3.9.0
 * @deprecated 7.4.0
 *
 * @param bool $discover_news_sitemap Make default news sitemap discoverable to robots.
 */
    $discover_news_sitemap = apply_filters_deprecated( 'jetpack_news_sitemap_generate', array( true ), 'jetpack-7.4.0', 'jetpack_news_sitemap_include_in_robotstxt' );

    
/**
 * Filter whether to make the news sitemap discoverable to robots or not. Default true.
 *
 * @module sitemaps
 * @since 7.4.0
 *
 * @param bool $discover_news_sitemap Make default news sitemap discoverable to robots.
 */
    $discover_news_sitemap = apply_filters( 'jetpack_news_sitemap_include_in_robotstxt', $discover_news_sitemap );

    if ( true === $discover_news_sitemap ) {
      $news_sitemap_url = $this->finder->construct_sitemap_url( 'news-sitemap.xml' );
      echo 'Sitemap: ' . esc_url( $news_sitemap_url ) . "\n";
    }
  }
 

 View on GitHub View on Trac

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Related

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

Primary Sidebar

Information

Function name: Jetpack_Sitemap_Manager::callback_action_do_robotstxt
Class ref: Jetpack_Sitemap_Manager
Plugin ref: Jetpack
Version: 9.4
Sourcefile: modules/sitemaps/sitemaps.php
File ref: modules/sitemaps/sitemaps.php
Deprecated?: No
API Letters: A,C,J,M,S

Footer

Jetpack a2z
Jetpack a2z
Jetpack a2z
WordPress 5.6.2
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:  jetpack.wp-a2z.org
© Copyright Jetpack a2z 2014-2021. All rights reserved.


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

  • Home
  • Blog
  • Sitemap
  • Sites