WP_CLI
Inflector::tableize
Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'.
Метод класса: Inflector{}
Хуков нет.
Возвращает
string. The tableized word.
Использование
$result = Inflector::tableize( $word );
- $word(строка) (обязательный)
- The word to tableize.
Код Inflector::tableize() Inflector::tableize WP-CLI 2.13.0-alpha
public static function tableize( $word ) {
return strtolower( preg_replace( '~(?<=\\w)([A-Z])~', '_$1', $word ) );
}