{"id":19084080,"url":"https://github.com/fmikl/wp-custom-fields","last_synced_at":"2026-02-08T12:12:21.729Z","repository":{"id":215241868,"uuid":"738447056","full_name":"FmiKL/wp-custom-fields","owner":"FmiKL","description":"This repository introduces a PHP class designed to simplify the creation of custom fields in the WordPress admin interface.","archived":false,"fork":false,"pushed_at":"2025-04-28T04:54:00.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-28T05:31:14.288Z","etag":null,"topics":["wordpress-developer","wordpress-development","wordpress-theme"],"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/FmiKL.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":"2024-01-03T08:49:34.000Z","updated_at":"2025-04-28T04:54:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"09bb4ec0-4277-46d5-8268-a5f9cc7e1c4e","html_url":"https://github.com/FmiKL/wp-custom-fields","commit_stats":null,"previous_names":["fmikl/wp-custom-fields"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/FmiKL/wp-custom-fields","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FmiKL%2Fwp-custom-fields","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FmiKL%2Fwp-custom-fields/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FmiKL%2Fwp-custom-fields/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FmiKL%2Fwp-custom-fields/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FmiKL","download_url":"https://codeload.github.com/FmiKL/wp-custom-fields/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FmiKL%2Fwp-custom-fields/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262850261,"owners_count":23374355,"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-developer","wordpress-development","wordpress-theme"],"created_at":"2024-11-09T02:50:01.005Z","updated_at":"2026-02-08T12:12:21.674Z","avatar_url":"https://github.com/FmiKL.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress Custom Fields\n\nThis repository introduces a PHP class designed to simplify the creation of custom fields in the WordPress admin interface. Ideal for theme and plugin developers, this class allows easy and complete integration of custom fields.\n\n## Features\n\n- **Ease of Custom Fields Creation**: Allows the easy creation of different types of custom fields in WordPress.\n- **Customizable Fields**: Supports various field types such as textarea, text, email, color, etc.\n- **Advanced Media Integration**: Specific keywords in placeholders trigger the opening of the WordPress media library.\n\n## Installation and Setup\n\n1. Clone or download this repository into your WordPress environment.\n2. Import the classes you need into your `functions.php` file or your plugin.\n\n```php\nrequire_once 'path/to/wp-custom-fields/class-abstract-meta.php';\nrequire_once 'path/to/wp-custom-fields/class-multiple-meta.php';\nrequire_once 'path/to/wp-custom-fields/class-repeat-meta.php';\nrequire_once 'path/to/wp-custom-fields/class-simple-meta.php';\n```\n\n## Usage Example\n\n### Create One or More Simple Fields\n\n```php\nfunction add_simple_description_meta() {\n    $meta = new Simple_Meta( 'Description', 'simple_description' );\n    $meta-\u003eset_enables( 'page', 3 );\n\n    $meta-\u003eadd_field(\n        'text',\n        'my_title',\n        array( 'placeholder' =\u003e 'Enter your title' )\n    );\n\n    $meta-\u003eadd_field(\n        'textarea',\n        'my_description',\n        array(\n            'placeholder' =\u003e 'Enter your description',\n            'rows'        =\u003e 7,\n        )\n    );\n}\nadd_action( 'admin_init', 'add_simple_description_meta' );\n```\n\n### Create One or More Multiple Fields\n\n```php\nfunction add_multipart_title_meta() {\n    $meta = new Multiple_Meta( 'Multipart title', 'multipart_title' );\n    $meta-\u003eset_enables( 5 );\n\n    $meta-\u003egroup_fields(\n        'my_title_',\n        $meta-\u003eadd_field(\n            'text',\n            'part_1',\n            array( 'placeholder' =\u003e 'Enter the part 1 of the title' )\n        ),\n        $meta-\u003eadd_field(\n            'text',\n            'part_2',\n            array( 'placeholder' =\u003e 'Enter the part 2 of the title' )\n        ),\n    );\n}\nadd_action( 'admin_init', 'add_multipart_title_meta' );\n```\n\n### Create One or More Repeat Fields\n\n```php\nfunction add_repeat_image_meta() {\n    $meta = new Repeat_Meta( 'Repeat image', 'repeat_image' );\n    $meta-\u003eset_enables( 'page', 'post' );\n\n    $meta-\u003egroup_fields(\n        'my_image_',\n        $meta-\u003eadd_field(\n            'url',\n            'url',\n            array( 'placeholder' =\u003e 'Select your image ~ 800px' )\n        ),\n    );\n\n    $meta-\u003egroup_fields(\n        'my_desc_image_',\n        $meta-\u003eadd_field(\n            'url',\n            'url',\n            array( 'placeholder' =\u003e 'Select your image' )\n        ),\n        $meta-\u003eadd_field(\n            'text',\n            'alt',\n            array( 'placeholder' =\u003e 'Enter your description' )\n        ),\n    );\n}\nadd_action( 'admin_init', 'add_repeat_image_meta' );\n```\n\n## Contributing\n\nContributions to improve this project are welcome, whether they be bug fixes, documentation improvements, or new feature suggestions.\n\n## License\n\nThis project is distributed under the [GNU General Public License version 2 (GPL v2)](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmikl%2Fwp-custom-fields","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmikl%2Fwp-custom-fields","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmikl%2Fwp-custom-fields/lists"}