{"id":13759815,"url":"https://github.com/alwaysblank/plumbing-normalize-links","last_synced_at":"2025-11-14T11:04:17.405Z","repository":{"id":51144177,"uuid":"300732102","full_name":"alwaysblank/plumbing-normalize-links","owner":"alwaysblank","description":null,"archived":false,"fork":false,"pushed_at":"2021-05-21T14:17:22.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"dev","last_synced_at":"2025-01-04T18:28:44.060Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alwaysblank.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-02T20:44:41.000Z","updated_at":"2021-05-21T14:17:25.000Z","dependencies_parsed_at":"2022-09-10T01:50:19.595Z","dependency_job_id":null,"html_url":"https://github.com/alwaysblank/plumbing-normalize-links","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwaysblank%2Fplumbing-normalize-links","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwaysblank%2Fplumbing-normalize-links/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwaysblank%2Fplumbing-normalize-links/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alwaysblank%2Fplumbing-normalize-links/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alwaysblank","download_url":"https://codeload.github.com/alwaysblank/plumbing-normalize-links/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240290686,"owners_count":19778112,"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":["hacktoberfest"],"created_at":"2024-08-03T13:00:59.567Z","updated_at":"2025-11-14T11:04:12.357Z","avatar_url":"https://github.com/alwaysblank.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"= Normalize Links\n\nimage:https://travis-ci.org/alwaysblank/plumbing-normalize-links.svg?branch=dev[\"Build Status\", link=\"https://travis-ci.org/alwaysblank/plumbing-normalize-links\"]\n\nThe purpose of this small package is to ingest the link arrays produced by https://www.advancedcustomfields.com/resources/link/[ACF's \"link\" field type], do a bit of logic on them, and provide a nice interface for interacting with that data.\nIt can also accept urls as plain strings.\n\n== Usage\n\n.ACF field\n[source,php]\n----\n$Link = new Normalized(get_field('some_link'));\n\n$Link-\u003evalid(); //whether or not this is a \"valid\" link\n$Link-\u003eurl(); // the URL of the link\n$Link-\u003elabel(); // the \"title\" set for this link\n$Link-\u003enewTab(); // whether this link should be opened in a new tab\n$Link-\u003eprobablyExternal() // if the link is (probably) external or not\n----\n\n.Simple string\n[source,php]\n----\n$Link = new Normalized('https://www.alwaysblank.org');\n----\n\n=== Settings\n\nA small number of settings are also supported, which can be passed when instantiated.\n\n[source,php]\n----\n$Link = new Normalized(get_field('some_link'), [\n    'label' =\u003e \"Learn More\", // Used as a fallback if there is no `title.`\n    'external_in_new_tab' =\u003e true, // Always open external links in new tab\n    'validate' =\u003e [\n        'url' =\u003e false,\n        'label' =\u003e false,\n    ], // Validate url and/or label\n]);\n----\n\n`label` defaults to \"Learn More\" and `external_in_new_tab` defaults to `true`.\n`validate` defaults to _not_ validating inputs.\nYou can specify which items (`url` or `label`) to validated, or set `validate` to `true` to validate all items.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falwaysblank%2Fplumbing-normalize-links","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falwaysblank%2Fplumbing-normalize-links","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falwaysblank%2Fplumbing-normalize-links/lists"}