threadi / easy-settings-for-wordpress
Provides a settings wrapper for WordPress plugins and themes.
Package info
github.com/threadi/easy-settings-for-wordpress
pkg:composer/threadi/easy-settings-for-wordpress
Requires
- php: ^8.2
- threadi/easy-dialog-for-wordpress: *
Requires (Dev)
- automattic/vipwpcs: ^3.1
- dealerdirect/phpcodesniffer-composer-installer: ^1.2
- opis/json-schema: ^2.6
- php-stubs/wp-cli-stubs: ^2.11
- phpcompatibility/phpcompatibility-wp: ^2.1
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.2
- szepeviktor/phpstan-wordpress: ^2.0
- wp-coding-standards/wpcs: ^3.4.1
- wp-phpunit/wp-phpunit: ^6.3
- yoast/phpunit-polyfills: ^1.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-master
- 3.5.1
- 3.5.0
- 3.4.0
- 3.3.1
- 3.2.1
- 3.2.0
- 3.1.2
- 3.1.0
- 3.0.2
- 3.0.1
- 3.0.0
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.1-beta
- 2.0.0
- 2.0.0-beta
- 1.18.1
- 1.18.0
- 1.17.5
- 1.17.4
- 1.17.3
- v1.17.2
- 1.17.1
- 1.17.0
- 1.16.1
- 1.16.0
- 1.15.4
- 1.15.3
- 1.15.2
- 1.15.1
- 1.15.0
- 1.14.1
- 1.14.0
- 1.13.0
- 1.12.5
- 1.12.4
- 1.12.3
- 1.12.2
- 1.12.1
- 1.12.0
- 1.11.2
- 1.11.1
- 1.11.0
- 1.10.6
- 1.10.5
- 1.10.4
- 1.10.3
- 1.10.1
- 1.10.0
- 1.9.1
- 1.9.0
- 1.7.0
- 1.6.1
- 1.6.0
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.2
- 1.3.0
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.2
- 1.0.0
- dev-feature/addOwnTableForSettings
- dev-feature/usingPhpStrictForEachFile
- dev-feature/performanceOptimizations
- dev-feature/extendedSkills
- dev-feature/addedSkills
- dev-feature/addExamplePluginInDocs
- dev-fix/readingValueInOneMethod
- dev-feature/prepareRelease350
- dev-feature/addSoftReload
- dev-feature/supportReadOnlyForMoreFields
- dev-feature/addFieldClassesForDataViewFields
- dev-feature/prepareRelease340
- dev-feature/addDescriptionOnColorField
- dev-fix/doNotPopulateSettingsInRestIfFalse
- dev-feature/addColorPickerAsField
- dev-fix/oneSaving
- dev-fix/wrongReleaseNumber
- dev-feature/addOptionToSaveCollapsedInUserMeta
- dev-feature/prepareRelease322
- dev-feature/allowValueAsNestedField
- dev-fix/hideSaveIfSubTabsAreGiven
- dev-fix/missingValuesOnCheckboxes
- dev-feature/prepareRelease320
- dev-feature/optimizePackage
- dev-feature/extendMultiFieldSupport
- dev-feature/extendTableSupport
- dev-feature/supportWpListTableLinks
- dev-feature/styleTheLegendField
- dev-feature/supportGetSettingsErrorsInDataView
- dev-feature/hideHiddenSections
- dev-feature/prepareRelease312
- dev-feature/prepareRelease311
- dev-feature/sortMultiSelectInDataView
- dev-feature/addSectionClapp
- dev-feature/addLockForForms
- dev-fix/buttonFieldKey
- dev-fix/secureFieldsInOneMethod
- dev-fix/toLoadApiHelpers
- dev-fix/helperForMultiSelect
- dev-feature/addUpdateHandling
- dev-feature/updateDependencies
- dev-feature/optimizedTabsInDataViews
- dev-feature/removedUnusedEmbedding
- dev-feature/linkToComposerOrg
- dev-fix/phpUnitErrorRegardingNewMethodObjectCalling
- dev-fix/useNullForSomeRestApiFieldValues
- dev-fix/doNotUseSingletonForMethods
- dev-feature/prepareReleas301
- dev-feature/optimizeJsonHandling
- dev-feature/addDocumentationForPages
- dev-feature/optionToValidateTheJson
- dev-feature/useViewInJson
- dev-fix/handlingOfDependendRadioFields
- dev-feature/addJsonAsSource
- dev-feature/optimizeDataViews
- dev-feature/addViews
- dev-feature/addMethodsToSaveSettings
- dev-feature/optimizedStyling
- dev-feature/prepareRelease222
- dev-feature/changeInternalAjaxRequestNames
- dev-fix/wrongUrlUsageForEasyDialogScript
- dev-feature/removedBinDirectoryFromReleases
- dev-feature/addPhpUnitTests
- dev-feature/checkForCapabilityOnSettingsImport
- dev-feature/useLabelAttribute
- dev-feature/addedClassesForSubTabs
- dev-feature/optimizedDeletionOfSettings
- dev-fix/wrongPathForDialogLib
- dev-fix/removeInstalledVersions
- dev-fix/preventPotentialErrorOnLoadingOfLibVersion
- dev-feature/addSupportForArrayFields
- dev-fix/handlingOfValueOnValueField
- dev-fix/missingVersionNumberOnGitHubAction
- dev-fix/missingOutputOfSettingsLinkInPluginActions
- dev-feature/optimizedValueField
- dev-feature/prepareRelease200
- dev-fix/setFieldByArray
- dev-feature/addStylings
- dev-feature/optimizeHandling
- dev-fix/missingRestrictionForSingleFileField
- dev-feature/addReadOnlyOnMultiSelect
- dev-feature/addParagraphsForTextInfo
- dev-feature/addMediaRestriction
- dev-feature/triggerSaveCallbacksOnActivation
- dev-feature/dependentHandlingForRadioFields
- dev-fix/missingParenthesis
- dev-feature/allowEmptyTarget
- dev-fix/wrongReadonlyFieldNameForCheckboxes
- dev-feature/addSettingFieldClass
- dev-feature/preserveValuesForReadonlyFields
- dev-feature/addLabelOnTextFieldOption
- dev-feature/addFieldTable
- dev-feature/registerSettingsOnWpCLi
- dev-feature/removeVersionFromComposerJson
- dev-feature/registerSettingsAlsoForCron
- dev-feature/addRadioAndCheckboxFieldDescriptions
- dev-fix/wrongHookName
- dev-feature/addHooksForExportAndImport
- dev-feature/addTranslations
- dev-feature/changeAttributesForSaveCallback
- dev-feature/embedMediaLibrary
- dev-feature/extendButtonFieldForCustomAttributeArray
- dev-fix/doNotShowDoubleErrorOnOptionsPage
- dev-fix/subTagNavigation
- dev-feature/addSortableMultiSelectFields
- dev-fixed/easyDialogScriptDependency
- dev-fix/missingExectutionOfDirtyJs
- dev-feature/addDirtyJs
- dev-fix/missingRestNonce
- dev-fix/usageOfWideFatOnMultiselectFields
- dev-feature/addedWidefatOnFields
- dev-feature/addedReadOnlyOnSelect
- dev-fix/missingVersion1_10_2inComposer
- dev-feature/addErrorOutput
- dev-feature/gettingNextIndizes
- dev-feature/addSubTabss
- dev-feature/setPermalinkSlugListTitle
- dev-feature/addFileField
- dev-feature/addPermalinkSlugField
- dev-feature/addPageObject
- dev-feature/bumpVersion161
- dev-feature/addTabPageSetting
- dev-feature/addTextInfoField
- dev-feature/optimizeFunctionVisibility
- dev-feature/addCustomVarOnSettings
- dev-fix/missingVersionUpdate
- dev-feature/addTabPosition
- dev-fix/invalidHtmlForTextFields
- dev-feature/addedReadCallback
- dev-feature/addRadioAndCheckboxesField
- dev-feature/addMenuPosition
- dev-feature/changeSomeTexts
- dev-feature/addMinMaxStepOnNumberField
- dev-fix/missingSettingsLinkInPluginList
- dev-feature/addSettingsLinkInPluginList
- dev-feature/allowFunctionsAsSaveCallback
- dev-feature/optimizeHandlingOfTabs
- dev-feature/optimizeImportScript
- dev-feature/addedChangelog
- dev-fix/removeExternalDependencies
This package is auto-updated.
Last update: 2026-09-20 11:37:30 UTC
README
This composer package adds a simple wrapper for settings for WordPress plugins and themes. You no longer need to worry about inputting or outputting settings for your own implementation - leave that to this package. Use the WordPress-own get_option() to get the values of your settings.
Advantages
- Don't worry about the data type accuracy of your settings - WordPress doesn't (yet) take that into account, but this package does.
- Save time when configuring your plugin settings.
- Use settings that are interdependent.
- Have your AI generate a ready-made JSON file for your settings, which you can then simply drop in.
- And don't worry about updates or cleaning up after them - this package takes care of that for you.
Requirements
- A custom WordPress plugin or theme
- composer to install this package
Installation
Run this in your custom plugin or theme directory:
composer require threadi/easy-settings-for-wordpress
Remember to embed the composer autoloader in your plugin or theme:
require __DIR__ . '/vendor/autoload.php';
Usage
Note: Take a look at the demo plugin to see how this package can be used.
Quick-Start
This will give you a demo view that you can then further customize:
function your_custom_init_for_settings(): void {
$settings_object = new Settings( __FILE__ );
$settings_object->init();
}
add_action( 'init', 'your_custom_init_for_settings' );
Use it
Follow the documentation here.
Upgrade hints
for 3.0.0
- remove do_not_register() from TextInfo() and Value() fields
- remove set_type() from Checkbox() fields
- use add_data() instead of set_custom_attributes() for Import and Export buttons
- Do not use add_tab() on "Settings"-object.
For developers of this package
Check for WordPress Coding Standards
Initialize
composer install
Run
vendor/bin/phpcs .
Repair
vendor/bin/phpcbf .
Analyze with PHPStan
vendor/bin/phpstan analyse
Check for WordPress VIP Coding Standards
Hint: this check runs against the VIP-GO-platform, not our target for this package. Many warnings can be ignored.
Run
vendor/bin/phpcs --extensions=php --ignore=*/vendor/*,*/tests/*,*/node_modules/* --standard=WordPress-VIP-Go .