Sindbad~EG File Manager
<?php
/*
* Security : blocking direct access
* Source : http://codex.wordpress.org/Theme_Development#Template_Files
*/
defined('ABSPATH') or die("Access Restricted");
/*
* Remove Default AMP Structured Data
*
*/
function mwp_remove_default_structured_data( $metadata, $post ) {
unset($metadata);
}
add_filter( 'amp_post_template_metadata', 'mwp_remove_default_structured_data', 10, 2 );
/*
* Remove Title and Generator tags
*
*/
function mwp_amp_post_template_add($amp_template) {
if (class_exists('All_in_One_SEO_Pack') || class_exists('WPSEO_Options')) return;
remove_action( 'amp_post_template_head', 'amp_post_template_add_title' );
remove_action( 'amp_post_template_head', 'amp_add_generator_metadata' );
}
add_action( 'amp_post_template_head', 'mwp_amp_post_template_add', 9 );
/*
* Function Description : Auto SEO
* Author Name : Mouad Achemli
* Function Source : http://www.mwordpress.net
* Note : this function is important do not remove from here
*
*/
function mwp_add_structured_data($post) {
if ( mwp_option('seo-enable') == 1) {
$videos_ids = mwp_option('category-videos');
switch (true) {
case (is_singular() || is_attachment()) :
if (is_singular('page')) {
if ( file_exists( get_template_directory() . '/functions/seo/meta-page.php' ) ) {
require_once( get_template_directory() . '/functions/seo/meta-page.php' );
return mwp_seo_page();
}
} else {
if (!empty($videos_ids) && in_category($videos_ids)) {
if ( file_exists( get_template_directory() . '/functions/seo/meta-single-video.php' ) ) {
require_once( get_template_directory() . '/functions/seo/meta-single-video.php' );
return mwp_seo_single_video();
}
} else {
if ( file_exists( get_template_directory() . '/functions/seo/meta-single.php' ) ) {
require_once( get_template_directory() . '/functions/seo/meta-single.php' );
return mwp_seo_single();
}
}
}
break;
}
}
}
add_filter( 'amp_post_template_head', 'mwp_add_structured_data', 0, 2 );
function mwp_add_structured_data_plugins($post) {
if (is_singular()) :
if ( file_exists( get_template_directory() . '/functions/seo/single-jsonld.php' ) ) {
require_once( get_template_directory() . '/functions/seo/single-jsonld.php' );
return mwp_seo_single_jsonld();
}
endif;
}
add_filter( 'amp_post_template_head', 'mwp_add_structured_data_plugins', 0, 2 );
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists