| Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/ |
| Current File : /home/x/b/o/xbodynamge/namtation/wp-content/indexable-author-watcher.php.tar |
lebauwcentre/wp-content/plugins/wordpress-seo/src/integrations/watchers/indexable-author-watcher.php0000644 00000004373 15114412005 0033341 0 ustar 00 home/xbodynamge <?php
namespace Yoast\WP\SEO\Integrations\Watchers;
use Yoast\WP\SEO\Builders\Indexable_Builder;
use Yoast\WP\SEO\Conditionals\Migrations_Conditional;
use Yoast\WP\SEO\Integrations\Integration_Interface;
use Yoast\WP\SEO\Repositories\Indexable_Repository;
/**
* Watches an Author to save the meta information to an Indexable when updated.
*/
class Indexable_Author_Watcher implements Integration_Interface {
/**
* The indexable repository.
*
* @var Indexable_Repository
*/
protected $repository;
/**
* The indexable builder.
*
* @var Indexable_Builder
*/
protected $builder;
/**
* Returns the conditionals based on which this loadable should be active.
*
* @return array
*/
public static function get_conditionals() {
return [ Migrations_Conditional::class ];
}
/**
* Indexable_Author_Watcher constructor.
*
* @param Indexable_Repository $repository The repository to use.
* @param Indexable_Builder $builder The builder to use.
*/
public function __construct( Indexable_Repository $repository, Indexable_Builder $builder ) {
$this->repository = $repository;
$this->builder = $builder;
}
/**
* Initializes the integration.
*
* This is the place to register hooks and filters.
*/
public function register_hooks() {
\add_action( 'user_register', [ $this, 'build_indexable' ], \PHP_INT_MAX );
\add_action( 'profile_update', [ $this, 'build_indexable' ], \PHP_INT_MAX );
\add_action( 'deleted_user', [ $this, 'delete_indexable' ] );
}
/**
* Deletes user meta.
*
* @param int $user_id User ID to delete the metadata of.
*
* @return void
*/
public function delete_indexable( $user_id ) {
$indexable = $this->repository->find_by_id_and_type( $user_id, 'user', false );
if ( ! $indexable ) {
return;
}
$indexable->delete();
}
/**
* Saves user meta.
*
* @param int $user_id User ID.
*
* @return void
*/
public function build_indexable( $user_id ) {
$indexable = $this->repository->find_by_id_and_type( $user_id, 'user', false );
$indexable = $this->builder->build_for_id_and_type( $user_id, 'user', $indexable );
if ( $indexable ) {
$indexable->object_last_modified = \max( $indexable->object_last_modified, \current_time( 'mysql' ) );
$indexable->save();
}
}
}
namtation/wp-content/plugins/wordpress-seo/src/integrations/watchers/indexable-author-watcher.php 0000644 00000004373 15114415405 0032662 0 ustar 00 home/xbodynamge <?php
namespace Yoast\WP\SEO\Integrations\Watchers;
use Yoast\WP\SEO\Builders\Indexable_Builder;
use Yoast\WP\SEO\Conditionals\Migrations_Conditional;
use Yoast\WP\SEO\Integrations\Integration_Interface;
use Yoast\WP\SEO\Repositories\Indexable_Repository;
/**
* Watches an Author to save the meta information to an Indexable when updated.
*/
class Indexable_Author_Watcher implements Integration_Interface {
/**
* The indexable repository.
*
* @var Indexable_Repository
*/
protected $repository;
/**
* The indexable builder.
*
* @var Indexable_Builder
*/
protected $builder;
/**
* Returns the conditionals based on which this loadable should be active.
*
* @return array
*/
public static function get_conditionals() {
return [ Migrations_Conditional::class ];
}
/**
* Indexable_Author_Watcher constructor.
*
* @param Indexable_Repository $repository The repository to use.
* @param Indexable_Builder $builder The builder to use.
*/
public function __construct( Indexable_Repository $repository, Indexable_Builder $builder ) {
$this->repository = $repository;
$this->builder = $builder;
}
/**
* Initializes the integration.
*
* This is the place to register hooks and filters.
*/
public function register_hooks() {
\add_action( 'user_register', [ $this, 'build_indexable' ], \PHP_INT_MAX );
\add_action( 'profile_update', [ $this, 'build_indexable' ], \PHP_INT_MAX );
\add_action( 'deleted_user', [ $this, 'delete_indexable' ] );
}
/**
* Deletes user meta.
*
* @param int $user_id User ID to delete the metadata of.
*
* @return void
*/
public function delete_indexable( $user_id ) {
$indexable = $this->repository->find_by_id_and_type( $user_id, 'user', false );
if ( ! $indexable ) {
return;
}
$indexable->delete();
}
/**
* Saves user meta.
*
* @param int $user_id User ID.
*
* @return void
*/
public function build_indexable( $user_id ) {
$indexable = $this->repository->find_by_id_and_type( $user_id, 'user', false );
$indexable = $this->builder->build_for_id_and_type( $user_id, 'user', $indexable );
if ( $indexable ) {
$indexable->object_last_modified = \max( $indexable->object_last_modified, \current_time( 'mysql' ) );
$indexable->save();
}
}
}
wp-content/plugins/wordpress-seo/src/integrations/watchers/indexable-author-watcher.php 0000644 00000004373 15114415627 0033563 0 ustar 00 home/xbodynamge/crosstraining <?php
namespace Yoast\WP\SEO\Integrations\Watchers;
use Yoast\WP\SEO\Builders\Indexable_Builder;
use Yoast\WP\SEO\Conditionals\Migrations_Conditional;
use Yoast\WP\SEO\Integrations\Integration_Interface;
use Yoast\WP\SEO\Repositories\Indexable_Repository;
/**
* Watches an Author to save the meta information to an Indexable when updated.
*/
class Indexable_Author_Watcher implements Integration_Interface {
/**
* The indexable repository.
*
* @var Indexable_Repository
*/
protected $repository;
/**
* The indexable builder.
*
* @var Indexable_Builder
*/
protected $builder;
/**
* Returns the conditionals based on which this loadable should be active.
*
* @return array
*/
public static function get_conditionals() {
return [ Migrations_Conditional::class ];
}
/**
* Indexable_Author_Watcher constructor.
*
* @param Indexable_Repository $repository The repository to use.
* @param Indexable_Builder $builder The builder to use.
*/
public function __construct( Indexable_Repository $repository, Indexable_Builder $builder ) {
$this->repository = $repository;
$this->builder = $builder;
}
/**
* Initializes the integration.
*
* This is the place to register hooks and filters.
*/
public function register_hooks() {
\add_action( 'user_register', [ $this, 'build_indexable' ], \PHP_INT_MAX );
\add_action( 'profile_update', [ $this, 'build_indexable' ], \PHP_INT_MAX );
\add_action( 'deleted_user', [ $this, 'delete_indexable' ] );
}
/**
* Deletes user meta.
*
* @param int $user_id User ID to delete the metadata of.
*
* @return void
*/
public function delete_indexable( $user_id ) {
$indexable = $this->repository->find_by_id_and_type( $user_id, 'user', false );
if ( ! $indexable ) {
return;
}
$indexable->delete();
}
/**
* Saves user meta.
*
* @param int $user_id User ID.
*
* @return void
*/
public function build_indexable( $user_id ) {
$indexable = $this->repository->find_by_id_and_type( $user_id, 'user', false );
$indexable = $this->builder->build_for_id_and_type( $user_id, 'user', $indexable );
if ( $indexable ) {
$indexable->object_last_modified = \max( $indexable->object_last_modified, \current_time( 'mysql' ) );
$indexable->save();
}
}
}
www/wp-content/plugins/wordpress-seo/src/integrations/watchers/indexable-author-watcher.php 0000644 00000004373 15114436405 0031517 0 ustar 00 home/xbodynamge <?php
namespace Yoast\WP\SEO\Integrations\Watchers;
use Yoast\WP\SEO\Builders\Indexable_Builder;
use Yoast\WP\SEO\Conditionals\Migrations_Conditional;
use Yoast\WP\SEO\Integrations\Integration_Interface;
use Yoast\WP\SEO\Repositories\Indexable_Repository;
/**
* Watches an Author to save the meta information to an Indexable when updated.
*/
class Indexable_Author_Watcher implements Integration_Interface {
/**
* The indexable repository.
*
* @var Indexable_Repository
*/
protected $repository;
/**
* The indexable builder.
*
* @var Indexable_Builder
*/
protected $builder;
/**
* Returns the conditionals based on which this loadable should be active.
*
* @return array
*/
public static function get_conditionals() {
return [ Migrations_Conditional::class ];
}
/**
* Indexable_Author_Watcher constructor.
*
* @param Indexable_Repository $repository The repository to use.
* @param Indexable_Builder $builder The builder to use.
*/
public function __construct( Indexable_Repository $repository, Indexable_Builder $builder ) {
$this->repository = $repository;
$this->builder = $builder;
}
/**
* Initializes the integration.
*
* This is the place to register hooks and filters.
*/
public function register_hooks() {
\add_action( 'user_register', [ $this, 'build_indexable' ], \PHP_INT_MAX );
\add_action( 'profile_update', [ $this, 'build_indexable' ], \PHP_INT_MAX );
\add_action( 'deleted_user', [ $this, 'delete_indexable' ] );
}
/**
* Deletes user meta.
*
* @param int $user_id User ID to delete the metadata of.
*
* @return void
*/
public function delete_indexable( $user_id ) {
$indexable = $this->repository->find_by_id_and_type( $user_id, 'user', false );
if ( ! $indexable ) {
return;
}
$indexable->delete();
}
/**
* Saves user meta.
*
* @param int $user_id User ID.
*
* @return void
*/
public function build_indexable( $user_id ) {
$indexable = $this->repository->find_by_id_and_type( $user_id, 'user', false );
$indexable = $this->builder->build_for_id_and_type( $user_id, 'user', $indexable );
if ( $indexable ) {
$indexable->object_last_modified = \max( $indexable->object_last_modified, \current_time( 'mysql' ) );
$indexable->save();
}
}
}