Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wordpres.../src/reposito...
File: primary-term-repository.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Repositories;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\Lib\Model;
[4] Fix | Delete
use Yoast\WP\Lib\ORM;
[5] Fix | Delete
use Yoast\WP\SEO\Models\Primary_Term;
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Class Primary_Term_Repository.
[9] Fix | Delete
*/
[10] Fix | Delete
class Primary_Term_Repository {
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* Starts a query for this repository.
[14] Fix | Delete
*
[15] Fix | Delete
* @return ORM
[16] Fix | Delete
*/
[17] Fix | Delete
public function query() {
[18] Fix | Delete
return Model::of_type( 'Primary_Term' );
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* Retrieves a primary term by a post ID and taxonomy.
[23] Fix | Delete
*
[24] Fix | Delete
* @param int $post_id The post the indexable is based upon.
[25] Fix | Delete
* @param string $taxonomy The taxonomy the indexable belongs to.
[26] Fix | Delete
* @param bool $auto_create Optional. Creates an indexable if it does not exist yet.
[27] Fix | Delete
*
[28] Fix | Delete
* @return Primary_Term|null Instance of a primary term.
[29] Fix | Delete
*/
[30] Fix | Delete
public function find_by_post_id_and_taxonomy( $post_id, $taxonomy, $auto_create = true ) {
[31] Fix | Delete
/**
[32] Fix | Delete
* Instance of the primary term.
[33] Fix | Delete
*
[34] Fix | Delete
* @var Primary_Term $primary_term_indexable
[35] Fix | Delete
*/
[36] Fix | Delete
$primary_term_indexable = $this->query()
[37] Fix | Delete
->where( 'post_id', $post_id )
[38] Fix | Delete
->where( 'taxonomy', $taxonomy )
[39] Fix | Delete
->find_one();
[40] Fix | Delete
[41] Fix | Delete
if ( $auto_create && ! $primary_term_indexable ) {
[42] Fix | Delete
$primary_term_indexable = $this->query()->create();
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
return $primary_term_indexable;
[46] Fix | Delete
}
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function