Ошибка синтаксического анализа: синтаксическая ошибка, неожиданный конец $ в functions.php в строке 90

<?php

global $oswcPostTypes;



//this is the folder that houses the function files to include

define('functions', TEMPLATEPATH . '/functions');



function fixObject (&$object)

{

if (!is_object ($object) && gettype ($object) == 'object')

return ($object = unserialize (serialize ($object)));

return $object;

}



$lang = TEMPLATEPATH . '/lang';

load_theme_textdomain('made', $lang);



//Get the post type functions

require_once(functions . '/oswc-post-types.php');



//Get the theme options

require_once(functions . '/theme-options.php');



//Get the review options

require_once(functions . '/review-options.php');



//Get the widgets

require_once(functions . '/widgets.php');



//Get the custom functions

require_once(functions . '/custom.php');



//Get the shortcodes

require_once(functions . '/shortcodes.php');



//Get the post type functions

require_once(functions . '/post-types.php');



//Get the post & page meta boxes

require_once(functions . '/meta-boxes.php');



//notifies users of updates

require('update-notifier.php');

//gallery

function my_gallery_to_slideshow_has_gallery( $params ){

return true;
**//this is the line 90 :(**
}

add_filter( 'mv_gallery_to_slideshow_has_gallery',    'my_gallery_to_slideshow_has_gallery' );



// average rating shortcode

function get_ppic(){

echo do_action( 'wordpress_social_login' );

}

add_shortcode('via-twitter','get_ppic');



function limit_posts_per_archive_page() {

if ( is_category() )

    set_query_var('posts_per_archive_page', 9); // or use variable key:     posts_per_page

}



add_filter('pre_get_posts', 'limit_posts_per_archive_page');



function the_slug() 

{

$abc = $_GET['post_id'];    

$post_data = get_post($abc, ARRAY_A);   

$slug = $post_data['post_name'];    

return $slug; 

}



function category_has_parent($catid){

$category = get_category($catid);

if ($category->category_parent > 0){

    return true;

}

return false;

}

/*Created by Albert*/

/конец/

add_action('frm_after_create_entry', 'copy_into_my_table', 20, 2);

function copy_into_my_table($entry_id, $form_id){

if($form_id == 6){ //change 4 to the form id of the form to copy

global $wpdb;

$values = array('c_id' => NULL, 'review_title' => $_POST['item_meta'][86], 'post_title'    => $_POST['item_meta'][129], 'post_id' => $_POST['item_meta'][94]);

//replace 25 and 26 with the field ids of the Formidable form. Change col_name to the   column names in your table

$wpdb->insert('wp_magic_competition', $values);

 }

}

<!-- added -->
add_filter('frm_get_default_value', 'my_custom_default_value', 10, 2);
function my_custom_default_value($new_value, $field){
if($field->id == 25){ //change 25 to the ID of the field
$new_value = 'custom default'; //set your custom value here
}
return $new_value;
}
<!-- added -->

?>

Не могу найти причину ошибки. У меня возникла ошибка после добавления кода внутрь. Кто-нибудь может мне помочь. : синтаксическая ошибка, неожиданный конец $ в /home/wpperhou/public_html/dev/aor/thesports/wp-content/themes/made/functions.php в строке 90


person user1840986    schedule 21.11.2012    source источник
comment
Я предполагаю, что код, который вы нам показали, не из functions.php, где и возникает ошибка. Вы должны показать нам, что находится около строки 90 в functions.php.   -  person Brian Graham    schedule 21.11.2012
comment
Вы можете показать, какая строка 90?   -  person Yogesh Suthar    schedule 21.11.2012
comment
после возврата true; внутренняя функция my_gallery_to_slideshow_has_gallery($params)   -  person user1840986    schedule 21.11.2012
comment
Может попробовать перезалить файл? Потому что, если первый блок кода — это полное содержимое вашего файла functions.php, то это не должно вызывать фатальную ошибку с неожиданным $end. Обычно это происходит, когда вы не закрыли блок кода (будь то if while for foreach...), что может произойти, если ваша загрузка по какой-то причине не удалась в середине (чаще всего я видел эти ошибки, когда файл загружается, но я думаю, что это не проблема сейчас).   -  person Nikola Ivanov Nikolov    schedule 21.11.2012


Ответы (2)


Я думаю, что это:

function limit_posts_per_archive_page() {

if ( is_category() )

    set_query_var('posts_per_archive_page', 9); // or use variable key:     posts_per_page

}



add_filter('pre_get_posts', 'limit_posts_per_archive_page');

Я не вижу закрывающего } для функции.

Я собираюсь предположить, что это должно исправить это:

function limit_posts_per_archive_page() {

if ( is_category() )

    set_query_var('posts_per_archive_page', 9); // or use variable key:     posts_per_page

}

}

add_filter('pre_get_posts', 'limit_posts_per_archive_page');

РЕДАКТИРОВАТЬ: Игнорируйте это, это совершенно неправильно. Я не из тех, кто без фигурных скобок, черт возьми! (оставлю это здесь для лолза)

person Dale    schedule 21.11.2012

Можешь ли ты попытаться

  • Добавьте закрывающий тег PHP (?>) в конец файла.
  • Перезалейте файл на сервер. Иногда я получаю ту же ошибку, что и вы, и это помогает. Это может быть вызвано ошибкой ftp.

Максим

person Maxime    schedule 21.11.2012