| @@ -871,8 +871,17 @@ | ||
| 871 | 871 | // intended set for the context — types missing from it were removed |
| 872 | 872 | // deliberately and must come off the page (#464). |
| 873 | 873 | $options['authoritative'] = true; |
| 874 | 874 | |
| 875 | + // A skipped entry was sent, so the user still wants it on the page; | |
| 876 | + // it only failed validation. Retiring it as "missing from the | |
| 877 | + // payload" took a live Organization down behind a success toast | |
| 878 | + // (#949) — leave whatever is deployed for it in place. | |
| 879 | + $options['retain_types'] = array_values(array_unique(array_merge( | |
| 880 | + wp_list_pluck($skipped_schemas, 'key'), | |
| 881 | + wp_list_pluck($skipped_schemas, 'type') | |
| 882 | + ))); | |
| 883 | + | |
| 875 | 884 | // Deploy schema markup with sanitized data |
| 876 | 885 | $deployment_results = $this->schema_manager->deploy_schema_markup( |
| 877 | 886 | $context_type, |
| 878 | 887 | $context_id, |
| @@ -889,8 +898,9 @@ | ||
| 889 | 898 | // Report what was skipped so the UI can say "3 deployed, 1 skipped" |
| 890 | 899 | // rather than silently dropping entries (#468). |
| 891 | 900 | if (!empty($skipped_schemas)) { |
| 892 | 901 | $response['skipped'] = $skipped_schemas; |
| 902 | + $response['partial'] = true; | |
| 893 | 903 | $response['message'] = sprintf( |
| 894 | 904 | /* translators: 1: number deployed, 2: number skipped. */ |
| 895 | 905 | __('Deployed %1$d schema(s); skipped %2$d that failed validation.', 'thinkrank'), |
| 896 | 906 | count($sanitized_schema_data), |
| @@ -1814,9 +1824,15 @@ | ||
| 1814 | 1824 | 'enum' => [ |
| 1815 | 1825 | 'Article', 'BlogPosting', 'TechnicalArticle', 'NewsArticle', |
| 1816 | 1826 | 'ScholarlyArticle', 'Report', 'Product', 'Organization', |
| 1817 | 1827 | 'LocalBusiness', 'Person', 'WebSite', 'FAQPage', |
| 1818 | - 'Event', 'HowTo', 'SoftwareApplication', 'Review', 'VideoObject' | |
| 1828 | + 'Event', 'HowTo', 'SoftwareApplication', 'Review', 'VideoObject', | |
| 1829 | + // The WebPage family (#624). This route is the one the | |
| 1830 | + // per-page selector calls, and it did not accept even | |
| 1831 | + // WebPage — so every entry in that dropdown was refused | |
| 1832 | + // with a 400 before any of the registries below were | |
| 1833 | + // consulted. Appended so existing ordering is unchanged. | |
| 1834 | + 'WebPage', 'AboutPage', 'ContactPage', 'ProfilePage' | |
| 1819 | 1835 | ] |
| 1820 | 1836 | ], |
| 1821 | 1837 | 'description' => 'Schema types to generate' |
| 1822 | 1838 | ], |
| @@ -1861,9 +1877,11 @@ | ||
| 1861 | 1877 | 'enum' => [ |
| 1862 | 1878 | 'Article', 'BlogPosting', 'TechnicalArticle', 'NewsArticle', |
| 1863 | 1879 | 'ScholarlyArticle', 'Report', 'Product', 'Organization', |
| 1864 | 1880 | 'LocalBusiness', 'Person', 'WebSite', 'WebPage', 'FAQPage', |
| 1865 | - 'SoftwareApplication', 'Event', 'Recipe', 'HowTo', 'Review', 'VideoObject' | |
| 1881 | + 'SoftwareApplication', 'Event', 'Recipe', 'HowTo', 'Review', 'VideoObject', | |
| 1882 | + // WebPage's subtypes, which validate exactly as it does (#624). | |
| 1883 | + 'AboutPage', 'ContactPage', 'ProfilePage' | |
| 1866 | 1884 | ], |
| 1867 | 1885 | 'description' => 'Schema type' |
| 1868 | 1886 | ], |
| 1869 | 1887 | 'options' => [ |
| @@ -1927,9 +1945,11 @@ | ||
| 1927 | 1945 | 'type' => 'string', |
| 1928 | 1946 | 'enum' => [ |
| 1929 | 1947 | 'Article', 'BlogPosting', 'Product', 'Organization', 'LocalBusiness', |
| 1930 | 1948 | 'Person', 'WebSite', 'WebPage', 'FAQPage', 'SoftwareApplication', |
| 1931 | - 'BreadcrumbList', 'Event', 'Recipe', 'HowTo', 'Review', 'VideoObject' | |
| 1949 | + 'BreadcrumbList', 'Event', 'Recipe', 'HowTo', 'Review', 'VideoObject', | |
| 1950 | + // WebPage's subtypes, which carry the same properties (#624). | |
| 1951 | + 'AboutPage', 'ContactPage', 'ProfilePage' | |
| 1932 | 1952 | ], |
| 1933 | 1953 | 'description' => 'Schema type' |
| 1934 | 1954 | ], |
| 1935 | 1955 | 'options' => [ |
| @@ -1959,9 +1979,11 @@ | ||
| 1959 | 1979 | 'type' => 'string', |
| 1960 | 1980 | 'enum' => [ |
| 1961 | 1981 | 'Article', 'BlogPosting', 'Product', 'Organization', 'LocalBusiness', |
| 1962 | 1982 | 'Person', 'WebSite', 'WebPage', 'FAQPage', 'SoftwareApplication', |
| 1963 | - 'BreadcrumbList', 'Event', 'Recipe', 'HowTo', 'Review', 'VideoObject' | |
| 1983 | + 'BreadcrumbList', 'Event', 'Recipe', 'HowTo', 'Review', 'VideoObject', | |
| 1984 | + // WebPage's subtypes, which carry the same properties (#624). | |
| 1985 | + 'AboutPage', 'ContactPage', 'ProfilePage' | |
| 1964 | 1986 | ], |
| 1965 | 1987 | 'description' => 'Schema type' |
| 1966 | 1988 | ] |
| 1967 | 1989 | ]; |