src/Util/Theme.php
public static function pageMeta() {
    $title = wp_title(null, false);
    
    // If the title is not empty, we can assume that we're not bypassing
    // WordPress routing, and therefore Yoast will give us all the meta tags
    if(!empty($title)) return null;
    
    global $post;
    $this_post = $post;
    
    // Create Taco post only if $post is not already a Taco object
    if(!is_subclass_of($post, 'Taco\Base')) {
      $this_post = \Taco\Post\Factory::create($post, false);
    }
    
    if(!Obj::iterable($this_post)) return null;
    
    $description = null;
    if(Config::get()->use_yoast) {
      $description = $this_post->getSafe('_yoast_wpseo_metadesc');
    }
    if(empty($description)) {
      $description = strip_tags($this_post->getTheExcerpt());
    }
    
    $image = (Config::get()->use_yoast)
      ? $this_post->{'_yoast_wpseo_opengraph-image'}
      : null;
    
    return View::make('meta-tags', [
      'title' => self::pageTitle(),
      'description' => trim($description),
      'image' => $image,
      'full_url' => URL_REQUEST,
      'site_name' => get_bloginfo('name'),
      'separator' => self::pageTitleSeparator(),
    ]);
  }
public static function pageMeta() {
    $title = wp_title(null, false);
    
    // If the title is not empty, we can assume that we're not bypassing
    // WordPress routing, and therefore Yoast will give us all the meta tags
    if(!empty($title)) return null;
    
    global $post;
    $this_post = $post;
    
    // Create Taco post only if $post is not already a Taco object
    if(!is_subclass_of($post, 'Taco\Base')) {
      $this_post = \Taco\Post\Factory::create($post, false);
    }
    
    if(!Obj::iterable($this_post)) return null;
    
    $description = null;
    if(Config::get()->use_yoast) {
      $description = $this_post->getSafe('_yoast_wpseo_metadesc');
    }
    if(empty($description)) {
      $description = strip_tags($this_post->getTheExcerpt());
    }
    
    $image = (Config::get()->use_yoast)
      ? $this_post->{'_yoast_wpseo_opengraph-image'}
      : null;
    
    return View::make('meta-tags', [
      'title' => self::pageTitle(),
      'description' => trim($description),
      'image' => $image,
      'full_url' => URL_REQUEST,
      'site_name' => get_bloginfo('name'),
      'separator' => self::pageTitleSeparator(),
    ]);
  }
public static function pageMeta ( ) { $ title = wp_title ( null , false ) ; // If the title is not empty, we can assume that we're not bypassing // WordPress routing, and therefore Yoast will give us all the meta tags if ( ! empty ( $ title ) ) return null ; global $ post ; $ this_post = $ post ; // Create Taco post only if $post is not already a Taco object if ( ! is_subclass_of ( $ post , 'Taco\Base' ) ) { $ this_post = \ Taco \ Post \ Factory :: create ( $ post , false ) ; } if ( ! Obj :: iterable ( $ this_post ) ) return null ; $ description = null ; if ( Config :: get ( ) -> use_yoast ) { $ description = $ this_post -> getSafe ( '_yoast_wpseo_metadesc' ) ; } if ( empty ( $ description ) ) { $ description = strip_tags ( $ this_post -> getTheExcerpt ( ) ) ; } $ image = ( Config :: get ( ) -> use_yoast ) ? $ this_post -> { '_yoast_wpseo_opengraph-image' } : null ; return View :: make ( 'meta-tags' , [ 'title' => self :: pageTitle ( ) , 'description' => trim ( $ description ) , 'image' => $ image , 'full_url' => URL_REQUEST , 'site_name' => get_bloginfo ( 'name' ) , 'separator' => self :: pageTitleSeparator ( ) , ] ) ; }
Get the page meta tags
@return string
Get the page meta tags