Skip to content

Commit c3f9195

Browse files
Merge pull request wp-cli#197 from wp-cli/3271-get-config
Mark `WP_CLI::get_config()` as a public internal API
2 parents 47feb4d + e3f5502 commit c3f9195

6 files changed

Lines changed: 78 additions & 0 deletions

File tree

_includes/internal-api-list.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575
<li><strong><a href="/docs/internal-api/wp-cli-read-value/">WP_CLI::read_value()</a></strong> - Read a value, from various formats.</li>
7676

7777

78+
<li><strong><a href="/docs/internal-api/wp-cli-get-config/">WP_CLI::get_config()</a></strong> - Get values of global configuration parameters.</li>
79+
80+
7881
</ul>
7982

8083

docs/internal-api/wp-cli-confirm/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ If 'y' is provided to the question, the script execution continues. If
5656
<li><strong><a href="/docs/internal-api/wp-cli-read-value/">WP_CLI::read_value()</a></strong> - Read a value, from various formats.</li>
5757

5858

59+
<li><strong><a href="/docs/internal-api/wp-cli-get-config/">WP_CLI::get_config()</a></strong> - Get values of global configuration parameters.</li>
60+
61+
5962

6063
</ul>
6164

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
layout: default
3+
title: WP_CLI::get_config()
4+
description: "Get values of global configuration parameters."
5+
---
6+
7+
<a href="/docs/">Docs</a> &raquo; <a href="/docs/internal-api/">Internal API</a> &raquo; Input
8+
9+
## WP_CLI::get_config()
10+
11+
Get values of global configuration parameters.
12+
13+
***
14+
15+
### Usage
16+
17+
WP_CLI::get_config( $key = null )
18+
19+
<div>
20+
<strong>$key</strong> (string) Get value for a specific global configuration parameter.<br />
21+
<strong>@return</strong> (mixed) <br />
22+
</div>
23+
24+
25+
***
26+
27+
### Notes
28+
29+
Provides access to `--path=<path>`, `--url=<url>`, and other values of
30+
the [global configuration parameters](https://wp-cli.org/config/).
31+
32+
33+
WP_CLI::log( 'The --url=<url> value is: ' . WP_CLI::get_config( 'url' ) );
34+
35+
36+
37+
*Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.*
38+
39+
40+
***
41+
42+
### Related
43+
44+
<ul>
45+
46+
47+
48+
<li><strong><a href="/docs/internal-api/wp-cli-utils-launch-editor-for-input/">WP_CLI\Utils\launch_editor_for_input()</a></strong> - Launch system's $EDITOR for the user to edit some text.</li>
49+
50+
51+
<li><strong><a href="/docs/internal-api/wp-cli-utils-get-flag-value/">WP_CLI\Utils\get_flag_value()</a></strong> - Return the flag value or, if it's not set, the $default value.</li>
52+
53+
54+
<li><strong><a href="/docs/internal-api/wp-cli-confirm/">WP_CLI::confirm()</a></strong> - Ask for confirmation before running a destructive operation.</li>
55+
56+
57+
<li><strong><a href="/docs/internal-api/wp-cli-read-value/">WP_CLI::read_value()</a></strong> - Read a value, from various formats.</li>
58+
59+
60+
61+
</ul>
62+
63+

docs/internal-api/wp-cli-read-value/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ Read a value, from various formats.
4242
<li><strong><a href="/docs/internal-api/wp-cli-confirm/">WP_CLI::confirm()</a></strong> - Ask for confirmation before running a destructive operation.</li>
4343

4444

45+
<li><strong><a href="/docs/internal-api/wp-cli-get-config/">WP_CLI::get_config()</a></strong> - Get values of global configuration parameters.</li>
46+
47+
4548

4649
</ul>
4750

docs/internal-api/wp-cli-utils-get-flag-value/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ function provides a safer alternative to using
5353
<li><strong><a href="/docs/internal-api/wp-cli-read-value/">WP_CLI::read_value()</a></strong> - Read a value, from various formats.</li>
5454

5555

56+
<li><strong><a href="/docs/internal-api/wp-cli-get-config/">WP_CLI::get_config()</a></strong> - Get values of global configuration parameters.</li>
57+
58+
5659

5760
</ul>
5861

docs/internal-api/wp-cli-utils-launch-editor-for-input/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ Launch system's $EDITOR for the user to edit some text.
4242
<li><strong><a href="/docs/internal-api/wp-cli-read-value/">WP_CLI::read_value()</a></strong> - Read a value, from various formats.</li>
4343

4444

45+
<li><strong><a href="/docs/internal-api/wp-cli-get-config/">WP_CLI::get_config()</a></strong> - Get values of global configuration parameters.</li>
46+
47+
4548

4649
</ul>
4750

0 commit comments

Comments
 (0)