Skip to content

Create rules to sniff option name passed in *_option function #1

Description

@tfirdaus

In WordPress, the *_option functions let you choose a name for the option. This name can be anything of string or pattern. You can use uppercase or lowercase letters in any way you like. But sometimes, especially in large project or codebase with multiple team working on the project, we want to make sure that all the option names follow a certain pattern, like lowercase, uppercase, camelcase, snakecase, or match a specific rule.

For instance, you might want to make sure that option names with a prefix are written in snakecase. Here's an example:

  • get_option('syntatis_foo');
  • get_option('syntatisFoo');

The first one is good to go, but the second one doesn't follow the rule.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementA new feature or request.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions