, [ $this, 'update_hierarchy_and_permalink' ] ); if ( $indexable->object_type === 'term' ) { $child_indexables_for_term = $this->get_children_for_term( $indexable->object_id, $child_indexables ); \array_walk( $child_indexables_for_term, [ $this, 'update_hierarchy_and_permalink' ] ); } return true; } /** * Finds all child indexables for the given term. * * @param int $term_id Term to fetch the indexable for. * @param array $child_indexables The already known child indexables. * * @return array The list of additional child indexables for a given term. */ public function get_children_for_term( $term_id, array $child_indexables ) { // Finds object_ids (posts) for the term. $post_object_ids = $this->get_object_ids_for_term( $term_id, $child_indexables ); // Removes the objects that are already present in the children. $existing_post_indexables = \array_filter( $child_indexables, static function ( $indexable ) { return $indexable->object_type === 'post'; }, ); $existing_post_object_ids = \wp_list_pluck( $existing_post_indexables, 'object_id' ); $post_object_ids = \array_diff( $post_object_ids, $existing_post_object_ids ); // Finds the indexables for the fetched post_object_ids. $post_indexables = $this->indexable_repository->find_by_multiple_ids_and_type( $post_object_ids, 'post', false ); // Finds the indexables for the posts that are attached to the term. $post_indexable_ids = \wp_list_pluck( $post_indexables, 'id' ); $additional_indexable_ids = $this->indexable_hierarchy_repository->find_children_by_ancestor_ids( $post_indexable_ids ); // Makes sure we only have indexable id's that we haven't fetched before. $additional_indexable_ids = \array_diff( $additional_indexable_ids, $post_indexable_ids ); // Finds the additional indexables. $additional_indexables = $this->indexable_repository->find_by_ids( $additional_indexable_ids ); // Merges all fetched indexables. return \array_merge( $post_indexables, $additional_indexables ); } /** * Updates the indexable hierarchy and indexable permalink. * * @param Indexable $indexable The indexable to update the hierarchy and permalink for. * * @return void */ protected function update_hierarchy_and_permalink( $indexable ) { if ( \is_a( $indexable, Indexable::class ) ) { $this->indexable_hierarchy_builder->build( $indexable ); $indexable->permalink = $this->permalink_helper->get_permalink_for_indexable( $indexable ); $this->indexable_helper->save_indexable( $indexable ); } } /** * Retrieves the object id's for a term based on the term-post relationship. * * @param int $term_id The term to get the object id's for. * @param array $child_indexables The child indexables. * * @return array List with object ids for the term. */ protected function get_object_ids_for_term( $term_id, $child_indexables ) { global $wpdb; $filter_terms = static function ( $child ) { return $child->object_type === 'term'; }; $child_terms = \array_filter( $child_indexables, $filter_terms ); $child_object_ids = \array_merge( [ $term_id ], \wp_list_pluck( $child_terms, 'object_id' ) ); // Get the term-taxonomy id's for the term and its children. // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching $term_taxonomy_ids = $wpdb->get_col( $wpdb->prepare( 'SELECT term_taxonomy_id FROM %i WHERE term_id IN( ' . \implode( ', ', \array_fill( 0, ( \count( $child_object_ids ) ), '%s' ) ) . ' )', $wpdb->term_taxonomy, ...$child_object_ids, ), ); // In the case of faulty data having been saved the above query can return 0 results. if ( empty( $term_taxonomy_ids ) ) { return []; } // Get the (post) object id's that are attached to the term. // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching return $wpdb->get_col( $wpdb->prepare( 'SELECT DISTINCT object_id FROM %i WHERE term_taxonomy_id IN( ' . \implode( ', ', \array_fill( 0, \count( $term_taxonomy_ids ), '%s' ) ) . ' )', $wpdb->term_relationships, ...$term_taxonomy_ids, ), ); } } => 'Outdoor', 'POV' => 'POV', 'Pakistani' => 'Pakistani', 'Piercing' => 'Piercing', 'Pissing' => 'Pissing', 'Pregnant' => 'Pregnant', 'Public' => 'Public', 'Red+Head' => 'Red Head', 'Rimming' => 'Rimming', 'Secretary' => 'Secretary', 'Shaved' => 'Shaved', 'Shower' => 'Shower', 'Skinny' => 'Skinny', 'Small+Tits' => 'Small Tits', 'Smoking' => 'Smoking', 'Solo+Female' => 'Solo Female', 'Spandex' => 'Spandex', 'Spanking' => 'Spanking', 'Squirt' => 'Squirt', 'Sri+Lankan' => 'Sri Lankan', 'Step+Fantasy' => 'Step Fantasy', 'Stockings' => 'Stockings', 'Strapon' => 'Strapon', 'Striptease' => 'Striptease', 'Swallow+Cum' => 'Swallow Cum', 'Swingers' => 'Swingers', 'Tattoo' => 'Tattoo', 'Teacher' => 'Teacher', 'Teens+(18+)' => 'Teens (18+)', 'Threesome' => 'Threesome', 'Tight+Clothes' => 'Tight Clothes', 'Toys' => 'Toys', 'Twerk' => 'Twerk', 'Upskirt' => 'Upskirt', 'Voyeur' => 'Voyeur', 'Webcam' => 'Webcam', 'Wife' => 'Wife', ), ), 'options' => array( array( 'type' => 'h4', 'intitule' => '', 'desc' => 'General information', ), array( 'id' => 'campaign_id', 'type' => 'input', 'intitule' => 'Campaign Source ID', 'desc' => 'You can find it in Video > Campaigns. Click on Edit button and you will see the video campaign Source ID (eg. 1665168004)', 'required' => true, ), array( 'id' => 'affiliate_id', 'type' => 'input', 'intitule' => 'Your affiliate ID', 'desc' => 'You can find it in the TubeCorporate Dashboard page (eg. 10933)', 'required' => true, ), ), );
Fatal error: Uncaught Error: Class "Yoast\WP\SEO\Loggers\Logger" not found in /htdocs/x/wp-content/plugins/wordpress-seo/src/generated/container.php:6203 Stack trace: #0 /htdocs/x/wp-content/plugins/wordpress-seo/vendor_prefixed/symfony/dependency-injection/Container.php(212): Yoast\WP\SEO\Generated\Cached_Container->getIndexableRepositoryService() #1 /htdocs/x/wp-content/plugins/wordpress-seo/vendor_prefixed/symfony/dependency-injection/Container.php(195): YoastSEO_Vendor\Symfony\Component\DependencyInjection\Container->make('Yoast\\WP\\SEO\\Re...', 1) #2 /htdocs/x/wp-content/plugins/wordpress-seo/src/surfaces/classes-surface.php(38): YoastSEO_Vendor\Symfony\Component\DependencyInjection\Container->get('Yoast\\WP\\SEO\\Re...') #3 /htdocs/x/wp-content/plugins/wordpress-seo/inc/class-wpseo-admin-bar-menu.php(134): Yoast\WP\SEO\Surfaces\Classes_Surface->get('Yoast\\WP\\SEO\\Re...') #4 /htdocs/x/wp-content/plugins/wordpress-seo/inc/wpseo-non-ajax-functions.php(20): WPSEO_Admin_Bar_Menu->__construct() #5 /htdocs/x/wp-includes/class-wp-hook.php(324): wpseo_initialize_admin_bar('') #6 /htdocs/x/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #7 /htdocs/x/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #8 /htdocs/x/wp-settings.php(749): do_action('wp_loaded') #9 /htdocs/x/wp-config.php(98): require_once('/htdocs/x/wp-se...') #10 /htdocs/x/wp-load.php(50): require_once('/htdocs/x/wp-co...') #11 /htdocs/x/wp-blog-header.php(13): require_once('/htdocs/x/wp-lo...') #12 /htdocs/x/index.php(17): require('/htdocs/x/wp-bl...') #13 {main} thrown in /htdocs/x/wp-content/plugins/wordpress-seo/src/generated/container.php on line 6203