{"id":23709518,"url":"https://github.com/arraypress/wp-mdash","last_synced_at":"2026-02-12T06:32:32.276Z","repository":{"id":268872627,"uuid":"903923734","full_name":"arraypress/wp-mdash","owner":"arraypress","description":"A collection of WordPress functions for handling empty values consistently using mdash and other semantic formatting patterns","archived":false,"fork":false,"pushed_at":"2025-01-06T17:40:54.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-07T15:44:54.705Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/arraypress.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-15T22:33:11.000Z","updated_at":"2025-01-06T17:40:58.000Z","dependencies_parsed_at":"2025-04-11T17:54:23.710Z","dependency_job_id":"68a0a58f-b3e9-42cb-8f5a-aa6d852aee50","html_url":"https://github.com/arraypress/wp-mdash","commit_stats":null,"previous_names":["arraypress/wp-mdash"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arraypress/wp-mdash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-mdash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-mdash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-mdash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-mdash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arraypress","download_url":"https://codeload.github.com/arraypress/wp-mdash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-mdash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29360644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"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-12-30T18:56:44.573Z","updated_at":"2026-02-12T06:32:32.271Z","avatar_url":"https://github.com/arraypress.png","language":"PHP","readme":"# WordPress MDash Polyfill\n\nMinimal WordPress polyfill for handling empty values with em dashes.\n\n## Installation\n\n```bash\ncomposer require arraypress/wp-mdash\n```\n\n## Functions\n\n### `mdash( $value ): string`\n\nReturn an em dash if value is empty, otherwise return the value.\n\n```php\nmdash( '' );         // '\u0026mdash;'\nmdash( null );       // '\u0026mdash;'\nmdash( false );      // '\u0026mdash;'\nmdash( 0 );          // '\u0026mdash;'\nmdash( 'Hello' );    // 'Hello'\nmdash( 42 );         // '42'\n```\n\n### `mdash_esc( $value ): string`\n\nReturn an em dash if value is empty, otherwise return the escaped value.\n\n```php\nmdash_esc( '' );                    // '\u0026mdash;'\nmdash_esc( 'Hello' );               // 'Hello'\nmdash_esc( '\u003cscript\u003ealert()\u003c/script\u003e' );  // '\u0026lt;script\u0026gt;alert()\u0026lt;/script\u0026gt;'\n```\n\n## Usage\n\n### Admin Tables\n\n```php\n\u003ctable class=\"wp-list-table\"\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003c?php echo mdash_esc( $user-\u003edisplay_name ); ?\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003c?php echo mdash_esc( $user-\u003elast_login ); ?\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003c?php echo mdash( $user-\u003epost_count ); ?\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n```\n\n### Settings Pages\n\n```php\n\u003ctr\u003e\n    \u003cth\u003eAPI Key\u003c/th\u003e\n    \u003ctd\u003e\u003c?php echo mdash_esc( get_option( 'api_key' ) ); ?\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n    \u003cth\u003eLast Sync\u003c/th\u003e\n    \u003ctd\u003e\u003c?php echo mdash( $last_sync_date ); ?\u003e\u003c/td\u003e\n\u003c/tr\u003e\n```\n\n### Reports\n\n```php\necho 'Total Sales: ' . mdash( $sales_count );\necho 'Average Rating: ' . mdash( $avg_rating );\necho 'Customer Notes: ' . mdash_esc( $customer_notes );\n```\n\n## When to Use Each\n\n| Function      | Use When                                            |\n|---------------|-----------------------------------------------------|\n| `mdash()`     | Value is already safe (numbers, dates, pre-escaped) |\n| `mdash_esc()` | Value contains user input or untrusted data         |\n\n## Requirements\n\n- PHP 7.4+\n- WordPress 5.0+\n\n## License\n\nGPL-2.0-or-later","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Fwp-mdash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farraypress%2Fwp-mdash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Fwp-mdash/lists"}