• 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_Buffer::append() – Append an item to the buffer, if there is room for it, and set is_empty_flag to false. If there is no room, we set is_full_flag to true. If $item is null, don’t do anything and report success.

You appear to be a bot. Output may be restricted

Description

Append an item to the buffer, if there is room for it, and set is_empty_flag to false. If there is no room, we set is_full_flag to true. If $item is null, don't do anything and report success.

Usage

$bool = Jetpack_Sitemap_Buffer::append( $array );

Parameters

$array
( array ) required – The item to be added.

Returns

bool True if the append succeeded, False if not.

Source

File name: jetpack/modules/sitemaps/sitemap-buffer.php
Lines:

1 to 21 of 21
  public function append( $array ) {
    if ( is_null( $array ) ) {
      return true;
    }

    if ( $this->is_full_flag ) {
      return false;
    }

    if ( 0 >= $this->item_capacity || 0 >= $this->byte_capacity ) {
      $this->is_full_flag = true;
      return false;
    } else {
      $this->item_capacity -= 1;
      $added_element        = $this->array_to_xml_string( $array, $this->get_root_element(), $this->doc );

      $this->byte_capacity -= strlen( $this->doc->saveXML( $added_element ) );

      return true;
    }
  }
 

 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_Buffer::append
Class ref: Jetpack_Sitemap_Buffer
Plugin ref: Jetpack
Version: 9.4
Sourcefile: modules/sitemaps/sitemap-buffer.php
File ref: modules/sitemaps/sitemap-buffer.php
Deprecated?: No
API Letters: A,B,J,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