wpseo_schema_article_types

wpseo_schema_article_types

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-seo.24.8.1

apply_filters('wpseo_schema_article_types') is found 4 times:

  • /inc/class-wpseo-meta.php line 359
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    if ( $article_helper->is_article_post_type( $post_type ) ) {
        $default_schema_article_type = WPSEO_Options::get( 'schema-article-type-' . $post_type );
     
        /** This filter is documented in inc/options/class-wpseo-option-titles.php */
        $allowed_article_types = apply_filters( 'wpseo_schema_article_types', Schema_Types::ARTICLE_TYPES );
     
        if ( ! array_key_exists( $default_schema_article_type, $allowed_article_types ) ) {
            $default_schema_article_type = WPSEO_Options::get_default( 'wpseo_titles', 'schema-article-type-' . $post_type );
        }
        $field_defs['schema_article_type']['default'] = $default_schema_article_type;
    }
  • /inc/class-wpseo-meta.php line 1044

    Warning: Undefined array key 1046 in /home/c6974294/public_html/wp-plugin-api.com/wp-content/themes/wordpress-hooks/functions.php on line 167

    Warning: Undefined array key 1047 in /home/c6974294/public_html/wp-plugin-api.com/wp-content/themes/wordpress-hooks/functions.php on line 167

    Warning: Undefined array key 1048 in /home/c6974294/public_html/wp-plugin-api.com/wp-content/themes/wordpress-hooks/functions.php on line 167

    Warning: Undefined array key 1049 in /home/c6974294/public_html/wp-plugin-api.com/wp-content/themes/wordpress-hooks/functions.php on line 167

    1040
    1041
    1042
    1043
    1044
    1045
    1046
         * @return void
         */
        public static function filter_schema_article_types() {
            /** This filter is documented in inc/options/class-wpseo-option-titles.php */
            self::$meta_fields['schema']['schema_article_type']['options'] = apply_filters( 'wpseo_schema_article_types', self::$meta_fields['schema']['schema_article_type']['options'] );
        }
    }
  • /inc/options/class-wpseo-option-titles.php line 663
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    * Make sure when you filter this to also filter `wpseo_schema_article_types_labels`.
     *
     * @param array $schema_article_types The available schema article types.
     */
    if ( array_key_exists( $dirty[ $key ], apply_filters( 'wpseo_schema_article_types', Schema_Types::ARTICLE_TYPES ) ) ) {
        $clean[ $key ] = $dirty[ $key ];
    }
    else {
        $defaults      = $this->get_defaults();
        $post_type     = str_replace( $switch_key, '', $key );
        $clean[ $key ] = $defaults[ $switch_key . $post_type ];
  • /src/context/meta-tags-context.php line 561
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
        $additional_type = $this->options->get( 'schema-article-type-' . $this->indexable->object_sub_type );
    }
     
    /** This filter is documented in inc/options/class-wpseo-option-titles.php */
    $allowed_article_types = \apply_filters( 'wpseo_schema_article_types', Schema_Types::ARTICLE_TYPES );
     
    if ( ! \array_key_exists( $additional_type, $allowed_article_types ) ) {
        $additional_type = $this->options->get_title_default( 'schema-article-type-' . $this->indexable->object_sub_type );
    }
     
    // If the additional type is a subtype of Article, we're fine, and we can bail here.