/** * Use the production summary as the metadesc for a production. * Only if no metadesc is set using the WordPress SEO meta box. */ function wpseo_metadesc($metadesc) { if (!is_admin() && empty($metadesc)) { if (is_singular(WPT_Production::post_type_name)) { $production = new WPT_Production(); $metadesc = $production->summary(); } } return $metadesc; }