{"id":19894585,"url":"https://github.com/amarkal/amarkal-taxonomy","last_synced_at":"2025-05-02T20:30:40.624Z","repository":{"id":62488700,"uuid":"85735598","full_name":"amarkal/amarkal-taxonomy","owner":"amarkal","description":"A set of utility functions for taxonomies in WordPress","archived":false,"fork":false,"pushed_at":"2017-12-25T21:20:45.000Z","size":28,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T05:11:12.442Z","etag":null,"topics":["amarkal","wordpress","wordpress-framework"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amarkal.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}},"created_at":"2017-03-21T17:54:20.000Z","updated_at":"2022-09-26T01:46:40.000Z","dependencies_parsed_at":"2022-11-02T11:15:27.420Z","dependency_job_id":null,"html_url":"https://github.com/amarkal/amarkal-taxonomy","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/amarkal%2Famarkal-taxonomy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amarkal%2Famarkal-taxonomy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amarkal%2Famarkal-taxonomy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amarkal%2Famarkal-taxonomy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amarkal","download_url":"https://codeload.github.com/amarkal/amarkal-taxonomy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252103909,"owners_count":21695386,"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":["amarkal","wordpress","wordpress-framework"],"created_at":"2024-11-12T18:33:55.669Z","updated_at":"2025-05-02T20:30:40.284Z","avatar_url":"https://github.com/amarkal.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# amarkal-taxonomy [![Build Status](https://scrutinizer-ci.com/g/amarkal/amarkal-taxonomy/badges/build.png?b=master)](https://scrutinizer-ci.com/g/amarkal/amarkal-taxonomy/build-status/master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/amarkal/amarkal-taxonomy/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/amarkal/amarkal-taxonomy/?branch=master) [![License](https://img.shields.io/badge/license-GPL--3.0%2B-red.svg)](https://raw.githubusercontent.com/amarkal/amarkal-taxonomy/master/LICENSE)\nA set of utility functions for taxonomies in WordPress.\n\n**Tested up to:** WordPress 4.7  \n**Dependencies**: *[amarkal-ui](https://github.com/amarkal/amarkal-ui)*\n\n![amarkal-taxonomy](https://askupasoftware.com/wp-content/uploads/2015/04/amarkal-taxonomy.png)\n\n## Overview\n**amarkal-taxonomy** lets you add custom fields to taxonomies in WordPress, and optionally add columns to the taxonomy terms table. More utility functions will be added in the future.\n\n## Installation\n\n### Via Composer\n\nIf you are using the command line:  \n```\n$ composer require askupa-software/amarkal-taxonomy:dev-master\n```\n\nOr simply add the following to your `composer.json` file:\n```javascript\n\"require\": {\n    \"askupa-software/amarkal-taxonomy\": \"dev-master\"\n}\n```\nAnd run the command \n```\n$ composer install\n```\n\nThis will install the package in the directory `vendors/askupa-software/amarkal-taxonomy`.\nNow all you need to do is include the composer autoloader.\n\n```php\nrequire_once 'path/to/vendor/autoload.php';\n```\n\n### Manually\n\nDownload [amarkal-ui](https://github.com/amarkal/amarkal-ui/archive/master.zip) and [amarkal-taxonomy](https://github.com/amarkal/amarkal-taxonomy/archive/master.zip) from github and include them in your project.\n\n```php\nrequire_once 'path/to/amarkal-ui/bootstrap.php';\nrequire_once 'path/to/amarkal-taxonomy/bootstrap.php';\n```\n\n## Reference\n\n### amarkal_taxonomy_add_field\n*Add a field to the add \u0026 edit forms of a given taxonomy.*\n```php\namarkal_taxonomy_add_field( $taxonomy_name, $field_type, $field_props )\n```\nThis function can be used to add fields to the 'add term' and 'edit term' taxonomy forms. See [amarkal-ui](https://github.com/amarkal/amarkal-ui/) for supported field types, or register your own field type using `amarkal_ui_register_component`.\n\n**Parameters**  \n* `$taxonomy_name` (*String*) Specifies the taxonomy name, e.g. 'category'.\n* `$field_name` (*String*)  Specifies the name/id of the field.\n* `$field_props` (*Array*)  Specifies the UI component's properties. This array should have the original UI component properties as specified in [amarkal-ui](https://github.com/amarkal/amarkal-ui), as well as the following:\n  * `type` (*String*) Specifies the type of the field to add. One of the core `amarkal-ui` components or a registered custom component.\n  * `title` (*String*) Specifies the form title for this field.\n  * `description` (*String*) Specifies a short description that will be printed below the field.\n  * `table` (*Array*) An associative array with the following arguments:\n    * `show` (*Boolean*) Specifies whether to add a column for this field in the taxonomy terms table.\n    * `sortable` (*Boolean*) Specifies whether to make the column for this field sortable.\n\n**Example Usage**\n```php\n// Add a text field to the 'category' taxonomy 'add' \u0026 'edit' forms:\namarkal_taxonomy_add_field('category', 'cat_icon', array(\n    'type'        =\u003e 'text',\n    'title'       =\u003e 'Icon',\n    'description' =\u003e 'The category\\'s icon',\n    'table'       =\u003e array(\n        'show'      =\u003e true,  // Add a column to the terms table\n        'sortable'  =\u003e true   // Make that column sortable\n    )\n));\n\n// Then you can retrieve the data using:\n$icon = get_term_meta( $term_id, 'cat_icon', true );\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famarkal%2Famarkal-taxonomy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famarkal%2Famarkal-taxonomy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famarkal%2Famarkal-taxonomy/lists"}