Php WordPress站点错误

Php WordPress站点错误,php,wordpress,Php,Wordpress,在服务器上上传更新后的主题文件夹后,我面临以下错误,该主题文件夹在本地计算机上工作正常。错误如下: <?php /** * Remove password email text if option for users to set their own password is enabled in Theme settings. */ function remove_password_email_text ( $text ) { $let_users_set_pass = of

在服务器上上传更新后的主题文件夹后,我面临以下错误,该主题文件夹在本地计算机上工作正常。错误如下:

<?php

/**
 * Remove password email text if option for users to set their own password is enabled in Theme settings.
 */
function remove_password_email_text ( $text ) {
    $let_users_set_pass = of_get_option('let_users_set_pass', 0);
    if ($text == 'A password will be e-mailed to you.' && $let_users_set_pass)
        $text = '';
    return $text;
}
add_filter( 'gettext', 'remove_password_email_text' );

/**
 * Function that renders labeled field in the form of
 * <div class="container_css_class"><span>$label_text</span> $field_value</div>
 */
function byt_render_labeled_field_value($container_css_class, $label_css_class, $label_text, $field_value, $header_text = '', $paragraph = false) {
    if (!empty($field_value) || !empty($label_text)) {
        $ret_val = '';

        if (!empty($header_text))
            $ret_val = sprintf("<h1>%s</h1>", $header_text);

        if (!empty($container_css_class))
            $ret_val .= sprintf("<div class='%s'>", $container_css_class);

        if ($paragraph)
            $ret_val .= '<p>';

        if (!empty($label_text) || !empty($label_css_class)) 
            $ret_val .= sprintf("<span class='%s'>%s</span>", $label_css_class, $label_text);

        if (!empty($field_value)) 
            $ret_val .= $field_value;
        if ($paragraph)
            $ret_val .= '</p>';
        if (!empty($container_css_class))
            $ret_val .= '</div>';
        $ret_val = apply_filters('byt_render_labeled_field_value', $ret_val, $container_css_class, $label_css_class, $label_text, $field_value, $header_text, $paragraph);

        echo $ret_val;
    }
}

/**
 * Function that renders image tag in the form of
 * <img class="image_css_class" id="$image_id" src="$image_src" title="$image_title" alt="$image_alt" />
 */
function byt_render_image($image_css_class, $image_id, $image_src, $image_title, $image_alt, $echo = true) {
    if ( !empty( $image_src) ) {
        $ret_val = sprintf("<img class='%s' id='%s' src='%s' title='%s' alt='%s' />", $image_css_class, $image_id, $image_src, $image_title, $image_alt);
        $ret_val = apply_filters('byt_render_image', $ret_val, $image_css_class, $image_id, $image_src, $image_title, $image_alt);
        if ($echo)
            echo $ret_val;
        else
            return $ret_val;
    }
    return "";
}

/**
 * Function that renders list item in the form of
 * <li class="item_css_class" id="$item_id">$item_content</li>
 */
function byt_render_list_item($page_post_type, $item_css_class, $item_id, $item_content) {
    $ret_val = sprintf("<li class='%s' id='%s'>%s</li>", $item_css_class, $item_id, $item_content);
    $ret_val = apply_filters('byt_render_list_item', $ret_val, $page_post_type, $item_css_class, $item_id, $item_content);
    echo $ret_val;
}

/**
 * Function that renders link button in the form of
 * <a href="$href" class="$link_css_class" id="$link_id" title="$text">$text</a>
 */
function byt_render_link_button($href, $link_css_class, $link_id, $text)  {
    $ret_val = sprintf("<a href='%s' class='%s' ", $href, $link_css_class);
    if (!empty($link_id))
        $ret_val .= sprintf(" id='%s' ", $link_id);
    $ret_val .= sprintf(" title='%s'>%s</a>", $text, $text);

    $ret_val = apply_filters('byt_render_link_button', $ret_val, $href, $link_css_class, $link_id, $text);
    echo $ret_val;
}

/**
 * Function that renders submit button in the form of
 * <input type="submit" value="$text" id="$submit_id" name="$submit_id" class="$submit_css_class" />
 */
function byt_render_submit_button($submit_css_class, $submit_id, $text)  {
    $ret_val = sprintf("<input type='submit' class='%s' id='%s' name='%s' value='%s' />", $submit_css_class, $submit_id, $submit_id, $text);
    $ret_val = apply_filters('byt_render_link_button', $ret_val, $submit_css_class, $submit_id, $submit_id, $text);
    echo $ret_val;
}
?>
解析错误:语法错误,第1行/home1/mudinta/public\u html/wp content/themes/BookYourTravel/includes/theme\u filters.php中出现意外的“函数”(T_function)

theme_filter.php文件代码如下:

<?php

/**
 * Remove password email text if option for users to set their own password is enabled in Theme settings.
 */
function remove_password_email_text ( $text ) {
    $let_users_set_pass = of_get_option('let_users_set_pass', 0);
    if ($text == 'A password will be e-mailed to you.' && $let_users_set_pass)
        $text = '';
    return $text;
}
add_filter( 'gettext', 'remove_password_email_text' );

/**
 * Function that renders labeled field in the form of
 * <div class="container_css_class"><span>$label_text</span> $field_value</div>
 */
function byt_render_labeled_field_value($container_css_class, $label_css_class, $label_text, $field_value, $header_text = '', $paragraph = false) {
    if (!empty($field_value) || !empty($label_text)) {
        $ret_val = '';

        if (!empty($header_text))
            $ret_val = sprintf("<h1>%s</h1>", $header_text);

        if (!empty($container_css_class))
            $ret_val .= sprintf("<div class='%s'>", $container_css_class);

        if ($paragraph)
            $ret_val .= '<p>';

        if (!empty($label_text) || !empty($label_css_class)) 
            $ret_val .= sprintf("<span class='%s'>%s</span>", $label_css_class, $label_text);

        if (!empty($field_value)) 
            $ret_val .= $field_value;
        if ($paragraph)
            $ret_val .= '</p>';
        if (!empty($container_css_class))
            $ret_val .= '</div>';
        $ret_val = apply_filters('byt_render_labeled_field_value', $ret_val, $container_css_class, $label_css_class, $label_text, $field_value, $header_text, $paragraph);

        echo $ret_val;
    }
}

/**
 * Function that renders image tag in the form of
 * <img class="image_css_class" id="$image_id" src="$image_src" title="$image_title" alt="$image_alt" />
 */
function byt_render_image($image_css_class, $image_id, $image_src, $image_title, $image_alt, $echo = true) {
    if ( !empty( $image_src) ) {
        $ret_val = sprintf("<img class='%s' id='%s' src='%s' title='%s' alt='%s' />", $image_css_class, $image_id, $image_src, $image_title, $image_alt);
        $ret_val = apply_filters('byt_render_image', $ret_val, $image_css_class, $image_id, $image_src, $image_title, $image_alt);
        if ($echo)
            echo $ret_val;
        else
            return $ret_val;
    }
    return "";
}

/**
 * Function that renders list item in the form of
 * <li class="item_css_class" id="$item_id">$item_content</li>
 */
function byt_render_list_item($page_post_type, $item_css_class, $item_id, $item_content) {
    $ret_val = sprintf("<li class='%s' id='%s'>%s</li>", $item_css_class, $item_id, $item_content);
    $ret_val = apply_filters('byt_render_list_item', $ret_val, $page_post_type, $item_css_class, $item_id, $item_content);
    echo $ret_val;
}

/**
 * Function that renders link button in the form of
 * <a href="$href" class="$link_css_class" id="$link_id" title="$text">$text</a>
 */
function byt_render_link_button($href, $link_css_class, $link_id, $text)  {
    $ret_val = sprintf("<a href='%s' class='%s' ", $href, $link_css_class);
    if (!empty($link_id))
        $ret_val .= sprintf(" id='%s' ", $link_id);
    $ret_val .= sprintf(" title='%s'>%s</a>", $text, $text);

    $ret_val = apply_filters('byt_render_link_button', $ret_val, $href, $link_css_class, $link_id, $text);
    echo $ret_val;
}

/**
 * Function that renders submit button in the form of
 * <input type="submit" value="$text" id="$submit_id" name="$submit_id" class="$submit_css_class" />
 */
function byt_render_submit_button($submit_css_class, $submit_id, $text)  {
    $ret_val = sprintf("<input type='submit' class='%s' id='%s' name='%s' value='%s' />", $submit_css_class, $submit_id, $submit_id, $text);
    $ret_val = apply_filters('byt_render_link_button', $ret_val, $submit_css_class, $submit_id, $submit_id, $text);
    echo $ret_val;
}
?>

当我将文件上载到服务器时,它会将文件代码转换为以下单行:

<?php/*some comment here*/function xyz...?>
<?php 
/*some comment here*/

function xyz...
.
.
.
?>

我将代码格式化如下:

<?php/*some comment here*/function xyz...?>
<?php 
/*some comment here*/

function xyz...
.
.
.
?>


这对我来说很好。

感谢您的回复,但我没有从您提供的WAMP服务器上获得任何解决方案,因为此代码在本地计算机上的WAMP服务器上运行,但在live服务器上显示错误。可能是这样。这个文件是如何包含的?