: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @return Indexable The indexable.
public function upgrade_indexable( $indexable ) {
if ( $this->version_manager->indexable_needs_upgrade( $indexable ) ) {
$indexable = $this->builder->build( $indexable );
* Resets the permalinks of the passed object type and subtype.
* @param string|null $type The type of the indexable. Can be null.
* @param string|null $subtype The subtype. Can be null.
* @return int|bool The number of permalinks changed if the query was succesful. False otherwise.
public function reset_permalink( $type = null, $subtype = null ) {
$query = $this->query()->set(
'permalink_hash' => null,
$query->where( 'object_type', $type );
if ( $type !== null && $subtype !== null ) {
$query->where( 'object_sub_type', $subtype );
return $query->update_many();
* Gets the total number of stored indexables.
* @return int The total number of stored indexables.
public function get_total_number_of_indexables() {
return $this->query()->count();