Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/seo-by-rank-math/includes/class-defaults.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 + /**
3 + * Defaults by plugins.
4 + *
5 + * @since 1.0.40
6 + * @package RankMath
7 + * @subpackage RankMath\Core
8 + * @author Rank Math <support@rankmath.com>
9 + */
10 +
11 + namespace RankMath;
12 +
13 + use RankMath\Traits\Hooker;
14 +
15 + defined( 'ABSPATH' ) || exit;
16 +
17 + /**
18 + * Defaults class.
19 + */
20 + class Defaults {
21 +
22 + use Hooker;
23 +
24 + /**
25 + * Constructor method.
26 + */
27 + public function __construct() {
28 + $this->filter( 'rank_math/excluded_taxonomies', 'exclude_taxonomies' );
29 + $this->filter( 'rank_math/excluded_post_types', 'excluded_post_types' );
30 + }
31 +
32 + /**
33 + * Exclude taxonomies.
34 + *
35 + * @param array $taxonomies Excluded taxonomies.
36 + *
37 + * @return array
38 + */
39 + public function exclude_taxonomies( $taxonomies ) {
40 + if ( ! current_theme_supports( 'post-formats' ) ) {
41 + unset( $taxonomies['post_format'] );
42 + }
43 + unset( $taxonomies['product_shipping_class'] );
44 +
45 + return $taxonomies;
46 + }
47 +
48 + /**
49 + * Exclude post_types.
50 + *
51 + * @param array $post_types Excluded post_types.
52 + *
53 + * @return array
54 + */
55 + public function excluded_post_types( $post_types ) {
56 + if ( isset( $post_types['elementor_library'] ) ) {
57 + unset( $post_types['elementor_library'] );
58 + }
59 +
60 + return $post_types;
61 + }
62 + }
63 +