| Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/ |
| Current File : /home/x/b/o/xbodynamge/namtation/wp-content/images.php.tar |
home/xbodynamge/lebauwcentre/wp-content/plugins/wordpress-seo/src/values/open-graph/images.php 0000644 00000002205 15114027675 0027017 0 ustar 00 <?php
namespace Yoast\WP\SEO\Values\Open_Graph;
use Yoast\WP\SEO\Helpers\Open_Graph\Image_Helper as Open_Graph_Image_Helper;
use Yoast\WP\SEO\Values\Images as Base_Images;
/**
* Value object for the Open Graph Images.
*/
class Images extends Base_Images {
/**
* The Open Graph image helper.
*
* @var Open_Graph_Image_Helper
*/
protected $open_graph_image;
/**
* Sets the helpers.
*
* @required
*
* @codeCoverageIgnore - Is handled by DI-container.
*
* @param Open_Graph_Image_Helper $open_graph_image Image helper for Open Graph.
*/
public function set_helpers( Open_Graph_Image_Helper $open_graph_image ) {
$this->open_graph_image = $open_graph_image;
}
/**
* Outputs the images.
*
* @codeCoverageIgnore - The method is empty, nothing to test.
*
* @return void
*/
public function show() {}
/**
* Adds an image to the list by image ID.
*
* @param int $image_id The image ID to add.
*
* @return void
*/
public function add_image_by_id( $image_id ) {
$attachment = $this->open_graph_image->get_image_by_id( $image_id );
if ( $attachment ) {
$this->add_image( $attachment );
}
}
}
home/xbodynamge/crosstraining/wp-content/plugins/wordpress-seo/src/values/images.php 0000644 00000005420 15114043007 0025151 0 ustar 00 <?php
namespace Yoast\WP\SEO\Values;
use Yoast\WP\SEO\Helpers\Image_Helper;
use Yoast\WP\SEO\Helpers\Url_Helper;
/**
* Class Images
*
* Value object for the Images.
*/
class Images {
/**
* The image size.
*
* @var string
*/
public $image_size = 'full';
/**
* Holds the images that have been put out as image.
*
* @var array
*/
protected $images = [];
/**
* The image helper.
*
* @var Image_Helper
*/
protected $image;
/**
* The URL helper.
*
* @var Url_Helper
*/
protected $url;
/**
* Images constructor.
*
* @codeCoverageIgnore
*
* @param Image_Helper $image The image helper.
* @param Url_Helper $url The url helper.
*/
public function __construct( Image_Helper $image, Url_Helper $url ) {
$this->image = $image;
$this->url = $url;
}
/**
* Adds an image to the list by image ID.
*
* @param int $image_id The image ID to add.
*
* @return void
*/
public function add_image_by_id( $image_id ) {
$image = $this->image->get_attachment_image_source( $image_id, $this->image_size );
if ( $image ) {
$this->add_image( $image );
}
}
/**
* Adds an image to the list by image ID.
*
* @param string $image_meta JSON encoded image meta.
*
* @return void
*/
public function add_image_by_meta( $image_meta ) {
$this->add_image( (array) \json_decode( $image_meta ) );
}
/**
* Return the images array.
*
* @return array The images.
*/
public function get_images() {
return $this->images;
}
/**
* Check whether we have images or not.
*
* @return bool True if we have images, false if we don't.
*/
public function has_images() {
return ! empty( $this->images );
}
/**
* Adds an image based on a given URL.
*
* @param string $url The given URL.
*
* @return number|null Returns the found image ID if it exists. Otherwise -1.
* If the URL is empty we return null.
*/
public function add_image_by_url( $url ) {
if ( empty( $url ) ) {
return null;
}
$image_id = $this->image->get_attachment_by_url( $url );
if ( $image_id ) {
$this->add_image_by_id( $image_id );
return $image_id;
}
$this->add_image( $url );
return -1;
}
/**
* Adds an image to the list of images.
*
* @param string|array $image Image array.
*
* @return void
*/
public function add_image( $image ) {
if ( \is_string( $image ) ) {
$image = [ 'url' => $image ];
}
if ( ! \is_array( $image ) || empty( $image['url'] ) || ! \is_string( $image['url'] ) ) {
return;
}
if ( $this->url->is_relative( $image['url'] ) && $image['url'][0] === '/' ) {
$image['url'] = $this->url->build_absolute_url( $image['url'] );
}
if ( \array_key_exists( $image['url'], $this->images ) ) {
return;
}
$this->images[ $image['url'] ] = $image;
}
}
home/xbodynamge/www/wp-content/plugins/wordpress-seo/src/values/open-graph/images.php 0000644 00000002205 15114107733 0025155 0 ustar 00 <?php
namespace Yoast\WP\SEO\Values\Open_Graph;
use Yoast\WP\SEO\Helpers\Open_Graph\Image_Helper as Open_Graph_Image_Helper;
use Yoast\WP\SEO\Values\Images as Base_Images;
/**
* Value object for the Open Graph Images.
*/
class Images extends Base_Images {
/**
* The Open Graph image helper.
*
* @var Open_Graph_Image_Helper
*/
protected $open_graph_image;
/**
* Sets the helpers.
*
* @required
*
* @codeCoverageIgnore - Is handled by DI-container.
*
* @param Open_Graph_Image_Helper $open_graph_image Image helper for Open Graph.
*/
public function set_helpers( Open_Graph_Image_Helper $open_graph_image ) {
$this->open_graph_image = $open_graph_image;
}
/**
* Outputs the images.
*
* @codeCoverageIgnore - The method is empty, nothing to test.
*
* @return void
*/
public function show() {}
/**
* Adds an image to the list by image ID.
*
* @param int $image_id The image ID to add.
*
* @return void
*/
public function add_image_by_id( $image_id ) {
$attachment = $this->open_graph_image->get_image_by_id( $image_id );
if ( $attachment ) {
$this->add_image( $attachment );
}
}
}
home/xbodynamge/crosstraining/wp-content/plugins/wordpress-seo/src/values/open-graph/images.php 0000644 00000002205 15114323735 0027220 0 ustar 00 <?php
namespace Yoast\WP\SEO\Values\Open_Graph;
use Yoast\WP\SEO\Helpers\Open_Graph\Image_Helper as Open_Graph_Image_Helper;
use Yoast\WP\SEO\Values\Images as Base_Images;
/**
* Value object for the Open Graph Images.
*/
class Images extends Base_Images {
/**
* The Open Graph image helper.
*
* @var Open_Graph_Image_Helper
*/
protected $open_graph_image;
/**
* Sets the helpers.
*
* @required
*
* @codeCoverageIgnore - Is handled by DI-container.
*
* @param Open_Graph_Image_Helper $open_graph_image Image helper for Open Graph.
*/
public function set_helpers( Open_Graph_Image_Helper $open_graph_image ) {
$this->open_graph_image = $open_graph_image;
}
/**
* Outputs the images.
*
* @codeCoverageIgnore - The method is empty, nothing to test.
*
* @return void
*/
public function show() {}
/**
* Adds an image to the list by image ID.
*
* @param int $image_id The image ID to add.
*
* @return void
*/
public function add_image_by_id( $image_id ) {
$attachment = $this->open_graph_image->get_image_by_id( $image_id );
if ( $attachment ) {
$this->add_image( $attachment );
}
}
}
home/xbodynamge/namtation/wp-content/plugins/wordpress-seo/src/values/open-graph/images.php 0000644 00000002205 15114524472 0026326 0 ustar 00 <?php
namespace Yoast\WP\SEO\Values\Open_Graph;
use Yoast\WP\SEO\Helpers\Open_Graph\Image_Helper as Open_Graph_Image_Helper;
use Yoast\WP\SEO\Values\Images as Base_Images;
/**
* Value object for the Open Graph Images.
*/
class Images extends Base_Images {
/**
* The Open Graph image helper.
*
* @var Open_Graph_Image_Helper
*/
protected $open_graph_image;
/**
* Sets the helpers.
*
* @required
*
* @codeCoverageIgnore - Is handled by DI-container.
*
* @param Open_Graph_Image_Helper $open_graph_image Image helper for Open Graph.
*/
public function set_helpers( Open_Graph_Image_Helper $open_graph_image ) {
$this->open_graph_image = $open_graph_image;
}
/**
* Outputs the images.
*
* @codeCoverageIgnore - The method is empty, nothing to test.
*
* @return void
*/
public function show() {}
/**
* Adds an image to the list by image ID.
*
* @param int $image_id The image ID to add.
*
* @return void
*/
public function add_image_by_id( $image_id ) {
$attachment = $this->open_graph_image->get_image_by_id( $image_id );
if ( $attachment ) {
$this->add_image( $attachment );
}
}
}
home/xbodynamge/lebauwcentre/wp-content/plugins/wordpress-seo/src/values/images.php 0000644 00000005420 15114650261 0024752 0 ustar 00 <?php
namespace Yoast\WP\SEO\Values;
use Yoast\WP\SEO\Helpers\Image_Helper;
use Yoast\WP\SEO\Helpers\Url_Helper;
/**
* Class Images
*
* Value object for the Images.
*/
class Images {
/**
* The image size.
*
* @var string
*/
public $image_size = 'full';
/**
* Holds the images that have been put out as image.
*
* @var array
*/
protected $images = [];
/**
* The image helper.
*
* @var Image_Helper
*/
protected $image;
/**
* The URL helper.
*
* @var Url_Helper
*/
protected $url;
/**
* Images constructor.
*
* @codeCoverageIgnore
*
* @param Image_Helper $image The image helper.
* @param Url_Helper $url The url helper.
*/
public function __construct( Image_Helper $image, Url_Helper $url ) {
$this->image = $image;
$this->url = $url;
}
/**
* Adds an image to the list by image ID.
*
* @param int $image_id The image ID to add.
*
* @return void
*/
public function add_image_by_id( $image_id ) {
$image = $this->image->get_attachment_image_source( $image_id, $this->image_size );
if ( $image ) {
$this->add_image( $image );
}
}
/**
* Adds an image to the list by image ID.
*
* @param string $image_meta JSON encoded image meta.
*
* @return void
*/
public function add_image_by_meta( $image_meta ) {
$this->add_image( (array) \json_decode( $image_meta ) );
}
/**
* Return the images array.
*
* @return array The images.
*/
public function get_images() {
return $this->images;
}
/**
* Check whether we have images or not.
*
* @return bool True if we have images, false if we don't.
*/
public function has_images() {
return ! empty( $this->images );
}
/**
* Adds an image based on a given URL.
*
* @param string $url The given URL.
*
* @return number|null Returns the found image ID if it exists. Otherwise -1.
* If the URL is empty we return null.
*/
public function add_image_by_url( $url ) {
if ( empty( $url ) ) {
return null;
}
$image_id = $this->image->get_attachment_by_url( $url );
if ( $image_id ) {
$this->add_image_by_id( $image_id );
return $image_id;
}
$this->add_image( $url );
return -1;
}
/**
* Adds an image to the list of images.
*
* @param string|array $image Image array.
*
* @return void
*/
public function add_image( $image ) {
if ( \is_string( $image ) ) {
$image = [ 'url' => $image ];
}
if ( ! \is_array( $image ) || empty( $image['url'] ) || ! \is_string( $image['url'] ) ) {
return;
}
if ( $this->url->is_relative( $image['url'] ) && $image['url'][0] === '/' ) {
$image['url'] = $this->url->build_absolute_url( $image['url'] );
}
if ( \array_key_exists( $image['url'], $this->images ) ) {
return;
}
$this->images[ $image['url'] ] = $image;
}
}
home/xbodynamge/www/wp-content/plugins/wordpress-seo/src/values/images.php 0000644 00000005420 15114702111 0023106 0 ustar 00 <?php
namespace Yoast\WP\SEO\Values;
use Yoast\WP\SEO\Helpers\Image_Helper;
use Yoast\WP\SEO\Helpers\Url_Helper;
/**
* Class Images
*
* Value object for the Images.
*/
class Images {
/**
* The image size.
*
* @var string
*/
public $image_size = 'full';
/**
* Holds the images that have been put out as image.
*
* @var array
*/
protected $images = [];
/**
* The image helper.
*
* @var Image_Helper
*/
protected $image;
/**
* The URL helper.
*
* @var Url_Helper
*/
protected $url;
/**
* Images constructor.
*
* @codeCoverageIgnore
*
* @param Image_Helper $image The image helper.
* @param Url_Helper $url The url helper.
*/
public function __construct( Image_Helper $image, Url_Helper $url ) {
$this->image = $image;
$this->url = $url;
}
/**
* Adds an image to the list by image ID.
*
* @param int $image_id The image ID to add.
*
* @return void
*/
public function add_image_by_id( $image_id ) {
$image = $this->image->get_attachment_image_source( $image_id, $this->image_size );
if ( $image ) {
$this->add_image( $image );
}
}
/**
* Adds an image to the list by image ID.
*
* @param string $image_meta JSON encoded image meta.
*
* @return void
*/
public function add_image_by_meta( $image_meta ) {
$this->add_image( (array) \json_decode( $image_meta ) );
}
/**
* Return the images array.
*
* @return array The images.
*/
public function get_images() {
return $this->images;
}
/**
* Check whether we have images or not.
*
* @return bool True if we have images, false if we don't.
*/
public function has_images() {
return ! empty( $this->images );
}
/**
* Adds an image based on a given URL.
*
* @param string $url The given URL.
*
* @return number|null Returns the found image ID if it exists. Otherwise -1.
* If the URL is empty we return null.
*/
public function add_image_by_url( $url ) {
if ( empty( $url ) ) {
return null;
}
$image_id = $this->image->get_attachment_by_url( $url );
if ( $image_id ) {
$this->add_image_by_id( $image_id );
return $image_id;
}
$this->add_image( $url );
return -1;
}
/**
* Adds an image to the list of images.
*
* @param string|array $image Image array.
*
* @return void
*/
public function add_image( $image ) {
if ( \is_string( $image ) ) {
$image = [ 'url' => $image ];
}
if ( ! \is_array( $image ) || empty( $image['url'] ) || ! \is_string( $image['url'] ) ) {
return;
}
if ( $this->url->is_relative( $image['url'] ) && $image['url'][0] === '/' ) {
$image['url'] = $this->url->build_absolute_url( $image['url'] );
}
if ( \array_key_exists( $image['url'], $this->images ) ) {
return;
}
$this->images[ $image['url'] ] = $image;
}
}
home/xbodynamge/namtation/wp-content/plugins/wordpress-seo/src/values/images.php 0000644 00000005420 15115033343 0024261 0 ustar 00 <?php
namespace Yoast\WP\SEO\Values;
use Yoast\WP\SEO\Helpers\Image_Helper;
use Yoast\WP\SEO\Helpers\Url_Helper;
/**
* Class Images
*
* Value object for the Images.
*/
class Images {
/**
* The image size.
*
* @var string
*/
public $image_size = 'full';
/**
* Holds the images that have been put out as image.
*
* @var array
*/
protected $images = [];
/**
* The image helper.
*
* @var Image_Helper
*/
protected $image;
/**
* The URL helper.
*
* @var Url_Helper
*/
protected $url;
/**
* Images constructor.
*
* @codeCoverageIgnore
*
* @param Image_Helper $image The image helper.
* @param Url_Helper $url The url helper.
*/
public function __construct( Image_Helper $image, Url_Helper $url ) {
$this->image = $image;
$this->url = $url;
}
/**
* Adds an image to the list by image ID.
*
* @param int $image_id The image ID to add.
*
* @return void
*/
public function add_image_by_id( $image_id ) {
$image = $this->image->get_attachment_image_source( $image_id, $this->image_size );
if ( $image ) {
$this->add_image( $image );
}
}
/**
* Adds an image to the list by image ID.
*
* @param string $image_meta JSON encoded image meta.
*
* @return void
*/
public function add_image_by_meta( $image_meta ) {
$this->add_image( (array) \json_decode( $image_meta ) );
}
/**
* Return the images array.
*
* @return array The images.
*/
public function get_images() {
return $this->images;
}
/**
* Check whether we have images or not.
*
* @return bool True if we have images, false if we don't.
*/
public function has_images() {
return ! empty( $this->images );
}
/**
* Adds an image based on a given URL.
*
* @param string $url The given URL.
*
* @return number|null Returns the found image ID if it exists. Otherwise -1.
* If the URL is empty we return null.
*/
public function add_image_by_url( $url ) {
if ( empty( $url ) ) {
return null;
}
$image_id = $this->image->get_attachment_by_url( $url );
if ( $image_id ) {
$this->add_image_by_id( $image_id );
return $image_id;
}
$this->add_image( $url );
return -1;
}
/**
* Adds an image to the list of images.
*
* @param string|array $image Image array.
*
* @return void
*/
public function add_image( $image ) {
if ( \is_string( $image ) ) {
$image = [ 'url' => $image ];
}
if ( ! \is_array( $image ) || empty( $image['url'] ) || ! \is_string( $image['url'] ) ) {
return;
}
if ( $this->url->is_relative( $image['url'] ) && $image['url'][0] === '/' ) {
$image['url'] = $this->url->build_absolute_url( $image['url'] );
}
if ( \array_key_exists( $image['url'], $this->images ) ) {
return;
}
$this->images[ $image['url'] ] = $image;
}
}