Submit
Path:
~
/
home
/
bfxleof
/
www
/
wp-content
/
plugins
/
wordpress-seo
/
src
/
integrations
/
watchers
/
File Content:
indexable-term-watcher.php
<?php namespace Yoast\WP\SEO\Integrations\Watchers; use Yoast\WP\SEO\Builders\Indexable_Builder; use Yoast\WP\SEO\Builders\Indexable_Link_Builder; use Yoast\WP\SEO\Conditionals\Migrations_Conditional; use Yoast\WP\SEO\Helpers\Site_Helper; use Yoast\WP\SEO\Integrations\Integration_Interface; use Yoast\WP\SEO\Repositories\Indexable_Repository; /** * Watches Terms/Taxonomies to fill the related Indexable. */ class Indexable_Term_Watcher implements Integration_Interface { /** * The indexable repository. * * @var Indexable_Repository */ protected $repository; /** * The indexable builder. * * @var Indexable_Builder */ protected $builder; /** * The link builder. * * @var Indexable_Link_Builder */ protected $link_builder; /** * Represents the site helper. * * @var Site_Helper */ protected $site; /** * Returns the conditionals based on which this loadable should be active. * * @return array */ public static function get_conditionals() { return [ Migrations_Conditional::class ]; } /** * Indexable_Term_Watcher constructor. * * @param Indexable_Repository $repository The repository to use. * @param Indexable_Builder $builder The post builder to use. * @param Indexable_Link_Builder $link_builder The lint builder to use. * @param Site_Helper $site The site helper. */ public function __construct( Indexable_Repository $repository, Indexable_Builder $builder, Indexable_Link_Builder $link_builder, Site_Helper $site ) { $this->repository = $repository; $this->builder = $builder; $this->link_builder = $link_builder; $this->site = $site; } /** * Registers the hooks. * * @return void */ public function register_hooks() { \add_action( 'created_term', [ $this, 'build_indexable' ], \PHP_INT_MAX ); \add_action( 'edited_term', [ $this, 'build_indexable' ], \PHP_INT_MAX ); \add_action( 'delete_term', [ $this, 'delete_indexable' ], \PHP_INT_MAX ); } /** * Deletes a term from the index. * * @param int $term_id The Term ID to delete. * * @return void */ public function delete_indexable( $term_id ) { $indexable = $this->repository->find_by_id_and_type( $term_id, 'term', false ); if ( ! $indexable ) { return; } $indexable->delete(); } /** * Update the taxonomy meta data on save. * * @param int $term_id ID of the term to save data for. * * @return void */ public function build_indexable( $term_id ) { // Bail if this is a multisite installation and the site has been switched. if ( $this->site->is_multisite_and_switched() ) { return; } $term = \get_term( $term_id ); if ( $term === null || \is_wp_error( $term ) ) { return; } if ( ! \is_taxonomy_viewable( $term->taxonomy ) ) { return; } $indexable = $this->repository->find_by_id_and_type( $term_id, 'term', false ); // If we haven't found an existing indexable, create it. Otherwise update it. $indexable = $this->builder->build_for_id_and_type( $term_id, 'term', $indexable ); // Update links. $this->link_builder->build( $indexable, $term->description ); $indexable->save(); } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
.DS_Store
10234 bytes
0644
AjaxController.php
2162 bytes
0644
DownloadConfController.php
945 bytes
0644
JsonSerializable.php
577 bytes
0644
LimitStream.php
4209 bytes
0644
article-modified-time-presenter.php
609 bytes
0644
auto-update-watcher.php
6315 bytes
0644
base.php
2793 bytes
0644
class-admin-utils-20260622095013.php
2147 bytes
0644
class-metabox-formatter.php
12602 bytes
0644
class-option-tabs-formatter.php
2321 bytes
0644
class-sitemaps-admin-20260703023908.php
3665 bytes
0644
class-sitemaps-admin.php
3665 bytes
0644
class-wpseo-replacement-variable.php
1375 bytes
0644
class-wpseo-statistics-20260703220502.php
1443 bytes
0644
class-wpseo-statistics.php
1443 bytes
0644
class-yoast-plugin-conflict.php
10390 bytes
0644
controller.php
2441 bytes
0644
define.php
4567 bytes
0644
description-presenter-20260623011438.php
1026 bytes
0644
duplicator-en_US.mo
582 bytes
0644
duplicator.php
1781 bytes
0644
elFinderPlugin.php
3331 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class.php
48544 bytes
0644
estimated-reading-time.php
1111 bytes
0644
exceptions.php
708 bytes
0644
inc.data.php
5121 bytes
0644
inc.validator.php
5401 bytes
0644
index.php
15 bytes
0644
indexable-ancestor-watcher.php
8187 bytes
0644
indexable-author-watcher.php
2130 bytes
0644
indexable-category-permalink-watcher.php
1663 bytes
0644
indexable-date-archive-watcher.php
2568 bytes
0644
indexable-home-page-watcher.php
3110 bytes
0644
indexable-homeurl-watcher.php
2824 bytes
0644
indexable-post-meta-watcher.php
2914 bytes
0644
indexable-post-type-archive-watcher.php
3512 bytes
0644
indexable-post-watcher.php
8497 bytes
0644
indexable-static-home-page-watcher.php
2190 bytes
0644
indexable-system-page-watcher.php
2686 bytes
0644
indexable-term-watcher.php
3194 bytes
0644
interface-wpseo-wordpress-integration.php
348 bytes
0644
loco.php
5626 bytes
0644
loco.xml
657 bytes
0644
manager.php
14659 bytes
0644
module.php
1297 bytes
0644
option-titles-watcher.php
3196 bytes
0644
option-wpseo-watcher.php
1291 bytes
0644
primary-category-quick-edit-watcher.php
5806 bytes
0644
primary-term-watcher.php
4006 bytes
0644
quick-edit-handler-1650.js
1848 bytes
0644
uninstall.php
4401 bytes
0644
wordpress-seo-es_ES.json
25583 bytes
0644
wordpress-seojs-ar-20260704200849.json
25925 bytes
0644
wordpress-seojs-ar.json
25925 bytes
0644
wordpress-seojs-bs_BA.json
13790 bytes
0644
wordpress-seojs-es_ES.json
20568 bytes
0644
wordpress-seojs-gl_ES.json
20143 bytes
0644
wordpress-seojs-ja.json
21424 bytes
0644
wordpress-seojs-uk.json
26506 bytes
0644
N4ST4R_ID | Naxtarrr