Skip to content

Commit b8626c6

Browse files
author
Salil Kothadia
committed
Initial Commit
1 parent a7975ce commit b8626c6

File tree

8 files changed

+632
-0
lines changed

8 files changed

+632
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Multiple Content type Query API for Wordpress Rest Api V2
2+
3+
Extension of wp/v2/posts api to allow query multiple post types
4+
5+
## About
6+
7+
Want to get your site's posts, pages, articles, events/?
8+
Endpoint is '/wp-json/wp/v2/multiple-post-type'
9+
`GET` request to `/wp-json/wp/v2/multiple-post-type`.
10+
Get the page with slug "about-me"? `GET /wp-json/wp/v2/multiple-post-type?slug=about-me`.
11+
search term "awesome"? `GET /wp-json/wp/v2/multiple-post-type?search=awesome`.
12+
13+
## Credits
14+
15+
Build using the code shared by Ruben Vreeken, (https://github.com/Rayraz)
16+
on stackoverflow (http://stackoverflow.com/questions/38059805/query-multiple-post-types-using-wp-rest-api-v2-wordpress)
17+
18+
## License
19+
20+
[GPLv3+](http://www.gnu.org/licenses/gpl-3.0.html)
21+

codecoverage.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<phpunit
2+
bootstrap="tests/bootstrap.php"
3+
backupGlobals="false"
4+
colors="true"
5+
convertErrorsToExceptions="true"
6+
convertNoticesToExceptions="true"
7+
convertWarningsToExceptions="true"
8+
>
9+
<php>
10+
<const name="WPAPI_CODE_COVERAGE" value="1" />
11+
</php>
12+
<testsuites>
13+
<!-- Default test suite to run all tests -->
14+
<testsuite>
15+
<directory prefix="test-" suffix=".php">tests</directory>
16+
</testsuite>
17+
</testsuites>
18+
<filter>
19+
<blacklist>
20+
<directory suffix=".php">.</directory>
21+
</blacklist>
22+
<whitelist>
23+
<directory suffix=".php">./lib</directory>
24+
<file>./plugin.php</file>
25+
</whitelist>
26+
</filter>
27+
<logging>
28+
<log type="coverage-clover" target="build/logs/clover.xml"/>
29+
</logging>
30+
</phpunit>

composer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "elevati/wp-api-multiple-posttype",
3+
"type": "wordpress-plugin",
4+
"description": "Extension of wp/v2/posts api to allow query multiple post types",
5+
"license": "GPL2+",
6+
"authors": [
7+
{
8+
"name": "Elevati Team",
9+
"homepage": "http://elevati.com/"
10+
},
11+
{
12+
"name": "Ruben Vreeken",
13+
"homepage": "https://github.com/Rayraz"
14+
}
15+
],
16+
"require": {
17+
"composer/installers": "~1.0"
18+
},
19+
"require-dev": {
20+
"squizlabs/php_codesniffer": "2.3.4",
21+
"wp-coding-standards/wpcs": "0.6.0"
22+
},
23+
"extra": {
24+
},
25+
"scripts": {
26+
"post-install-cmd": "\"phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs",
27+
"post-update-cmd": "\"phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs"
28+
}
29+
}

0 commit comments

Comments
 (0)