I am working on modifying a plugin for wordpress to better suit my needs, and I need to know exactly what this code does:
if ( $single_download['uniqueid'] == null )
$link[] = array( "url" => site_url( "?downloadid=" . $single_download['id'] ), "name" => $file_name );
else
$link[] = array( "url" => site_url( "?downloadid=" . $single_download['uniqueid'] ), "name" => $file_name );
If you would need more than just this code here, could you please just explain what it is doing as far as you can tell by the scope of the code I have provided. I am assuming it is combining the different items but I am nut sure.
Edit: Sorry I should have clarified I realize what the if statement is doing, I need to know what the other line of code does.
This is a statement populates an array (
$link) with values based on the result of a test.If the value of
$single_download['uniqueid']is null, the value of $single_download[‘id’] is appended to a URL. If$single_download['uniqueid']is not null, its value is appended to the URL.In both cases, the resultant value of the URL is inserted into the array.