{"id":21931330,"url":"https://github.com/themeplate/resource","last_synced_at":"2025-03-22T13:11:51.657Z","repository":{"id":57068296,"uuid":"298747565","full_name":"ThemePlate/Resource","owner":"ThemePlate","description":"Helper for resource hinting","archived":false,"fork":false,"pushed_at":"2025-03-01T05:34:38.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-01T06:24:31.755Z","etag":null,"topics":["directives","wordpress","wordpress-dependencies"],"latest_commit_sha":null,"homepage":"","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/ThemePlate.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":"2020-09-26T05:54:10.000Z","updated_at":"2025-03-01T05:34:18.000Z","dependencies_parsed_at":"2025-03-01T06:34:24.222Z","dependency_job_id":null,"html_url":"https://github.com/ThemePlate/Resource","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"eff22cb845310b27f5e8f05f017517e4662eea9f"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThemePlate%2FResource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThemePlate%2FResource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThemePlate%2FResource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThemePlate%2FResource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThemePlate","download_url":"https://codeload.github.com/ThemePlate/Resource/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959454,"owners_count":20538628,"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":["directives","wordpress","wordpress-dependencies"],"created_at":"2024-11-28T23:13:32.431Z","updated_at":"2025-03-22T13:11:51.630Z","avatar_url":"https://github.com/ThemePlate.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ThemePlate Resource\n\n## Usage\n\n```php\nuse ThemePlate\\Resource;\n\nadd_action( 'wp_head', array( Resource::class, 'action' ), 2 );\n\nResource::hint( 'dns-prefetch', '//cdnjs.cloudflare.com' );\nResource::hint( 'preconnect', '//ajax.cloudflare.com' );\nResource::hint( 'prerender', 'http://my.site/blog' );\nResource::hint( 'prefetch', 'jquery-migrate' );\nResource::hint( 'preload', 'jquery-core' );\n\nResource::hint( 'preload', array(\n\t'href' =\u003e 'https://fonts.gstatic.com/s/montserrat/v14/JTURjIg1_i6t8kCHKm45_cJD3gTD_u50.woff2',\n\t'as'   =\u003e 'font',\n\t'type' =\u003e 'font/woff2',\n) );\n```\n\n### Resource::hint( $directive, $resource )\n- **$directive** *(string)(Required)* Type of directive to use\n- **$resource** *(mixed)(Required)*\n\u003e - URL *(string)*\n\u003e   - `dns-prefetch`\n\u003e   - `preconnect`\n\u003e   - `prerender`\n\u003e - Handle *(string)*\n\u003e   - `prefetch`\n\u003e   - `preload`\n\u003e - Custom *(array)*\n\u003e   - `prefetch`\n\u003e   - `preload`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemeplate%2Fresource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthemeplate%2Fresource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemeplate%2Fresource/lists"}