Last active
August 29, 2015 14:21
-
-
Save viankakrisna/1f5fdc1f1caf90a18e20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getWPJRA = function( baseUrl, child , callback){ | |
if (baseUrl !== undefined ){ | |
switch( child ) { | |
case undefined: | |
return jQuery.getJSON( '/' + baseUrl + "/wp-json" , callback); | |
break; | |
default: | |
return jQuery.getJSON( '/' + baseUrl + "/wp-json/" + child, callback); | |
} | |
} else if (baseUrl === undefined || baseUrl.length == 0) { | |
return jQuery.getJSON( "/wp-json" ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment