• 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_Core_Json_Api_Endpoints::validate_string() – Validates that the parameter is a string.

You appear to be a bot. Output may be restricted

Description

Validates that the parameter is a string.

Usage

$bool|WP_Error = Jetpack_Core_Json_Api_Endpoints::validate_string( $value, $request, $param );

Parameters

$value
( string ) required – Value to check.
$request
( WP_REST_Request ) required – The request sent to the WP REST API.
$param
( string ) required – Name of the parameter passed to endpoint holding $value.

Returns

bool|WP_Error

Source

File name: jetpack/_inc/lib/class.core-rest-api-endpoints.php


Lines:

1 to 7 of 7
  public static function validate_string( $value, $request, $param ) {
    if ( ! is_string( $value ) ) {
      return new WP_Error( 'invalid_param', sprintf( esc_html__( '%s must be a string.', 'jetpack' ), $param ) );
    }
    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: 10 December 2020

Primary Sidebar

Information

Function name: Jetpack_Core_Json_Api_Endpoints::validate_string
Class ref: Jetpack_Core_Json_Api_Endpoints
Plugin ref: Jetpack
Version: 9.2
Sourcefile: _inc/lib/class.core-rest-api-endpoints.php
File ref: _inc/lib/class.core-rest-api-endpoints.php
Deprecated?: No
API Letters: A,C,E,J

Footer

Jetpack a2z
Jetpack a2z
Jetpack 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:  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