: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Class WPSEO_Taxonomy_Tab.
* Contains the basics for each class extending this one.
class WPSEO_Taxonomy_Fields {
* Returns the taxonomy fields.
* @param string $field_group The field group.
public function get( $field_group ) {
switch ( $field_group ) {
$fields = $this->get_content_fields();
$fields = $this->get_settings_fields();
$fields = $this->get_social_fields();
return $this->filter_hidden_fields( $fields );
* Returns array with the fields for the general tab.
protected function get_content_fields() {
'inclusive_language_score' => [
* Filter: 'wpseo_taxonomy_content_fields' - Adds the possibility to register additional content fields.
* @param array $additional_fields The additional fields.
$additional_fields = apply_filters( 'wpseo_taxonomy_content_fields', [] );
return array_merge( $fields, $additional_fields );
* Returns array with the fields for the settings tab.
protected function get_settings_fields() {
'hide' => ( WPSEO_Options::get( 'breadcrumbs-enable' ) !== true ),
* Returning the fields for the social media tab.
protected function get_social_fields() {
if ( WPSEO_Options::get( 'opengraph', false ) === true ) {
'opengraph-description' => [
'opengraph-image-id' => [
if ( WPSEO_Options::get( 'twitter', false ) === true ) {
'twitter-description' => [
* Filter the hidden fields.
* @param array $fields Array with the form fields that has will be filtered.
protected function filter_hidden_fields( array $fields ) {
foreach ( $fields as $field_name => $field_options ) {
if ( ! empty( $field_options['hide'] ) ) {
unset( $fields[ $field_name ] );