WOOF_Inflector

A utility class for working with English-language strings, offering operations like pluralization, singularization, underscoring, title-casing, and so on. Based on a component of the Akelos framework, which is a port of the Ruby on Rails Inflector.

List of Methods

Properties

  • camelize( String $word )String

    Returns given word as CamelCased.Converts a word like “send_email” to “SendEmail”.

  • classify( String $table_name )String

    Converts a table name to its class name according to Rails naming conventions. Converts “people” to “Person”.

  • humanize( String $word, String $uppercase = "" )String

    Returns a human-readable string from $word, by replacing underscores with a space, and by upper-casing the initial character by default.If you need to uppercase all the words pass ‘all’ as the second parameter.

  • ordinalize( Integer $number )String

    Converts number to its ordinal English form. .

  • pluralize( String $word )String

    Pluralizes English nouns.

  • singularize( String $word )String

    Singularizes English nouns.

  • tableize( String $class_name )String

    Converts a class name to its table name according to Rails naming conventions.

  • titleize( String $word, String $uppercase = "" )String

    Converts an underscored or CamelCase word into a English sentence, with each word having an uppercased first letter by default.The titleize function converts text like “WelcomePage”, “welcome_page” or “welcome page” to this “Welcome Page”.If second parameter is set to ‘first’ it will only capitalize the first character of the title.

  • underscore( String $word )String

    Convert any “CamelCased” or “ordinary Word” into an “underscored_word”. This can be really useful for creating friendly URLs.

  • variablize( String $word )String

    Same as camelize but first char is lowercase.Converts a word like “send_email” to “sendEmail”.

  • camelize( String $word )String

    Returns given word as CamelCased.Converts a word like “send_email” to “SendEmail”.

  • classify( String $table_name )String

    Converts a table name to its class name according to Rails naming conventions. Converts “people” to “Person”.

  • humanize( String $word, String $uppercase = "" )String

    Returns a human-readable string from $word, by replacing underscores with a space, and by upper-casing the initial character by default.If you need to uppercase all the words pass ‘all’ as the second parameter.

  • ordinalize( Integer $number )String

    Converts number to its ordinal English form. .

  • pluralize( String $word )String

    Pluralizes English nouns.

  • singularize( String $word )String

    Singularizes English nouns.

  • tableize( String $class_name )String

    Converts a class name to its table name according to Rails naming conventions.

  • titleize( String $word, String $uppercase = "" )String

    Converts an underscored or CamelCase word into a English sentence, with each word having an uppercased first letter by default.The titleize function converts text like “WelcomePage”, “welcome_page” or “welcome page” to this “Welcome Page”.If second parameter is set to ‘first’ it will only capitalize the first character of the title.

  • underscore( String $word )String

    Convert any “CamelCased” or “ordinary Word” into an “underscored_word”. This can be really useful for creating friendly URLs.

  • variablize( String $word )String

    Same as camelize but first char is lowercase.Converts a word like “send_email” to “sendEmail”.

Latest From the Blog

MasterPress 1.3.10 is now available

9th November 2023

MasterPress 1.3.10 is a feature and bugfix release. Workaround for fatal error introduced by changes to WordPress’ wpdb class in WordPress 6.4. Added actions to MPC files upload_field & WF image save_image functions.

Plugin Requirements

MasterPress requires a minimum of WordPress version 4.9, MySQL 5.6, and PHP version 5.6.20.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Three AM