• 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_Stylist::sanitize_with_links() – Convert named entities, strip all HTML except anchor tags, and interpolate with vsprintf. This is a helper function for all the internationalized UI strings in this class which have to include URLs.

You appear to be a bot. Output may be restricted

Description

Convert named entities, strip all HTML except anchor tags, and interpolate with vsprintf. This is a helper function for all the internationalized UI strings in this class which have to include URLs.

Note that $url_array should be indexed by integers like so: array(

  • 1 => 'example.com',
  • 2 => 'example.org',

); Then '%1$s' in the format string will substitute 'example.com' and '%2$s' will substitute 'example.org'.

Usage

$string = Jetpack_Sitemap_Stylist::sanitize_with_links( $format, $url_array );

Parameters

$format
( string ) required – A vsprintf-style format string to be sanitized.
$url_array
( array ) required – The string substitution array to be passed to vsprintf.

Returns

string The sanitized string.

Source

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

1 to 14 of 14
  private static function sanitize_with_links( $format, $url_array ) {
    return vsprintf(
      wp_kses(
        ent2ncr( $format ),
        array(
          'a' => array(
            'href'  => true,
            'title' => true,
          ),
        )
      ),
      $url_array
    );
  }
 

 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_Stylist::sanitize_with_links
Class ref: Jetpack_Sitemap_Stylist
Plugin ref: Jetpack
Version: 9.4
Sourcefile: modules/sitemaps/sitemap-stylist.php
File ref: modules/sitemaps/sitemap-stylist.php
Deprecated?: No
API Letters: J,S,W

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