: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Yoast\WP\SEO\Presenters;
use Yoast\WP\SEO\Presentations\Indexable_Presentation;
use Yoast\WP\SEO\Surfaces\Helpers_Surface;
* Abstract presenter class for indexable presentations.
abstract class Abstract_Indexable_Presenter extends Abstract_Presenter {
* The WPSEO Replace Vars object.
* @var WPSEO_Replace_Vars
* The indexable presentation.
* @var Indexable_Presentation
protected $key = 'NO KEY PROVIDED';
* Gets the raw value of a presentation.
* @return string|array The raw value.
abstract public function get();
* Transforms an indexable presenter's key to a json safe key string.
public function escape_key() {
if ( $this->key === 'NO KEY PROVIDED' ) {
return \str_replace( [ ':', ' ', '-' ], '_', $this->key );
* Returns the metafield's property key.
* @return string The property key.
public function get_key() {
* Replace replacement variables in a string.
* @param string $replacevar_string The string with replacement variables.
* @return string The string with replacement variables replaced.
protected function replace_vars( $replacevar_string ) {
return $this->replace_vars->replace( $replacevar_string, $this->presentation->source );