I am making some changes to an existing Wordpress theme.
public function checkTv( $post ) {
global $title;
if ( ! empty( $post['season'] ) ) {
$videourl ='shows'.$title. $post['season'].'-'. $post['episodio'];
}
return $videourl;
}
Here the $videourl
contains the desired URL format. Everything is working but the $title
value is not being concatenated in the URL. It is being skipped automatically. In title i have the slug.
This how the call is being made
$postmeta = doo_postmeta_episodes($post_id);
$videourl = $this->checkTv( $postmeta );
$title
has been declared as global and the value of the title is being taken from a function.