{"id":29150121,"url":"https://github.com/humanmade/wp-flags","last_synced_at":"2025-06-30T23:09:35.847Z","repository":{"id":46134254,"uuid":"175835286","full_name":"humanmade/wp-flags","owner":"humanmade","description":"Flags: WordPress admin-controlled user-based feature flags","archived":false,"fork":false,"pushed_at":"2021-11-11T14:31:30.000Z","size":94,"stargazers_count":34,"open_issues_count":6,"forks_count":3,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-06-30T16:14:54.827Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/humanmade.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":"2019-03-15T14:27:20.000Z","updated_at":"2023-09-27T05:41:26.000Z","dependencies_parsed_at":"2022-08-26T16:10:47.111Z","dependency_job_id":null,"html_url":"https://github.com/humanmade/wp-flags","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/humanmade/wp-flags","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fwp-flags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fwp-flags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fwp-flags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fwp-flags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/humanmade","download_url":"https://codeload.github.com/humanmade/wp-flags/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2Fwp-flags/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262864258,"owners_count":23376461,"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":[],"created_at":"2025-06-30T23:09:35.165Z","updated_at":"2025-06-30T23:09:35.822Z","avatar_url":"https://github.com/humanmade.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ctable width=\"100%\"\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd align=\"left\" width=\"70\"\u003e\n\t\t\t\u003cstrong\u003eFlags\u003c/strong\u003e\u003cbr /\u003e\n\t\t\tLightweight WordPress plugin to enable exposing feature flags to end-users, based on code-based ( or admin UI in the future ) criteria.\n\t\t\u003c/td\u003e\n\t\t\u003ctd align=\"right\" width=\"20%\"\u003e\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\n\t\t\tA \u003cstrong\u003e\u003ca href=\"https://hmn.md/\"\u003eHuman Made\u003c/a\u003e\u003c/strong\u003e project. Maintained by @shadyvb.\n\t\t\u003c/td\u003e\n\t\t\u003ctd align=\"center\"\u003e\n\t\t\t\u003cimg src=\"https://hmn.md/content/themes/hmnmd/assets/images/hm-logo.svg\" width=\"100\" /\u003e\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n**NOTE**: This is a work-in-progress plugin.\n\nInstallation\n==========\n\n#### Using Composer\n\n- Require the package in your project\n\n`composer require humanmade/wp-flags`\n\n#### Using submodules\n\n- Add the plugin as a submodule ( adjust the path as necessary )\n\n`git submodule add git@github.com:humanmade/wp-flags.git content/plugins/wp-flags`\n\nUsage\n==========\n\n```$php\nuse HumanMade\\Flags\\Flags;\n\nadd_action( 'init', function() {\n    Flags::add( 'new-flag', 'New Flag', [\n        // Is the flag exposed to users ?\n        'available' =\u003e function() {\n            return current_user_can( 'manage_options' );\n        },\n        // At what level the flag can be set. One of `user` or `site`\n        'scope' =\u003e 'user',\n        // Default flag status\n        'active' =\u003e true,\n        // Is the flag controllable by users ?\n        'optin' =\u003e true,\n        // Custom icon ? ( dashicon-compatible )\n        'icon' =\u003e 'dashboard',\n        // Custom attribute ?\n        'some_custom_meta_key' =\u003e 'some_value',\n    ] );\n\n    // OR just..\n    $flag = Flags::add( 'another-flag', 'Another flag' );\n    $flag-\u003eon( 'active', function( $active, $flag ) {\n        // do something based on active status change\n    } );\n\n    // Execute logic based on flag status\n    if ( Flags::get( 'new-flag' )-\u003eactive ) {\n        show_the_new_sidebar();\n    } );\n} );\n```\n\nScope of Setting a Flag\n==========\n\nA flag can be set at either the `user` or `site` scope, which determines how a flag is controlled. A `user`-scoped flag can be turned on or off by each user for that user only on a site, whereas a `site`-scoped flag is turned on or off for every user and is controlled in the site settings. \n\nCredits\n=======\n\nWritten and maintained by [Shady Sharaf](https://github.com/shadyvb). Thanks to all our [contributors](https://github.com/humanmade/wp-flags/graphs/contributors).\n\nInterested in joining in on the fun? [Join us, and become human!](https://hmn.md/is/hiring/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumanmade%2Fwp-flags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumanmade%2Fwp-flags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumanmade%2Fwp-flags/lists"}