Gravity Forms (WordPress-plugin): verschil tussen versies
(→WP-CLI) |
|||
Regel 1: | Regel 1: | ||
Sinds 2020 is ''Gravity Forms'' m'n standaard formulieren-plugin, op advies van een specialist. Ik denk dat ik 'm ok vind. De belangrijkste dingen gaan heel soepel. Waarschijnlijk zijn het de ''nag-screens'' om maar de betaalde versie te kopen, waar ik het meeste moeite mee heb. En dat het de complete backend-interface van WordPress overneemt. Verder is-ie prima. | Sinds 2020 is ''Gravity Forms'' m'n standaard formulieren-plugin, op advies van een specialist. Ik denk dat ik 'm ok vind. De belangrijkste dingen gaan heel soepel. Waarschijnlijk zijn het de ''nag-screens'' om maar de betaalde versie te kopen, waar ik het meeste moeite mee heb. En dat het de complete backend-interface van WordPress overneemt. Verder is-ie prima. | ||
− | == WP-CLI == | + | == Installatie WP-CLI-add-on == |
− | Standaard ondersteunt Gravity Forms niet de WordPress Command Line Interface. Daar bestaat een gratis add-on voor. | + | Standaard ondersteunt Gravity Forms niet de WordPress Command Line Interface. Daar bestaat een gratis add-on voor. Die moet je apart installeren: |
− | |||
− | |||
<pre> | <pre> | ||
Regel 18: | Regel 16: | ||
Plugin 'gravityformscli' activated. | Plugin 'gravityformscli' activated. | ||
Success: Installed 1 of 1 plugins. | Success: Installed 1 of 1 plugins. | ||
+ | </pre> | ||
+ | |||
+ | Activeren: | ||
+ | |||
+ | <code> | ||
+ | wp plugin install gravityformscli --activate | ||
+ | </code> | ||
+ | |||
+ | == wp gf == | ||
+ | |||
+ | $ wp help gf | ||
+ | |||
+ | NAME | ||
+ | |||
+ | wp gf | ||
+ | |||
+ | DESCRIPTION | ||
+ | |||
+ | Manage Gravity Forms. | ||
+ | |||
+ | SYNOPSIS | ||
+ | |||
+ | wp gf <command> | ||
+ | |||
+ | SUBCOMMANDS | ||
+ | |||
+ | check_update Checks for available updates for Gravity Forms or a Gravity Forms official add-on. | ||
+ | entry Manage Gravity Forms Entries. | ||
+ | field Manage Gravity Forms Form Fields. | ||
+ | form Manage Gravity Forms. | ||
+ | install Installs Gravity Forms or a Gravity Forms official add-on. | ||
+ | license Manage the Gravity Forms License Key. | ||
+ | notification Manage Gravity Forms Notifications. | ||
+ | setup Runs the setup for Gravity Forms or a Gravity Forms official add-on. | ||
+ | tool Misc Gravity Forms Tools. | ||
+ | update Updates Gravity Forms or a Gravity Forms official add-on. | ||
+ | version Returns the version of Gravity Forms. | ||
+ | |||
+ | |||
+ | |||
+ | GLOBAL PARAMETERS | ||
+ | |||
+ | --path=<path> | ||
+ | Path to the WordPress files. | ||
+ | |||
+ | --url=<url> | ||
+ | Pretend request came from given URL. In multisite, this argument is how the target site is specified. | ||
+ | |||
+ | --ssh=[<scheme>:][<user>@]<host|container>[:<port>][<path>] | ||
+ | Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", | ||
+ | "vagrant"). | ||
+ | |||
+ | --http=<http> | ||
+ | Perform operation against a remote WordPress installation over HTTP. | ||
+ | |||
+ | --user=<id|login|email> | ||
+ | Set the WordPress user. | ||
+ | |||
+ | --skip-plugins[=<plugins>] | ||
+ | Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded. | ||
+ | |||
+ | --skip-themes[=<themes>] | ||
+ | Skip loading all themes, or a comma-separated list of themes. | ||
+ | |||
+ | --skip-packages | ||
+ | Skip loading all installed packages. | ||
+ | |||
+ | --require=<path> | ||
+ | Load PHP file before running the command (may be used more than once). | ||
+ | |||
+ | --[no-]color | ||
+ | Whether to colorize the output. | ||
+ | |||
+ | --debug[=<group>] | ||
+ | Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and | ||
+ | help. | ||
+ | |||
+ | --prompt[=<assoc>] | ||
+ | Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values. | ||
+ | |||
+ | --quiet | ||
+ | Suppress informational messages. | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | <pre> | ||
+ | $ wp help gf | ||
+ | |||
+ | NAME | ||
+ | |||
+ | wp gf | ||
+ | |||
+ | DESCRIPTION | ||
+ | |||
+ | Manage Gravity Forms. | ||
+ | |||
+ | SYNOPSIS | ||
+ | |||
+ | wp gf <command> | ||
+ | |||
+ | SUBCOMMANDS | ||
+ | |||
+ | check_update Checks for available updates for Gravity Forms or a Gravity Forms | ||
+ | official add-on. | ||
+ | entry Manage Gravity Forms Entries. | ||
+ | field Manage Gravity Forms Form Fields. | ||
+ | form Manage Gravity Forms. | ||
+ | install Installs Gravity Forms or a Gravity Forms official add-on. | ||
+ | license Manage the Gravity Forms License Key. | ||
+ | notification Manage Gravity Forms Notifications. | ||
+ | setup Runs the setup for Gravity Forms or a Gravity Forms official add-on. | ||
+ | tool Misc Gravity Forms Tools. | ||
+ | update Updates Gravity Forms or a Gravity Forms official add-on. | ||
+ | version Returns the version of Gravity Forms. | ||
+ | </pre> | ||
+ | |||
+ | === wp gf check_update === | ||
+ | |||
+ | === wp gf entry === | ||
+ | |||
+ | <pre> | ||
+ | $ wp help gf entry | ||
+ | |||
+ | NAME | ||
+ | |||
+ | wp gf entry | ||
+ | |||
+ | DESCRIPTION | ||
+ | |||
+ | Manage Gravity Forms Entries. | ||
+ | |||
+ | SYNOPSIS | ||
+ | |||
+ | wp gf entry <command> | ||
+ | |||
+ | SUBCOMMANDS | ||
+ | |||
+ | create Creates a new entry from either a JSON string with the raw entry or from field-value pairs. | ||
+ | delete Deletes an entry. | ||
+ | duplicate Duplicates an entry | ||
+ | edit Launch system editor to edit the JSON representation of the Entry. | ||
+ | export Exports entries. | ||
+ | get Returns a JSON representation of an entry. | ||
+ | import Imports entries. | ||
+ | list Displays a list of entries. | ||
+ | notification Send Gravity Forms Notifications. | ||
+ | update Updates an entry. | ||
+ | </pre> | ||
+ | |||
+ | === wp gf entry delete === | ||
+ | |||
+ | <pre> | ||
+ | $ wp help gf entry delete | ||
+ | |||
+ | NAME | ||
+ | |||
+ | wp gf entry delete | ||
+ | |||
+ | DESCRIPTION | ||
− | + | Deletes an entry. | |
+ | SYNOPSIS | ||
− | + | wp gf entry delete <entry-id>... [--force] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
+ | |||
+ | Met de Boolean optie <code>--force</code> worden entries direct verwijderd, ipv. verplaatst te worden naar de prullenbak. | ||
+ | |||
+ | Voorbeelden: | ||
+ | |||
+ | <pre> | ||
+ | # Delete a form entry | ||
+ | ######################################## | ||
+ | # | ||
+ | # Delete - Don't move it to trash | ||
+ | # | ||
+ | wp gf entry list 1 --format="ids" | ||
+ | |||
+ | 1921 1920 1918 1909 1903 1898 1897 1896 1893 1889 1885 1884 1883 1882 1877 1876 1875 1867 1866 1863^C | ||
+ | |||
+ | $ wp gf entry delete --force 1921 | ||
+ | |||
+ | Success: Deleted entry 1921 | ||
+ | |||
+ | |||
+ | # Trying out wildcard * to delete all | ||
+ | ######################################## | ||
+ | # | ||
+ | # Some unexpected behaviour: | ||
+ | # | ||
+ | wp gf entry delete * | ||
+ | |||
+ | |||
+ | Error: Entry with id dvb not found | ||
+ | Error: Entry with id favicon.ico not found | ||
+ | Error: Entry with id help.txt not found | ||
+ | Error: Entry with id index.php not found | ||
+ | Error: Entry with id license.txt not found | ||
+ | Error: Entry with id list.txt not found | ||
+ | Error: Entry with id login.txt not found | ||
+ | Error: Entry with id malcare-waf.php not found | ||
+ | Error: Entry with id order-ids.txt not found | ||
+ | Error: Entry with id order_list.txt not found | ||
+ | Error: Entry with id readme.html not found | ||
+ | Error: Entry with id robots.txt not found | ||
+ | Error: Entry with id text2.txt not found | ||
+ | Error: Entry with id text.txt not found | ||
+ | Error: Entry with id wp not found | ||
+ | Error: Entry with id wp-activate.php not found | ||
+ | Error: Entry with id wp-admin not found | ||
+ | Error: Entry with id wp-blog-header.php not found | ||
+ | Error: Entry with id wp-comments-post.php not found | ||
+ | Error: Entry with id wp-config.php not found | ||
+ | Error: Entry with id wp-config-sample.php not found | ||
+ | Error: Entry with id wp-content not found | ||
+ | Error: Entry with id wp-cron.php not found | ||
+ | Error: Entry with id wp-includes not found | ||
+ | Error: Entry with id wp-links-opml.php not found | ||
+ | Error: Entry with id wp-load.php not found | ||
+ | Error: Entry with id wp-login.php not found | ||
+ | Error: Entry with id wp-mail.php not found | ||
+ | Error: Entry with id wp-salt.php not found | ||
+ | Error: Entry with id wp-settings.php not found | ||
+ | Error: Entry with id wp-signup.php not found | ||
+ | Error: Entry with id wp-trackback.php not found | ||
+ | Error: Entry with id xargs not found | ||
+ | Error: Entry with id xmlrpc.php not found | ||
+ | |||
+ | |||
+ | # "--all" to delete all? Nope | ||
+ | ######################################## | ||
+ | # | ||
+ | wp gf entry delete --all | ||
+ | |||
+ | usage: wp gf entry delete <entry-id>... [--force] | ||
+ | |||
+ | |||
+ | # No argument to delete all? Nope | ||
+ | ######################################## | ||
+ | # | ||
+ | wp gf entry delete | ||
+ | |||
+ | usage: wp gf entry delete <entry-id>... [--force] | ||
+ | |||
+ | |||
+ | # Delete all entries form 1-3 | ||
+ | ######################################## | ||
+ | # | ||
+ | wp gf entry delete --force $(wp gf entry list 1 --format="ids" --page_size=100000) | ||
+ | wp gf entry delete --force $(wp gf entry list 2 --format="ids" --page_size=100000) | ||
+ | wp gf entry delete --force $(wp gf entry list 3 --format="ids" --page_size=100000) | ||
+ | </pre> | ||
+ | |||
+ | === wp gf entry list === | ||
+ | |||
+ | <pre> | ||
+ | wp help gf entry list | ||
+ | |||
+ | NAME | ||
+ | |||
+ | wp gf entry list | ||
+ | |||
+ | DESCRIPTION | ||
+ | |||
+ | Displays a list of entries. | ||
+ | |||
+ | SYNOPSIS | ||
+ | |||
+ | wp gf entry list <form-id> [--status=<status>] [--format=<format>] [--page_size=<page_size>] [--offset=<offset>] | ||
+ | </pre> | ||
+ | |||
+ | '''--format''' | ||
+ | |||
+ | Mogelijke waardes: | ||
+ | |||
+ | * <code>table</code> | ||
+ | * <code>csv</code> | ||
+ | * <code>json</code> | ||
+ | * <code>count</code> | ||
+ | * <code>ids</code> - Deze optie vind je niet snel terug in de documentatie. | ||
+ | |||
+ | '''-page_size''' | ||
+ | |||
+ | Standaard worden er 20 entries weergegeven. Met de parameter <code>--page_size</code> kun je dit aanpassen. Ik heb dit getest op formulieren met bijna 900 entries, en dat ging prima. Er lijkt vooralsnog geen bovengrens te zijn. | ||
+ | |||
+ | Voorbeelden: | ||
+ | |||
+ | <pre> | ||
+ | # Returns number of entries for form 1 | ||
+ | ######################################## | ||
+ | # | ||
+ | wp gf entry list 1 --format="count" | ||
+ | |||
+ | |||
+ | # Return first 20 entry id's form 1 | ||
+ | ######################################## | ||
+ | # | ||
+ | # The option --format="ids" is hardly mentioned on their help page https://docs.gravityforms.com/managing-entries | ||
+ | # and completely not on the inline help, eventhough it's crucial for me to automatically delete entries | ||
+ | # | ||
+ | wp gf entry list 1 --format="ids" | ||
+ | |||
+ | |||
+ | # Return all entry id's form 1 | ||
+ | ######################################## | ||
+ | # | ||
+ | wp gf entry list 1 --format="ids" --page_size=100000 | ||
+ | </pre> | ||
+ | |||
+ | === wp gf field === | ||
+ | === wp gf form === | ||
+ | === wp gf form create === | ||
+ | === wp gf form delete === | ||
+ | === wp gf form edit === | ||
+ | === wp gf form export === | ||
+ | === wp gf form field === | ||
+ | === wp gf form form_list === | ||
+ | === wp gf form get === | ||
+ | === wp gf form import === | ||
+ | === wp gf form notification === | ||
+ | === wp gf form update === | ||
+ | |||
+ | === wp gf install === | ||
+ | |||
+ | === wp gf license === | ||
+ | |||
+ | === wp gf notification === | ||
+ | |||
+ | === wp gf setup === | ||
+ | |||
+ | === wp gf tool === | ||
+ | |||
+ | === wp gf update === | ||
+ | |||
+ | === wp gf version === | ||
== Zie ook == | == Zie ook == |
Versie van 27 sep 2021 17:07
Sinds 2020 is Gravity Forms m'n standaard formulieren-plugin, op advies van een specialist. Ik denk dat ik 'm ok vind. De belangrijkste dingen gaan heel soepel. Waarschijnlijk zijn het de nag-screens om maar de betaalde versie te kopen, waar ik het meeste moeite mee heb. En dat het de complete backend-interface van WordPress overneemt. Verder is-ie prima.
Installatie WP-CLI-add-on
Standaard ondersteunt Gravity Forms niet de WordPress Command Line Interface. Daar bestaat een gratis add-on voor. Die moet je apart installeren:
wp plugin install gravityformscli --activate Installing Gravity Forms CLI Add-On (1.4) Downloading installation package from https://downloads.wordpress.org/plugin/gravityformscli.1.4.zip... Unpacking the package... Installing the plugin... Plugin installed successfully. Activating 'gravityformscli'... Plugin 'gravityformscli' activated. Success: Installed 1 of 1 plugins.
Activeren:
wp plugin install gravityformscli --activate
wp gf
$ wp help gf
NAME
wp gf
DESCRIPTION
Manage Gravity Forms.
SYNOPSIS
wp gf <command>
SUBCOMMANDS
check_update Checks for available updates for Gravity Forms or a Gravity Forms official add-on. entry Manage Gravity Forms Entries. field Manage Gravity Forms Form Fields. form Manage Gravity Forms. install Installs Gravity Forms or a Gravity Forms official add-on. license Manage the Gravity Forms License Key. notification Manage Gravity Forms Notifications. setup Runs the setup for Gravity Forms or a Gravity Forms official add-on. tool Misc Gravity Forms Tools. update Updates Gravity Forms or a Gravity Forms official add-on. version Returns the version of Gravity Forms.
GLOBAL PARAMETERS
--path=<path> Path to the WordPress files.
--url=<url> Pretend request came from given URL. In multisite, this argument is how the target site is specified.
--ssh=[<scheme>:][<user>@]<host|container>[:<port>][<path>] Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "vagrant").
--http=<http> Perform operation against a remote WordPress installation over HTTP.
--user=<id|login|email> Set the WordPress user.
--skip-plugins[=<plugins>] Skip loading all plugins, or a comma-separated list of plugins. Note: mu-plugins are still loaded.
--skip-themes[=<themes>] Skip loading all themes, or a comma-separated list of themes.
--skip-packages Skip loading all installed packages.
--require=<path> Load PHP file before running the command (may be used more than once).
--[no-]color Whether to colorize the output.
--debug[=<group>] Show all PHP errors and add verbosity to WP-CLI output. Built-in groups include: bootstrap, commandfactory, and help.
--prompt[=<assoc>] Prompt the user to enter values for all command arguments, or a subset specified as comma-separated values.
--quiet Suppress informational messages.
$ wp help gf NAME wp gf DESCRIPTION Manage Gravity Forms. SYNOPSIS wp gf <command> SUBCOMMANDS check_update Checks for available updates for Gravity Forms or a Gravity Forms official add-on. entry Manage Gravity Forms Entries. field Manage Gravity Forms Form Fields. form Manage Gravity Forms. install Installs Gravity Forms or a Gravity Forms official add-on. license Manage the Gravity Forms License Key. notification Manage Gravity Forms Notifications. setup Runs the setup for Gravity Forms or a Gravity Forms official add-on. tool Misc Gravity Forms Tools. update Updates Gravity Forms or a Gravity Forms official add-on. version Returns the version of Gravity Forms.
wp gf check_update
wp gf entry
$ wp help gf entry NAME wp gf entry DESCRIPTION Manage Gravity Forms Entries. SYNOPSIS wp gf entry <command> SUBCOMMANDS create Creates a new entry from either a JSON string with the raw entry or from field-value pairs. delete Deletes an entry. duplicate Duplicates an entry edit Launch system editor to edit the JSON representation of the Entry. export Exports entries. get Returns a JSON representation of an entry. import Imports entries. list Displays a list of entries. notification Send Gravity Forms Notifications. update Updates an entry.
wp gf entry delete
$ wp help gf entry delete NAME wp gf entry delete DESCRIPTION Deletes an entry. SYNOPSIS wp gf entry delete <entry-id>... [--force]
Met de Boolean optie --force
worden entries direct verwijderd, ipv. verplaatst te worden naar de prullenbak.
Voorbeelden:
# Delete a form entry ######################################## # # Delete - Don't move it to trash # wp gf entry list 1 --format="ids" 1921 1920 1918 1909 1903 1898 1897 1896 1893 1889 1885 1884 1883 1882 1877 1876 1875 1867 1866 1863^C $ wp gf entry delete --force 1921 Success: Deleted entry 1921 # Trying out wildcard * to delete all ######################################## # # Some unexpected behaviour: # wp gf entry delete * Error: Entry with id dvb not found Error: Entry with id favicon.ico not found Error: Entry with id help.txt not found Error: Entry with id index.php not found Error: Entry with id license.txt not found Error: Entry with id list.txt not found Error: Entry with id login.txt not found Error: Entry with id malcare-waf.php not found Error: Entry with id order-ids.txt not found Error: Entry with id order_list.txt not found Error: Entry with id readme.html not found Error: Entry with id robots.txt not found Error: Entry with id text2.txt not found Error: Entry with id text.txt not found Error: Entry with id wp not found Error: Entry with id wp-activate.php not found Error: Entry with id wp-admin not found Error: Entry with id wp-blog-header.php not found Error: Entry with id wp-comments-post.php not found Error: Entry with id wp-config.php not found Error: Entry with id wp-config-sample.php not found Error: Entry with id wp-content not found Error: Entry with id wp-cron.php not found Error: Entry with id wp-includes not found Error: Entry with id wp-links-opml.php not found Error: Entry with id wp-load.php not found Error: Entry with id wp-login.php not found Error: Entry with id wp-mail.php not found Error: Entry with id wp-salt.php not found Error: Entry with id wp-settings.php not found Error: Entry with id wp-signup.php not found Error: Entry with id wp-trackback.php not found Error: Entry with id xargs not found Error: Entry with id xmlrpc.php not found # "--all" to delete all? Nope ######################################## # wp gf entry delete --all usage: wp gf entry delete <entry-id>... [--force] # No argument to delete all? Nope ######################################## # wp gf entry delete usage: wp gf entry delete <entry-id>... [--force] # Delete all entries form 1-3 ######################################## # wp gf entry delete --force $(wp gf entry list 1 --format="ids" --page_size=100000) wp gf entry delete --force $(wp gf entry list 2 --format="ids" --page_size=100000) wp gf entry delete --force $(wp gf entry list 3 --format="ids" --page_size=100000)
wp gf entry list
wp help gf entry list NAME wp gf entry list DESCRIPTION Displays a list of entries. SYNOPSIS wp gf entry list <form-id> [--status=<status>] [--format=<format>] [--page_size=<page_size>] [--offset=<offset>]
--format
Mogelijke waardes:
table
csv
json
count
ids
- Deze optie vind je niet snel terug in de documentatie.
-page_size
Standaard worden er 20 entries weergegeven. Met de parameter --page_size
kun je dit aanpassen. Ik heb dit getest op formulieren met bijna 900 entries, en dat ging prima. Er lijkt vooralsnog geen bovengrens te zijn.
Voorbeelden:
# Returns number of entries for form 1 ######################################## # wp gf entry list 1 --format="count" # Return first 20 entry id's form 1 ######################################## # # The option --format="ids" is hardly mentioned on their help page https://docs.gravityforms.com/managing-entries # and completely not on the inline help, eventhough it's crucial for me to automatically delete entries # wp gf entry list 1 --format="ids" # Return all entry id's form 1 ######################################## # wp gf entry list 1 --format="ids" --page_size=100000
wp gf field
wp gf form
wp gf form create
wp gf form delete
wp gf form edit
wp gf form export
wp gf form field
wp gf form form_list
wp gf form get
wp gf form import
wp gf form notification
wp gf form update
wp gf install
wp gf license
wp gf notification
wp gf setup
wp gf tool
wp gf update
wp gf version
Zie ook
Bronnen
- https://docs.gravityforms.com/category/add-ons-gravity-forms/ - Een indrukwekkende lijst van add-ons
- https://docs.gravityforms.com/category/add-ons-gravity-forms/wp-cli-add-on/ - WP-CLI Add-on