WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

getid3_id3v2::ParseID3v2GenreString() public WP 1.0

Это метод класса: getid3_id3v2{}

Хуков нет.

Возвращает

Массив.

Использование

$getid3_id3v2 = new getid3_id3v2();
$getid3_id3v2->ParseID3v2GenreString( $genrestring );
$genrestring(строка) (обязательный)

Код getid3_id3v2::ParseID3v2GenreString() WP 5.5.1

wp-includes/ID3/module.tag.id3v2.php
<?php
public function ParseID3v2GenreString($genrestring) {
	// Parse genres into arrays of genreName and genreID
	// ID3v2.2.x, ID3v2.3.x: '(21)' or '(4)Eurodisco' or '(51)(39)' or '(55)((I think...)'
	// ID3v2.4.x: '21' $00 'Eurodisco' $00
	$clean_genres = array();

	// hack-fixes for some badly-written ID3v2.3 taggers, while trying not to break correctly-written tags
	if (($this->getid3->info['id3v2']['majorversion'] == 3) && !preg_match('#[\x00]#', $genrestring)) {
		// note: MusicBrainz Picard incorrectly stores plaintext genres separated by "/" when writing in ID3v2.3 mode, hack-fix here:
		// replace / with NULL, then replace back the two ID3v1 genres that legitimately have "/" as part of the single genre name
		if (strpos($genrestring, '/') !== false) {
			$LegitimateSlashedGenreList = array(  // https://github.com/JamesHeinrich/getID3/issues/223
				'Pop/Funk',    // ID3v1 genre #62 - https://en.wikipedia.org/wiki/ID3#standard
				'Cut-up/DJ',   // Discogs - https://www.discogs.com/style/cut-up/dj
				'RnB/Swing',   // Discogs - https://www.discogs.com/style/rnb/swing
				'Funk / Soul', // Discogs (note spaces) - https://www.discogs.com/genre/funk+%2F+soul
			);
			$genrestring = str_replace('/', "\x00", $genrestring);
			foreach ($LegitimateSlashedGenreList as $SlashedGenre) {
				$genrestring = str_ireplace(str_replace('/', "\x00", $SlashedGenre), $SlashedGenre, $genrestring);
			}
		}

		// some other taggers separate multiple genres with semicolon, e.g. "Heavy Metal;Thrash Metal;Metal"
		if (strpos($genrestring, ';') !== false) {
			$genrestring = str_replace(';', "\x00", $genrestring);
		}
	}


	if (strpos($genrestring, "\x00") === false) {
		$genrestring = preg_replace('#\(([0-9]{1,3})\)#', '$1'."\x00", $genrestring);
	}

	$genre_elements = explode("\x00", $genrestring);
	foreach ($genre_elements as $element) {
		$element = trim($element);
		if ($element) {
			if (preg_match('#^[0-9]{1,3}$#', $element)) {
				$clean_genres[] = getid3_id3v1::LookupGenreName($element);
			} else {
				$clean_genres[] = str_replace('((', '(', $element);
			}
		}
	}
	return $clean_genres;
}