PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.5
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 / exceptions / indexable / author-not-built-exception.php

author-not-built-exception.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.5, at src/exceptions/indexable/author-not-built-exception.php

52 lines 1.6 KB
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\Exceptions\Indexable;
4
5 /**
6 * For when an author indexable is not being built.
7 */
8 class Author_Not_Built_Exception extends Not_Built_Exception {
9
10 /**
11 * Named constructor for creating an Author_Not_Built_Exception
12 * when author archives are disabled for users without posts.
13 *
14 * @param string $user_id The user id.
15 *
16 * @return Author_Not_Built_Exception The exception.
17 */
18 public static function author_archives_are_not_indexed_for_users_without_posts( $user_id ) {
19 return new self(
20 'Indexable for author with id ' . $user_id . ' is not being built, since author archives are not indexed for users without posts.',
21 );
22 }
23
24 /**
25 * Named constructor for creating an Author_Not_Built_Exception
26 * when author archives are disabled.
27 *
28 * @param string $user_id The user id.
29 *
30 * @return Author_Not_Built_Exception The exception.
31 */
32 public static function author_archives_are_disabled( $user_id ) {
33 return new self(
34 'Indexable for author with id ' . $user_id . ' is not being built, since author archives are disabled.',
35 );
36 }
37
38 /**
39 * Named constructor for creating an Author_Not_Build_Exception
40 * when an author is excluded because of the `'wpseo_should_build_and_save_user_indexable'` filter.
41 *
42 * @param string $user_id The user id.
43 *
44 * @return Author_Not_Built_Exception The exception.
45 */
46 public static function author_not_built_because_of_filter( $user_id ) {
47 return new self(
48 'Indexable for author with id ' . $user_id . ' is not being built, since it is excluded because of the \'wpseo_should_build_and_save_user_indexable\' filter.',
49 );
50 }
51 }
52