PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.0
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.0
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / values / robots / directive.php

directive.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.0, at src/values/robots/directive.php

46 lines 661 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Values\Robots;
4
5 /**
6 * Class Directive
7 */
8 class Directive {
9
10 /**
11 * Paths list.
12 *
13 * @var array All paths affected by this directive.
14 */
15 private $paths;
16
17 /**
18 * Sets up the path array
19 */
20 public function __construct() {
21 $this->paths = [];
22 }
23
24 /**
25 * Adds a path to the directive path list.
26 *
27 * @param string $path A path to add in the path list.
28 *
29 * @return void
30 */
31 public function add_path( $path ) {
32 if ( ! \in_array( $path, $this->paths, true ) ) {
33 $this->paths[] = $path;
34 }
35 }
36
37 /**
38 * Returns all paths.
39 *
40 * @return array
41 */
42 public function get_paths() {
43 return $this->paths;
44 }
45 }
46