Yoast\WP\SEO\Helpers
Social_Profiles_Helper::get_non_valid_url_array
Checks if urls in an array are not valid and return the name of the setting if one of them is not, including the non-valid url's index in the array
Метод класса: Social_Profiles_Helper{}
Хуков нет.
Возвращает
Массив. An array with the settings that the non-valid urls are about to update, suffixed with a dash-separated index of the positions of those settings, eg. other_social_urls-2.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_non_valid_url_array( $urls, $urls_setting );
- $urls(массив) (обязательный)
- The urls to be validated.
- $urls_setting(строка) (обязательный)
- The name of the setting to be updated with the urls.
Код Social_Profiles_Helper::get_non_valid_url_array() Social Profiles Helper::get non valid url array Yoast 27.8
protected function get_non_valid_url_array( $urls, $urls_setting ) {
$non_valid_url_array = [];
foreach ( $urls as $key => $url ) {
if ( ! $this->options_helper->is_social_url_valid( $url ) ) {
$non_valid_url_array[] = $urls_setting . '-' . $key;
}
}
return $non_valid_url_array;
}