{"id":15692017,"url":"https://github.com/varunsridharan/wp-endpoint","last_synced_at":"2025-05-08T02:20:13.189Z","repository":{"id":45525021,"uuid":"127222298","full_name":"varunsridharan/wp-endpoint","owner":"varunsridharan","description":"Simple Lib To Handle Creation of Custom Endpoints Or Rewrites in WordPress ","archived":false,"fork":false,"pushed_at":"2021-04-29T19:35:48.000Z","size":124,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T16:26:27.579Z","etag":null,"topics":["composer","php","rewrites","vsp-libs","wordpress","wordpress-development","wordpress-development-kit","wordpress-endpoint","wordpress-library","wordpress-php-library","wordpress-plugin","wordpress-plugin-addon","wordpress-plugin-development","wordpress-plugin-library","wordpress-plugins","wordpress-router","wp-endpoint","wp-library"],"latest_commit_sha":null,"homepage":"https://varunsridharan.github.io/wp-endpoint/","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/varunsridharan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-03-29T01:56:38.000Z","updated_at":"2024-10-01T00:52:18.000Z","dependencies_parsed_at":"2022-08-04T12:30:20.865Z","dependency_job_id":null,"html_url":"https://github.com/varunsridharan/wp-endpoint","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-endpoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-endpoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-endpoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fwp-endpoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/varunsridharan","download_url":"https://codeload.github.com/varunsridharan/wp-endpoint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252984588,"owners_count":21835815,"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":["composer","php","rewrites","vsp-libs","wordpress","wordpress-development","wordpress-development-kit","wordpress-endpoint","wordpress-library","wordpress-php-library","wordpress-plugin","wordpress-plugin-addon","wordpress-plugin-development","wordpress-plugin-library","wordpress-plugins","wordpress-router","wp-endpoint","wp-library"],"created_at":"2024-10-03T18:27:50.088Z","updated_at":"2025-05-08T02:20:13.136Z","avatar_url":"https://github.com/varunsridharan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WP Endpoint\nSimple Lib To Handle Creation of Custom Endpoints Or Rewrites in WordPress \n\n[![Latest Stable Version](https://poser.pugx.org/varunsridharan/wp-endpoint/version)](https://packagist.org/packages/varunsridharan/wp-endpoint)\n[![Total Downloads](https://poser.pugx.org/varunsridharan/wp-endpoint/downloads)](https://packagist.org/packages/varunsridharan/wp-endpoint)\n[![Latest Unstable Version](https://poser.pugx.org/varunsridharan/wp-endpoint/v/unstable)](//packagist.org/packages/varunsridharan/wp-endpoint)\n[![License](https://poser.pugx.org/varunsridharan/wp-endpoint/license)](https://packagist.org/packages/varunsridharan/wp-endpoint)\n[![composer.lock available](https://poser.pugx.org/varunsridharan/wp-endpoint/composerlock)](https://packagist.org/packages/varunsridharan/wp-endpoint)\n\n\n## Installation\nThe preferred way to install this extension is through [Composer](http://getcomposer.org/download/).\n\nTo install **WP_EndPoint library**, simply:\n\n    $ composer require Varunsridharan/WP_Endpoint\n\nThe previous command will only install the necessary files, if you prefer to **download the entire source code** you can use:\n\n    $ composer require Varunsridharan/WP_Endpoint --prefer-source\n\nYou can also **clone the complete repository** with Git:\n\n    $ git clone https://github.com/varunsridharan/wp-endpoint.git\n\nOr **install it manually**:\n\n[Download WP_Endpoint.php](https://raw.githubusercontent.com/varunsridharan/wp-endpoint/master/class-endpoint.php):\n\n    $ wget https://raw.githubusercontent.com/varunsridharan/wp-endpoint/master/class-endpoint.php\n\n\n## Usage\n```php\n$vs_wp_endpoint = new \\Varunsridharan\\WordPress\\Endpoint('customprefix');\n```\n\n### Add End Point [ `add_endpoint( $endpoint, $endpoint_type, $callback)` ]\n```php\n/**\n * Adds Custom Endpoints To Endpoints Array.\n *\n * @param string       $endpoint\n * @param int          $endpoint_type\n * @param array|string $callback \n *                     if callback is a string and no function with the name then it will be triggered as action\n *\n * @example add_endpoint('hello/',EP_PAGES,'my_page_calback')\n * @example add_endpoint('world/',EP_PAGES,array(\u0026$this,'page_callback'))\n *\n * @return $this\n */\n \n // With Action Trigger\n $vs_wp_endpoint-\u003eadd_endpoint('myendpoint',EP_ROOT,'myendpoint_action');\n \n // With Function Callback\n $vs_wp_endpoint-\u003eadd_endpoint('myendpoint2',EP_ROOT,'myendpoint_callback');\n \n // With Class Callback\n $vs_wp_endpoint-\u003eadd_endpoint('myendpoint3',EP_ROOT,array('VS_CALLBACK_HANDLER','render'));\n\n\nadd_action('myendpoint_action','render_endpoint_page');\n\nfunction render_endpoint_page($wp){\n\tvar_dump($wp-\u003equery_vars);\n}\n\nfunction myendpoint_callback($wp){\n\tvar_dump($wp-\u003equery_vars);\n}\n\nclass VS_CALLBACK_HANDLER{\n\tpublic static function render($wp){\n\t\techo 'Hi';\n\t}\n}\n\n```\n---\n\n### Add Rewrite Rules [ `add_rewrite_rule( $path, $after )` ]\n```php\n/**\n * Adds Custom Rewrite Rules.\n *\n * @param string $path\n * @param string $after\n *\n * @return $this\n */\n \n// Below Will Be Converted into **http://example.com/mypath/22/xxx/\n$vs_wp_endpoint-\u003eadd_rewrite_rule('mypath/{user_id}/{user_name}','top');\n\n// Below Will Be Converted into **http://example.com/welcome/EICAUTPPWICAASJEJNCA/\n$vs_wp_endpoint-\u003eadd_rewrite_rule('welcome/{verify_id}','top');\n```\n\n---\n\n\u003c!-- START common-footer.mustache  --\u003e\n## 📝 Changelog\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n[Checkout CHANGELOG.md](https://github.com/varunsridharan/wp-endpoint/blob/main/CHANGELOG.md)\n\n\n## 🤝 Contributing\nIf you would like to help, please take a look at the list of [issues](https://github.com/varunsridharan/wp-endpoint/issues/).\n\n\n## 📜  License \u0026 Conduct\n- [**GNU General Public License v3.0**](https://github.com/varunsridharan/wp-endpoint/blob/main/LICENSE) © [Varun Sridharan](website)\n- [Code of Conduct](https://github.com/varunsridharan/.github/blob/main/CODE_OF_CONDUCT.md)\n\n\n## 📣 Feedback\n- ⭐ This repository if this project helped you! :wink:\n- Create An [🔧 Issue](https://github.com/varunsridharan/wp-endpoint/issues/) if you need help / found a bug\n\n\n## 💰 Sponsor\n[I][twitter] fell in love with open-source in 2013 and there has been no looking back since! You can read more about me [here][website].\nIf you, or your company, use any of my projects or like what I’m doing, kindly consider backing me. I'm in this for the long run.\n\n- ☕ How about we get to know each other over coffee? Buy me a cup for just [**$9.99**][buymeacoffee]\n- ☕️☕️ How about buying me just 2 cups of coffee each month? You can do that for as little as [**$9.99**][buymeacoffee]\n- 🔰         We love bettering open-source projects. Support 1-hour of open-source maintenance for [**$24.99 one-time?**][paypal]\n- 🚀         Love open-source tools? Me too! How about supporting one hour of open-source development for just [**$49.99 one-time ?**][paypal]\n\n\u003c!-- Personl Links --\u003e\n[paypal]: https://sva.onl/paypal\n[buymeacoffee]: https://sva.onl/buymeacoffee\n[twitter]: https://sva.onl/twitter/\n[website]: https://sva.onl/website/\n\n\n## Connect \u0026 Say 👋\n- **Follow** me on [👨‍💻 Github][github] and stay updated on free and open-source software\n- **Follow** me on [🐦 Twitter][twitter] to get updates on my latest open source projects\n- **Message** me on [📠 Telegram][telegram]\n- **Follow** my pet on [Instagram][sofythelabrador] for some _dog-tastic_ updates!\n\n\u003c!-- Personl Links --\u003e\n[sofythelabrador]: https://www.instagram.com/sofythelabrador/\n[github]: https://sva.onl/github/\n[twitter]: https://sva.onl/twitter/\n[telegram]: https://sva.onl/telegram/\n\n\n---\n\n\u003cp align=\"center\"\u003e\n\u003ci\u003eBuilt With ♥ By \u003ca href=\"https://sva.onl/twitter\"  target=\"_blank\" rel=\"noopener noreferrer\"\u003eVarun Sridharan\u003c/a\u003e \u003ca href=\"https://en.wikipedia.org/wiki/India\"\u003e\n   \u003cimg src=\"https://cdn.svarun.dev/flag-india.jpg\" width=\"20px\"/\u003e\u003c/a\u003e \u003c/i\u003e \u003cbr/\u003e\u003cbr/\u003e\n   \u003cimg src=\"https://cdn.svarun.dev/codeispoetry.png\"/\u003e\n\u003c/p\u003e\n\n---\n\n\n\u003c!-- END common-footer.mustache  --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarunsridharan%2Fwp-endpoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvarunsridharan%2Fwp-endpoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarunsridharan%2Fwp-endpoint/lists"}