{"id":15971403,"url":"https://github.com/sanusart/wp-js-info","last_synced_at":"2025-10-08T07:06:28.835Z","repository":{"id":30730441,"uuid":"34286729","full_name":"sanusart/wp-js-info","owner":"sanusart","description":"Simple plug-in to allow access to some WordPress data/info from JavaScript","archived":false,"fork":false,"pushed_at":"2015-04-22T16:38:56.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-12T00:08:35.895Z","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/sanusart.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":"2015-04-20T21:11:49.000Z","updated_at":"2015-04-22T16:38:56.000Z","dependencies_parsed_at":"2022-09-08T18:01:33.523Z","dependency_job_id":null,"html_url":"https://github.com/sanusart/wp-js-info","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sanusart/wp-js-info","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanusart%2Fwp-js-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanusart%2Fwp-js-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanusart%2Fwp-js-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanusart%2Fwp-js-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanusart","download_url":"https://codeload.github.com/sanusart/wp-js-info/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanusart%2Fwp-js-info/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278903036,"owners_count":26065786,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-10-07T20:21:25.337Z","updated_at":"2025-10-08T07:06:28.816Z","avatar_url":"https://github.com/sanusart.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wp-js-info\n\nAccess to some WordPress data/info from JavaScript\n\n---\n\n### About\n\nOnce installed and activated, provides access to some wordpress data/info via `window.wpJsInfo` object.\n\n### Why?\n\nSometimes I need to execute some snippets of JS only on particular pages/posts.\n\nThe suggested WordPress way of passing data from PHP to JavaScript is via parameter of [wp_localize_script()](https://codex.wordpress.org/Function_Reference/wp_localize_script).\nI feel this a bit hack-ish as the real intend of the function is for pass localization strings to use in Javascript.\n\n### Example\n\n`window.wpJsInfo`\n\n![screenshot](http://i.imgur.com/Hu29k9g.png)\n\n`window.wpJsInfo.post`\n\n![screenshot](http://i.imgur.com/6ljvDSI.png)\n\n... and so on\n\n### License\n\nMIT\n\n:)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanusart%2Fwp-js-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanusart%2Fwp-js-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanusart%2Fwp-js-info/lists"}