Parse error: syntax error, unexpected 'if' (T_IF)
tridam23
Messages postés
99
Date d'inscription
Statut
Membre
Dernière intervention
-
tridam23 Messages postés 99 Date d'inscription Statut Membre Dernière intervention -
tridam23 Messages postés 99 Date d'inscription Statut Membre Dernière intervention -
Bonjour
j'ai cette erreur :
Parse error: syntax error, unexpected 'if' (T_IF) in /htdocs/wp-content/plugins/cs-framework/include/post-types/campaigns.php on line 1
voici mon code ; un coup de pouce. merci
Est ce une erreur de version php?
sur mon hébergeur il recommande php7
mais je travaille avec xampp et je pense php 5.3
Si c'est cela, comment faire evoluer ce code? merci
j'ai cette erreur :
Parse error: syntax error, unexpected 'if' (T_IF) in /htdocs/wp-content/plugins/cs-framework/include/post-types/campaigns.php on line 1
voici mon code ; un coup de pouce. merci
<?php /** * @Manage Columns * @return * */ if (!class_exists('post_type_campaign')) { class post_type_campaign { // The Constructor public function __construct() { // Adding columns add_filter('manage_campaigns_posts_columns', array(&$this, 'cs_campaigns_columns_add')); add_action('manage_campaigns_posts_custom_column', array(&$this, 'cs_campaigns_columns'), 10, 2); add_action('init', array(&$this, 'cs_campaigns_register')); add_action('init', array(&$this, 'cs_port_cat_register')); } function cs_campaigns_columns_add($columns) { $columns['category'] =__('Categories','cs_frame'); return $columns; } function cs_campaigns_columns($name) { global $post; switch ($name) { case 'category': $categories = get_the_terms( $post->ID, 'campaign-category' ); if($categories <> ""){ $couter_comma = 0; foreach ( $categories as $category ) { echo esc_attr($category->name); $couter_comma++; if ( $couter_comma < count($categories) ) { echo ", "; } } } break; } } /** * @Register Post Type * @return * */ function cs_campaigns_register() { $labels = array( 'name' =>__('Campaigns','cs_frame'), 'all_items' =>__('Campaigns','cs_frame'), 'add_new_item' =>__('Add New Campaign','cs_frame'), 'edit_item' =>__('Edit Campaign','cs_frame'), 'new_item' =>__('New Campaign Item','cs_frame'), 'add_new' =>__('Add New Campaign','cs_frame'), 'view_item' =>__('View Campaign Item','cs_frame'), 'search_items' =>__('Search Campaign','cs_frame'), 'not_found' =>__('Nothing found','cs_frame'), 'not_found_in_trash' =>__('Nothing found in Trash','cs_frame'), 'parent_item_colon' => '' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'menu_icon' => 'dashicons-book', 'rewrite' => true, 'capability_type' => 'post', 'has_archive' => true, 'map_meta_cap' => true, 'hierarchical' => false, 'menu_position' => null, 'can_export' => true, 'supports' => array('title','editor','thumbnail') ); register_post_type( 'campaigns' , $args ); } /** * @Register Categories * @return * */ function cs_port_cat_register() { $labels = array( 'name' =>__('Campaign Categories','cs_frame'), 'search_items' =>__('Search Campaign Categories','cs_frame'), 'edit_item' =>__('Edit Campaign Category','cs_frame'), 'update_item' =>__('Update Campaign Category','cs_frame'), 'add_new_item' =>__('Add New Category','cs_frame'), 'menu_name' =>__('Categories','cs_frame'), ); register_taxonomy('campaign-category',array('campaigns'), array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => 'campaign-category'), )); } } return new post_type_campaign(); }
Est ce une erreur de version php?
sur mon hébergeur il recommande php7
mais je travaille avec xampp et je pense php 5.3
Si c'est cela, comment faire evoluer ce code? merci
A voir également:
- Syntax error, unexpected 'if' (t_if)
- Cmos checksum error ✓ - Forum Carte-mère/mémoire
- Playback error reconnect in 3s (1/5) francais - Forum Box et Streaming vidéo
- Error 1962 ✓ - Forum PC fixe
- Parse error: syntax error, unexpected token "use" ✓ - Forum PHP
- Whea error occt - Forum Processeur