芝麻web文件管理V1.00
编辑当前文件:/home/elegucvf/public_html/src/actions/indexing/abstract-link-indexing-action.php
link_builder = $link_builder; $this->indexable_helper = $indexable_helper; $this->repository = $repository; $this->wpdb = $wpdb; } /** * Builds links for indexables which haven't had their links indexed yet. * * @return SEO_Links[] The created SEO links. */ public function index() { $objects = $this->get_objects(); $indexables = []; foreach ( $objects as $object ) { $indexable = $this->repository->find_by_id_and_type( $object->id, $object->type ); if ( $indexable ) { $this->link_builder->build( $indexable, $object->content ); $this->indexable_helper->save_indexable( $indexable ); $indexables[] = $indexable; } } if ( \count( $indexables ) > 0 ) { \delete_transient( static::UNINDEXED_COUNT_TRANSIENT ); \delete_transient( static::UNINDEXED_LIMITED_COUNT_TRANSIENT ); } return $indexables; } /** * In the case of term-links and post-links we want to use the total unindexed count, because using * the limited unindexed count actually leads to worse performance. * * @param int|bool $limit Unused. * * @return int The total number of unindexed links. */ public function get_limited_unindexed_count( $limit = false ) { return $this->get_total_unindexed(); } /** * Returns the number of texts that will be indexed in a single link indexing pass. * * @return int The limit. */ public function get_limit() { /** * Filter 'wpseo_link_indexing_limit' - Allow filtering the number of texts indexed during each link indexing pass. * * @param int $limit The maximum number of texts indexed. */ return \apply_filters( 'wpseo_link_indexing_limit', 5 ); } /** * Returns objects to be indexed. * * @return array Objects to be indexed, should be an array of objects with object_id, object_type and content. */ abstract protected function get_objects(); }