解析错误:语法错误,意外'返回'(T_RETURN) - 部落事件

时间:2016-09-01 09:40:31

标签: wordpress

我确信我是一个蠢货,但我无法发现导致错误的原因。它在106线上,从底部开始是第三个。任何帮助发现错误都将非常感激。

提前谢谢。

<?php

add_action( 'wp_enqueue_scripts', 'rs_theme_enqueue_styles' );
function rs_theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'menu-style', get_stylesheet_directory_uri() . '/menus.css' );
}

add_filter('pre_get_posts', 'my_posts');
function my_posts($query) {
    if ((is_tag() || is_category()) && (!isset($query->query_vars['post_type']) || !$query->query_vars['post_type'])) {
        $query->set('post_type', 'any');
    }
    return $query;
}

// Enqueue and tell WP to load child theme custom javascript file
// if ( !is_admin() ) { // instruction to only load if it is not the admin area
    function rs_custom_scripts() {
        // Get current theme version
        $_theme     = wp_get_theme();
        $_theme_ver = $_theme->get( 'Version' );

        wp_enqueue_script( 'rs_custom_scripts', 
            get_stylesheet_directory_uri() . '/js/custom_scripts.js', 
            array( 'jquery' ), 
            $_theme_ver, 
            true);

        wp_enqueue_script( 'rs_custom_menu_script', 
            get_stylesheet_directory_uri() . '/js/menu-handler.js', 
            array( 'jquery' ), 
            $_theme_ver, 
            true);
        // More custom scripts can be enqueued here
    }
    add_action('wp_enqueue_scripts', 'rs_custom_scripts', 1000);
// }


// TGM Plugin Activation
require_once dirname( __FILE__ ) . '/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'riseandshine_register_required_plugins' );
function riseandshine_register_required_plugins() {

    $plugins = array(

        array(
            'name'               => 'Divi Login',
            'slug'               => 'DiviLogin',
            'source'             => get_stylesheet_directory() . '/plugins/DiviLogin.zip',
            'required'           => true,
            'version'            => '1.0',
            'force_activation'   => false,
            'force_deactivation' => false,
            'external_url'       => 'http://divi.space/',
            'is_callable'        => '',
        ),

        array(
            'name'      => 'Wordpress Countdown Widget',
            'slug'      => 'wordpress-countdown-widget',
            'required'  => true,
        ),

        array(
            'name'        => 'Recipe Card',
            'slug'        => 'recipe-card',
            'required'  => true,
        ),

        array(
            'name'        => 'Restaurant Reservations',
            'slug'        => 'restaurant-reservations',
            'required'  => true,
        ),

        array(
            'name'        => 'WooCommerce',
            'slug'        => 'woocommerce',
            'required'  => true,
        ),

    );

    $config = array(
        'id'           => 'tgmpa',
        'default_path' => '',
        'menu'         => 'tgmpa-install-plugins',
        'parent_slug'  => 'themes.php',
        'capability'   => 'edit_theme_options',
        'has_notices'  => true,
        'dismissable'  => true,
        'dismiss_msg'  => '',
        'is_automatic' => false,
        'message'      => '',

    );

    tgmpa( $plugins, $config );
}
function my_et_builder_post_types( $post_types ) {
    $post_types[] = 'events';
    $post_types[] = 'tribe_events';

    return $post_types;
}
add_filter( 'et_builder_post_types', 'my_et_builder_post_types' );

1 个答案:

答案 0 :(得分:1)

可能是因为require_once

中包含的文件中有大括号
 require_once dirname( __FILE__ ) . '/class-tgm-plugin-activation.php';