Plugin Directory

Changeset 1766485


Ignore:
Timestamp:
11/14/2017 10:07:39 PM (8 years ago)
Author:
richartkeil
Message:

Use property description as meta tag

Location:
exposify/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • exposify/trunk/README.txt

    r1755493 r1766485  
    44Requires at least: 4.5.0
    55Tested up to: 4.6.1
    6 Stable tag: 1.6
     6Stable tag: 1.7
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4848== Changelog ==
    4949
     50= 1.7 =
     51* Use property description as meta tag if YOAST is installed
    5052= 1.6 =
    5153* Update plugin to insert page titles correctly
  • exposify/trunk/exposify.php

    r1755493 r1766485  
    55Plugin URI: https://exposify.de
    66Description: Zeigt alle eigenen Immobilienangebote von Exposify.
    7 Version: 1.6
     7Version: 1.7
    88Author: Exposify
    99Author URI: https://exposify.de
  • exposify/trunk/public.php

    r1755493 r1766485  
    2626    add_filter('the_title',              [$this, 'changePageTitle'], 10, 2);
    2727    add_filter('pre_get_document_title', [$this, 'changeSiteTitle']);
     28    // this is a YOAST frontend filter, it will only be applied if YOAST is installed
     29    add_filter('wpseo_metadesc',         [$this, 'changeMetaDescription']);
    2830  }
    2931
     
    126128
    127129  /**
     130   * Change the meta description of the site if YOAST is installed.
     131   *
     132   * @param  string  $oldDescription
     133   * @return string|bool
     134   */
     135  public function changeMetaDescription($oldDescription)
     136  {
     137    if ($description = $this->exposify->html->getDescription()) {
     138      return $description;
     139    }
     140
     141    return false;
     142  }
     143
     144  /**
    128145  * Insert all external CSS and JS files in the page.
    129146  *
Note: See TracChangeset for help on using the changeset viewer.