wpseo_get_value

Get the value from the post custom values.

Description

(string) wpseo_get_value( (string) $val, (int) $postid = 0 ); 

Returns (string)

Parameters (2)

0. $val (string)
Internal name of the value to get.
1. $postid — Optional. (int)
Post ID of the post to get the value for.

Usage

  1. if ( !function_exists( 'wpseo_get_value' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yoast-seo/inc/wpseo-functions-deprecated.php'; 
  3.  
  4. // Internal name of the value to get. 
  5. $val = ''; 
  6.  
  7. // Post ID of the post to get the value for. 
  8. $postid = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wpseo_get_value($val, $postid); 
  12.  

Defined (1)

The function is defined in the following location(s).

/inc/wpseo-functions-deprecated.php  
  1. function wpseo_get_value( $val, $postid = 0 ) { 
  2. _deprecated_function( __FUNCTION__, 'WPSEO 1.5.0', 'WPSEO_Meta::get_value()' ); 
  3.  
  4. return WPSEO_Meta::get_value( $val, $postid );