Is the given name is use by a page?
If the multilang
option is used, it checks if the page name exists in any language. IF the language
option is used, it only checks that particular language (regardless of multilang
option).
Usage
// basic usage
$int = $pagesNames->pageNameExists(string $name);
// usage with all arguments
$int = $pagesNames->pageNameExists(string $name, array $options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
name | string | |
options (optional) | array |
|
Return value
int
Returns quantity of pages using name, or 0 if name not in use.
PagesNames methods and properties
API reference based on ProcessWire core version 3.0.236