Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress How to Build a WordPress Plugin Connecting WordPress Plugins with 3rd Party APIs Getting and Storing JSON Code Challenge

Inside of the my_plugin_get_profile function, create a variable named "json_feed_url" that concatenates the domain name

Inside of the my_plugin_get_profile function, create a variable named "json_feed_url" that concatenates the domain name http://myapi.net with the my_plugin_username variable and appends ".json" to the end.

plugin.php
<?php
function my_plugin_get_profile($my_plugin_username){ $json_feed_url = '"http://myapi.net" . {$my_plugin_username} . ".json"'; }

}
?>

1 Answer

Emily Easton
Emily Easton
13,575 Points

Hi Alex, Im not 100% sure what your actual question is but I'm assuming your answer wasn't working (I know its a late reply but for anyone else looking)

<?php

function my_plugin_get_profile($my_plugin_username) 
{ $json_feed_url = 'http://myapi.net/' . $my_plugin_username . '.json'; } 

?>
  • you didn't need the curly braces on the "$my_plugin_username" bit. Hope this helps anyone :)