WordPress.org

Ready to get started?Download WordPress

Forums

Like
Patch for v1.9.6 making the metatags customizable (1 post)

  1. aigan
    Member
    Posted 3 years ago #

    --- tt_like_widget.php.orig	2010-09-21 08:37:28.000000000 +0200
    +++ tt_like_widget.php	2010-12-01 04:01:58.475916671 +0100
    @@ -267,25 +267,31 @@
         if ($fbpageid != $tt_like_settings['default_page_id'] && $fbpageid!='') {
     	echo '<meta property="fb:page_id" content="'.$fbpageid.'" />'."\n";
         }
    -    $image = trim($tt_like_settings['facebook_image']);
    -    if($image!='') {
    -	    echo '<meta property="og:image" content="'.$image.'" />'."\n";
    +    if (!$tt_like_settings['og']['image']) {
    +      $tt_like_settings['og']['image'] = trim($tt_like_settings['facebook_image']);
         }
    +
         echo '<meta property="og:site_name" content="'.htmlspecialchars(get_bloginfo('name')).'" />'."\n";
         if(is_single() || is_page()) {
    +      if( !$tt_like_settings['og']['title']) {
     	$title = the_title('', '', false);
     	$php_version = explode('.', phpversion());
     	if(count($php_version) && $php_version[0]>=5)
     		$title = html_entity_decode($title,ENT_QUOTES,'UTF-8');
     	else
     		$title = html_entity_decode($title,ENT_QUOTES);
    -    	echo '<meta property="og:title" content="'.htmlspecialchars($title).'" />'."\n";
    -    	echo '<meta property="og:url" content="'.get_permalink().'" />'."\n";
    +	$tt_like_settings['og']['title'] = $title;
    +      }
    +
    +      if( !$tt_like_settings['og']['url']) {
    +	$tt_like_settings['og']['url'] = get_permalink();
    +      }
    +
    +      if( !$tt_like_settings['og']['description']) {
     	if($tt_like_settings['use_excerpt_as_description']=='true') {
    -    		$description = trim(get_the_excerpt());
    -		if($description!='')
    -		    	echo '<meta property="og:description" content="'.htmlspecialchars($description).'" />'."\n";
    +	  $tt_like_settings['og']['description'] = trim(get_the_excerpt());
     	}
    +      }
         } else {
         	//echo '<meta property="og:title" content="'.get_bloginfo('name').'" />';
         	//echo '<meta property="og:url" content="'.get_bloginfo('url').'" />';

    http://wordpress.org/extend/plugins/like/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 3 years ago by aigan
  • This topic is not a support question
  • WordPress version: 3.0.1

Tags