How can I improve CreateGenre()  function?
Remove global (this shouldn't need to be explained).

Your code depends on the class ReturnValue with method doReturn.  This is a tight coupling that makes it hard to test your code.  For your code to be reused you must also include the ReturnValue.  This is almost ok, when it is only 1 extra file, but it gets out of hand very quickly. 

Your code has also become bloated by the error code handling.  Consider rewriting this with exceptions:

/**
 * Creates a genere. If one already exists it will return an error
 *
 * @param type $wpdb        Wordpress database?
 * @param type $genreName   What is this?
 * @return type 
 */
function createGenre($wpdb, $genreName) {
    if (empty($genreName) || !is_string($genreName))
    {
       throw new InvalidArgumentException(
          // Choose either __METHOD__ or __FUNCTION__ depending if this is OO.
          __METHOD__ . ' genreName must be a non-empty string');
    }

    $genreName = ucwords($genreName);
    $genreSlug = text2Slug($genreName);
    $query = "SELECT COUNT (*) as count FROM `genres` WHERE `name`='" .
        $genreName . "' AND  `slug`='" . $genreSlug . "' ";
    $result = $wpdb-&gt;get_results($query);
    if ($result[0]-&gt;count &gt; 0) {
       throw new RuntimeException(__METHOD__ . ' genre already exists.');
    }

    $formData = array(
       'name' =&gt; $genreName,
       'slug' =&gt; $genreSlug
       );

    $result = $wpdb-&gt;insert('genres', $formData);

    if (!$result) {
       throw new RuntimeException(
           __METHOD__ . ' failed to create genre: ' . $genreName);
    }
}


The code is a lot shorter and flatter (which makes it easier to test and maintain.  Arrow code is harder to debug, maintain and test - see here.

Here is the usage with exceptions:

try
{
   $genreName = 'slimy ';
   createGenre($wpdb, trim($genreName));

   return array('action'      =&gt; 'createGenre',
                'message'     =&gt; 'Genre ' . $genreName . ' has been created.',
                'returnValue' =&gt; '', // If needed even.
                'status'      =&gt; 'SUCCESS');
}
catch (Exception $e)
{
   return array('action'      =&gt; 'createGenre',
                'message'     =&gt; $e-&gt;getMessage(),
                'returnValue' =&gt; '', // If needed even.
                'status'      =&gt; 'ERROR',

}