Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/sal
File: class.json-api-post-jetpack.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
[0] Fix | Delete
/**
[1] Fix | Delete
* This class extends the SAL_Post class, providing the implementation for
[2] Fix | Delete
* functions that were declared in that SAL_Post class.
[3] Fix | Delete
*
[4] Fix | Delete
* @see WPCOM_JSON_API_Post_v1_1_Endpoint in class.wpcom-json-api-post-v1-1-endpoint.php for more context on
[5] Fix | Delete
* the functions implemented here.
[6] Fix | Delete
*
[7] Fix | Delete
* @package automattic/jetpack
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[11] Fix | Delete
exit( 0 );
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* Base class for Jetpack_Post.
[16] Fix | Delete
*/
[17] Fix | Delete
class Jetpack_Post extends SAL_Post {
[18] Fix | Delete
/**
[19] Fix | Delete
* Defines a default value for the like counts on a post, if this hasn't been defined yet.
[20] Fix | Delete
*
[21] Fix | Delete
* @return int Returns 0.
[22] Fix | Delete
**/
[23] Fix | Delete
public function get_like_count() {
[24] Fix | Delete
return 0;
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* Defines a default value for whether or not the current user likes this post, if this hasn't been defined yet.
[29] Fix | Delete
*
[30] Fix | Delete
* @return bool Returns false
[31] Fix | Delete
**/
[32] Fix | Delete
public function is_liked() {
[33] Fix | Delete
return false;
[34] Fix | Delete
}
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* Defines a default value for whether or not the current user reblogged this post, if this hasn't been defined yet.
[38] Fix | Delete
*
[39] Fix | Delete
* @return bool Returns false
[40] Fix | Delete
**/
[41] Fix | Delete
public function is_reblogged() {
[42] Fix | Delete
return false;
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
/**
[46] Fix | Delete
* Defines a default value for whether or not the current user is following this blog, if this hasn't been defined yet.
[47] Fix | Delete
*
[48] Fix | Delete
* @return bool Returns false
[49] Fix | Delete
**/
[50] Fix | Delete
public function is_following() {
[51] Fix | Delete
return false;
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
/**
[55] Fix | Delete
* Defines the unique WordPress.com-wide representation of a post, if this hasn't been defined yet.
[56] Fix | Delete
*
[57] Fix | Delete
* @return string Returns an empty string
[58] Fix | Delete
**/
[59] Fix | Delete
public function get_global_id() {
[60] Fix | Delete
return '';
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
/**
[64] Fix | Delete
* Defines a default value for whether or not there is gelocation data for this post, if this hasn't been defined yet.
[65] Fix | Delete
*
[66] Fix | Delete
* @return bool Returns false
[67] Fix | Delete
**/
[68] Fix | Delete
public function get_geo() {
[69] Fix | Delete
return false;
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
/**
[73] Fix | Delete
* Returns the avatar URL for a user, or an empty string if there isn't a valid avatar.
[74] Fix | Delete
*
[75] Fix | Delete
* @param string $email The user's email.
[76] Fix | Delete
* @param int $avatar_size The size of the avatar in pixels.
[77] Fix | Delete
*
[78] Fix | Delete
* @return string
[79] Fix | Delete
*/
[80] Fix | Delete
protected function get_avatar_url( $email, $avatar_size = 96 ) {
[81] Fix | Delete
$avatar_url = get_avatar_url(
[82] Fix | Delete
$email,
[83] Fix | Delete
array(
[84] Fix | Delete
'size' => $avatar_size,
[85] Fix | Delete
)
[86] Fix | Delete
);
[87] Fix | Delete
[88] Fix | Delete
if ( ! $avatar_url || is_wp_error( $avatar_url ) ) {
[89] Fix | Delete
return '';
[90] Fix | Delete
}
[91] Fix | Delete
return $avatar_url;
[92] Fix | Delete
}
[93] Fix | Delete
}
[94] Fix | Delete
[95] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function