Function __global->create_robots_txt
Definitions
sources/robots_txt.php
- Create appropriate robots.txt file based on the default.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: bool
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $robots_txt | ?string | No | No | Null | N/A | N/A | New contents (null: default) |
| &$msg | string | Yes | No | Blank (empty string) | N/A | N/A | Message (returned by reference) |
| $overwrite | boolean | No | No | False | N/A | N/A | Overwrite it if it currently exists |
Returns
- Whether the file was written
- Type: boolean
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Create appropriate robots.txt file based on the default.
*
* @param ?string $robots_txt New contents (null: default)
* @param string $msg Message (returned by reference)
* @param boolean $overwrite Overwrite it if it currently exists
* @return boolean Whether the file was written
*/
function create_robots_txt(?string $robots_txt = null, string &$msg = '', bool $overwrite = false) : bool
* Create appropriate robots.txt file based on the default.
*
* @param ?string $robots_txt New contents (null: default)
* @param string $msg Message (returned by reference)
* @param boolean $overwrite Overwrite it if it currently exists
* @return boolean Whether the file was written
*/
function create_robots_txt(?string $robots_txt = null, string &$msg = '', bool $overwrite = false) : bool

