自定义Wordpress插件导致wpautop在不应运行的情况下运行

时间:2019-03-25 18:15:32

标签: php wordpress plugins

我在自己管理的网站上继承了此插件。此插件导致wpautop在不应该运行的地方运行,例如古腾堡的自定义html块。这意味着我经常遇到格式问题。

网站所有者表示,该插件必须保留,因为它对SEO很重要。插件“开发人员”只说这不应该发生。但这是一个前端开发人员来解决这个问题,但是我绝对是PHP的垃圾用户,所以我将不胜感激一些帮助。

我尝试仅删除对wpautop的调用以查看是否可以解决该问题,但是我仅成功中断了登台站点。

<?php
// Kill if accessed directly  //
defined('ABSPATH') or die("No Way!");
function seo_automation_test1()
{
    global $testxt1;
    $testxt1 = ' xxxxxxxxxxxxxxxxxxxxxxxxx ';
}

if (is_admin()) {
    add_action('pre_get_posts', 'exclude_this_page');
    register_activation_hook(__FILE__, 'seo_automation_activate');
    register_deactivation_hook(__FILE__, 'seo_automation_deactivation');
}
add_action('init', 'seo_automation_listen', 1);
add_action('wp_footer', 'seo_automation_copyright_footer', 1);
add_action('wp_enqueue_scripts', 'seo_automation_css_styles');
//remove_filter( 'the_excerpt', 'wpautop' );
//remove_filter('the_content','wpautop');
//add_filter('the_excerpt','seo_custom_formatting');
//add_filter('the_content', 'seo_custom_formatting');
add_filter('the_content', 'seo_automation_content');
ob_start();
//add_action('shutdown','seo_final_output' , 0);
//add_filter('final_output', 'seo_nofollow_content');

0 个答案:

没有答案