{"id":13810283,"url":"https://github.com/luizbills/better-wordpress-admin-api","last_synced_at":"2025-10-31T09:30:56.839Z","repository":{"id":72893001,"uuid":"119313301","full_name":"luizbills/better-wordpress-admin-api","owner":"luizbills","description":"A better way to build settings pages for your plugins/themes.","archived":false,"fork":false,"pushed_at":"2023-02-02T12:04:58.000Z","size":1919,"stargazers_count":79,"open_issues_count":4,"forks_count":9,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-29T14:14:49.759Z","etag":null,"topics":["wordpress","wordpress-admin","wordpress-admin-options","wordpress-admin-panel","wordpress-development","wordpress-php-library","wordpress-plugin-development","wordpress-theme-development"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luizbills.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-29T00:58:24.000Z","updated_at":"2024-10-03T16:03:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"93cc3006-9e3f-4bc0-8065-e1cc26909270","html_url":"https://github.com/luizbills/better-wordpress-admin-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizbills%2Fbetter-wordpress-admin-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizbills%2Fbetter-wordpress-admin-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizbills%2Fbetter-wordpress-admin-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizbills%2Fbetter-wordpress-admin-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luizbills","download_url":"https://codeload.github.com/luizbills/better-wordpress-admin-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238821460,"owners_count":19536223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wordpress","wordpress-admin","wordpress-admin-options","wordpress-admin-panel","wordpress-development","wordpress-php-library","wordpress-plugin-development","wordpress-theme-development"],"created_at":"2024-08-04T02:00:49.849Z","updated_at":"2025-10-31T09:30:56.440Z","avatar_url":"https://github.com/luizbills.png","language":"PHP","readme":"# Better WordPress Admin API\n\nA better way to build admin pages and options for you plugins/themes.\n\n## Installation\n\nClone or download this repo and put inside of your theme/plugin\n```\ncd wp-content/plugins/my-plugin\ngit clone https://github.com/luizbills/better-wordpress-admin-api/\n```\n\nInclude the `framework/init.php` file in your plugin or `functions.php`\n```php\ninclude_once 'path/to/better-wordpress-admin-api/framework/init.php';\n```\n\n## Usage\n\n```php\n// page details\n$page_args = [\n    'menu_name'         =\u003e 'Your Page',\n\n    // page slug\n    'id'                =\u003e 'your-page-id',\n\n    // automatically prefix all field ids\n    'prefix'    =\u003e 'your_prefix_',\n\n    // use \"parent\" parameter to create as a sub-menu\n    //'parent' =\u003e 'themes.php',\n\n    // more options...\n    //'icon'              =\u003e 'dashicons-admin-post',\n    //'position'          =\u003e 10,\n    //'capability'        =\u003e 'manage_options',\n];\n\n// create the page\n$your_page = wp_create_admin_page( $page_args );\n\n// add fields\n\n// field details\n$field_args = [\n    'type'      =\u003e 'text',\n    'id'        =\u003e 'your_text_field',\n    'label'     =\u003e 'Your Text field',\n    'desc'      =\u003e 'Your field description. **You can use markdown here**.',\n    'props'     =\u003e [\n        // optional tag properties\n        'placeholder' =\u003e 'type something...'\n    ],\n    //'default' =\u003e 'hello world',\n];\n\n// creates a text field\n$your_page-\u003eadd_field( $field_args );\n```\n\nGenerates:\n\n![basic usage example page](docs/assets/page-usage-example.png)\n\n```php\n// get your page instance\n$your_page = wp_get_page_instance( 'your-page-id' );\n\n// get a field value\n$your_text_value = $your_page-\u003eget_field_value( 'your_text_field' );\n\n// or with your prefix used above on $page_details (but it is not necessary)\n$your_text_value = $your_page-\u003eget_field_value( 'your_prefix_your_text_field' );\n\n\n// or just put all together\n$your_text_value = wp_get_page_field_value( 'your-page-id', 'your_text_field' );\n```\n\nMore at [examples](/examples) folder.\n\n### Avaliable field types\n\n- `text` (text-based inputs: text, email, url, ...)\n- `select`\n- `checkbox` (single checkbox)\n- `checkbox_multi` (multiple checkboxes)\n- `radio`\n- `hidden` (for **input[type=\"hidden\"]**)\n- `code` (code editor powered by [ace](https://ace.c9.io/))\n- `html` (useful to create your own field template)\n- `color` (color picker)\n- `content` (default WordPress TinyMCE editor)\n\n## Documentation\n\n- [Getting started](docs/getting-started.md)\n- [Field Types](docs/field-types.md)\n\n## Roadmap\n\n- [x] ~~Color picker~~\n- [x] ~~TinyMCE editor~~\n- [x] ~~Fields Documentation~~\n- [x] ~~Multiple checkboxes~~\n- [x] ~~Upload field~~\n- [ ] [Redesign](https://github.com/luizbills/better-wordpress-admin-api/issues/10)\n\n## Contributing\n\n- Found a bug? Report it on [GitHub Issues](https://github.com/luizbills/better-wordpress-admin-api/issues) and include a code sample. Please state which version of WordPress your are using.\n\n- Before submitting a Pull Request, if you are modifying some JavaScript or CSS file run: `npm run minify` (requires NodeJS)\n\nMore details:\n1. install NodeJS\n1. open your terminal in the root of this repository\n1. run `npm install`\n1. then run `npm run minify` to update the minified assets.\n\n\u003e Pro tip: add `define( 'WP_DEBUG_SCRIPT', true );` to your `wp-config.php` when you're coding some PR.\n\n## LICENSE\n\nGPL v2\n\n---\n\nMade with ❤ in Brazil\n","funding_links":[],"categories":["WordPress Plugins"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluizbills%2Fbetter-wordpress-admin-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluizbills%2Fbetter-wordpress-admin-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluizbills%2Fbetter-wordpress-admin-api/lists"}