Download the PHP package kuuak/wordpress-setting-fields without Composer
On this page you can find all versions of the php package kuuak/wordpress-setting-fields. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kuuak/wordpress-setting-fields
More information about kuuak/wordpress-setting-fields
Files in kuuak/wordpress-setting-fields
Package wordpress-setting-fields
Short Description WordPress setting field functions to output different type of fields
License MIT
Informations about the package wordpress-setting-fields
wordpress-setting-fields
WordPress setting field functions to output different type of fields.
Field types
Text
Name: Kuuak\WordPressSettingFields\Fields::text
Arguments: | name | type | mandatory | Description |
---|---|---|---|---|
type | string | false | Optional. HTML input type attribute or textarea . Default: text |
|
id | string | false | Optional. Id attribute for the input. Default. the name argument | |
name | string | true | Name of the input | |
value | string | false | Optional. Current value of the input | |
required | boolean | false | Optional. Whether the input is required. Default false | |
placeholder | string | false | Optional. | |
attrs | array | false | Optional. Extra html atrributes for the input. Attributes' name are the keys of the associative array. | |
help | string | false | Optional. Help / description |
Example of usage
Dropdown
Name: Kuuak\WordPressSettingFields\Fields::dropdown
Arguments: | name | type | mandatory | Description |
---|---|---|---|---|
id | string | false | Optional. Id attribute for the dropdown. Default. the name argument | |
name | string | true | Name of the dropdown | |
multiple | boolean | false | Optional. Define if multiple options can be selected in the list. | |
selected | string | string[] | false | Optional. Selected value or values |
required | boolean | false | Optional. Whether the dropdown is required. Default false | |
show_option_all | string | false | Optional. Text to display for showing all items. Default empty. | |
options | Array | true | Array of dropdown items. Items with keys value & title . |
|
placeholder | string | false | ||
help | string | false | Optional. Help / description. Default empty. | |
echo | boolean | false | Optional. Whether to echo or return the generated markup. Default true. |
Example of usage
Switch (toggle)
Name: Kuuak\WordPressSettingFields\Fields::switch
Arguments: | name | type | mandatory | Description |
---|---|---|---|---|
id | string | false | Optional. Id attribute for the input. Default. the name argument | |
name | string | true | Name of the input | |
checked | boolean | true | ||
help | string | false | Optional. Help / description | |
nice_ui | boolean | false | Optional. Display as a nicer ui. Default true. |
Example of usage
Post type (dropdown)
Name: Kuuak\WordPressSettingFields\Fields::post_type_dropdown
Arguments:
name | type | mandatory | Description | |||
---|---|---|---|---|---|---|
query_args | array | false | WP_Query arguments. _See WP_Query::_construct() for accepted arguments | |||
name | string | true | Name of the dropdown | |||
selected | int | string | int[] | string[] | false | Optional. Value of the option that should be selected. Default 0. |
required | boolean | false | Optional. Whether the dropdown is required. Default false | |||
placeholder | string | false | Optional. | |||
show_option_all | string | false | Optional. Option all label for the Multiple version. Default All |
|||
help | string | false | Optional. Help / description | |||
echo | boolean | false | Optional. Either to print the dropdown or not. Default true. | |||
nice_ui | boolean | false | Optional. Display as a nicer ui. Default true. | |||
attrs | array | false | Optional. Extra html atrributes for the select input. Attributes' name are the keys of the associative array. |
Example of usage
Taxonomy (dropdown)
Name: Kuuak\WordPressSettingFields\Fields::taxonomy_dropdown
Arguments:
_See WP_Term_Query::_construct() for information on additional accepted arguments
name | type | mandatory | Description | |||
---|---|---|---|---|---|---|
name | string | true | Name of the dropdown | |||
taxonomy | string | true | Name of the taxonomy to | |||
selected | int | string | int[] | string[] | false | Optional. Value of the option that should be selected. Default 0. |
required | boolean | false | Optional. Whether the dropdown is required. Default false | |||
show_option_all | string | false | Optional. Option all label for the Multiple version. Default All |
|||
hide_empty | string | false | Optional. Option all label | |||
help | string | false | Optional. Help / description | |||
echo | boolean | false | Optional. Either to print the dropdown or not. Default true. |
Example of usage
Pages (dropdown)
Name: Kuuak\WordPressSettingFields\Fields::pages_dropdown
Arguments:
_See getpages() for additional arguments
name | type | mandatory | Description | |
---|---|---|---|---|
name | string | true | Name of the dropdown | |
selected | int | string | false | Optional. Value of the option that should be selected. Default 0. |
required | boolean | false | Optional. Whether the dropdown is required. Default false | |
help | string | false | Optional. Help / description. Default empty | |
echo | boolean | false | Optional. Either to print the dropdown or not. Default true. |
Example of usage
Button
Name: Kuuak\WordPressSettingFields\Fields::button
Arguments:
name | type | mandatory | Description |
---|---|---|---|
id | string | false | Optional. Id attribute for the button. Default. the name argument |
name | string | true | Name of the button |
label | string | true | Label of the button |
variant | string | false | Optional. Variant of the button. primary or secondary . Default secondary |
action | array | false | Action data |
action.name | string | true | Action name |
action.value | string | true | Action value |
wrapper_attrs | array | false | Optional. Extra html atrributes for the wrapper. Attributes' name are the keys of the associative array. |
help | string | false | Optional. Help / description. Default empty |
Example of usage
Changelog
[1.1.2] - 2023-07-14
- Fix post_type_dropdown selected
[1.1.1] - 2023-07-14
- Fix dropdowns placeholder
- Improve post_type_dropdown props to include attrs
[1.1.0] - 2023-07-13
- Add post_type_dropdown field #4
- Add switch nice ui styles #2
- Fix dropdown selected prop #5
- Fix readme descriptions #1
- Fix Select2 not inited for multi-dropdown
[1.0.0] - 2023-06-15
- Initial release