Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

syntax error, unexpected T_CONSTANT_ENCAPSED_STRING on line 3


mao_

Recommended Posts

add_filter( 'body_class', create_function( '$classes = ''', '$classes[] = 'wpsc' ; 'return $classes';' ) );

 

You have ' embedded within a '-delimited string. Try this:

add_filter( 'body_class', create_function( '$classes = \'\'', '$classes[] = \'wpsc\' ; return $classes;' ) );

 

Now, I'm not sure that a default value can be set for the arguments ($classes), and it's not clear what you're trying to do here. If $classes is an array, are you adding a new element 'wpsc' to it? Are you trying to modify the argument (parameter) itself, or pass the enlarged array back to somewhere else, who will deal with replacing the old $classes?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...