Sindbad~EG File Manager
<?php
namespace RealPress\Controllers;
use RealPress\Helpers\Page;
class SeoController {
public function __construct() {
//Yoast seo
add_filter( 'wpseo_metadesc', array( $this, 'add_default_meta_description' ) );
}
public function add_default_meta_description( $description ) {
if ( ! empty( $description ) ) {
return $description;
}
if ( Page::is_property_single_page() || Page::is_agent_list_page() || Page::is_terms_and_conditions_page() ||
Page::is_become_an_agent_page() || Page::is_wishlist_page() || Page::is_compare_property_page() ||
Page::is_my_account_page() ) {
global $post;
$excerpt = get_the_excerpt( $post );
if ( empty( $excerpt ) ) {
$content = get_the_content();
if ( empty( $content ) ) {
$description = get_the_title( $post->ID );
} else {
$description = $content;
}
} else {
$description = $excerpt;
}
}
if ( Page::is_property_archive_page() ) {
$description = get_the_archive_description();
if ( empty( $description ) ) {
$description = get_the_archive_title();
}
}
return substr( $description, 0, 155 );
}
}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists