或者更具体地说,如何将插件注入的代码移动到Wordpress Jquery下面?
Thrive Visual Editor插件有一个登录页生成器,允许通过Thrive Content Builder > Landing Page settings > Setup custom scripts.
我插入到登录页中的自定义脚本需要在Wordpress Jquery之后显示,这些脚本才能工作。
我不是开发人员,也不是Wordpress开发人员,我是建设者/设计师。
我在插件文件夹中搜索了add_action(\'wp_head\' 但没有找到。根据我对Wordpress挂钩的有限理解,我想我可以找到add_action(\'wp_head\' 插件将自定义脚本插入到<head>, 并在Wordpress Jquery下面修改其优先级。
所以,我的问题是:
插件是否有标准的方法将代码注入前端<head>?如何更改此插入的优先级,使其发生在Wordpress Jquery之后我在谷歌上搜索了插件如何将代码插入<head> 找不到答案。
Update: 我在插件文件夹中搜索wp_enqueue_scripts 并在中找到thrive-visual-editor/thrive-visual-editor.php:
add_action(\'admin_menu\', \'tve_add_settings_menu\');
add_action(\'wp_enqueue_scripts\', \'tve_frontend_enqueue_scripts\');
add_filter(\'tve_landing_page_content\', \'tve_editor_content\');
 我搜索了
tve_frontend_enqueue_scripts 并没有发现任何适用的。
我搜索了tve_landing_page_content 并在中找到\\thrive-visual-editor\\landing-page\\layout.php:
<body>
...
<?php echo apply_filters( \'tve_landing_page_content\', \'\' ) ?>
...
layout.php 似乎是替换主题页面模板的模板文件-这是一个完整的HTML+PHP网页。
在<head> 曾经:
<?php $tcb_landing_page->head(); ?>
 因此,看起来这就是插入自定义脚本的地方。
没有wp_head() 在<head> 属于layout.php
在里面\\thrive-visual-editor\\landing-page\\inc\\TCB_Landing_Page.php 有:
public function head() {
    /* I think the favicon should be added using the wp_head hook and not like this */
    if (function_exists(\'thrive_get_options_for_post\')) {
        $options = thrive_get_options_for_post();
        if (!empty($options[\'favicon\'])) : ?>
            <link rel="shortcut icon" href="<?php echo $options[\'favicon\']; ?>"/>
        <?php endif;
    }
    $this->fonts();
    if (!empty($this->globalScripts[\'head\'])) {
        $this->globalScripts[\'head\'] = $this->removeJQuery($this->globalScripts[\'head\']);
        echo $this->globalScripts[\'head\'];
    }
    empty($this->globals[\'do_not_strip_css\']) ?
        $this->stripHeadCss() : wp_head();
    /* finally, call the tcb_landing_head hook */
    apply_filters(self::HOOK_HEAD, $this->id);
}