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.1.4 now available

MasterPress 1.1.4 is now available. This release contains an important compatibility fix for WordPress 4.5 to allow correct detection of the taxonomy term editing screen. Without this fix, any custom fields you have attached to custom taxonomies will not be shown at all in the editing form. Note also that MasterPress will still detect the edit screen correctly in… 

Plugin Requirements

MasterPress requires a minimum of WordPress version 3.4, MySQL 5, and PHP version 5.2.4.

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.

Traversal