Forums

"Fatal error: Call to undefined function: _x() in /wp-admin/menu.php on line 35" (3 posts)

  1. bydorian
    Member
    Posted 5 months ago #

    Hello (i'm french),

    I have just upgrade my wordpress 2.7 to 2.8, but after this installation, only the public interface works.
    When i connect myselft to /wp-admin/, i have this message :

    Fatal error: Call to undefined function: _x() in (...)/wp-admin/menu.php on line 35

    I have learned PHP, so i can modify files, but i don't want to crash my website.

    Thanks.

    Edit : this is the menu.php code :

    <?php
    /**
     * Build Administration Menu.
     *
     * @package WordPress
     * @subpackage Administration
     */
    
    /**
     * Constructs the admin menu bar.
     *
     * The elements in the array are :
     *     0: Menu item name
     *     1: Minimum level or capability required.
     *     2: The URL of the item's file
     *     3: Class
     *     4: ID
     *     5: Icon for top level menu
     *
     * @global array $menu
     * @name $menu
     * @var array
     */
    
    $awaiting_mod = wp_count_comments();
    $awaiting_mod = $awaiting_mod->moderated;
    
    $menu[0] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top', 'menu-dashboard', 'div' );
    
    $menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
    
    $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top', 'menu-posts', 'div' );
    	$submenu['edit.php'][5]  = array( __('Edit'), 'edit_posts', 'edit.php' );
    	/* translators: add new post */
    	$submenu['edit.php'][10]  = array( _x('Add New', 'post'), 'edit_posts', 'post-new.php' );
    
    	$i = 15;
    	foreach ( $wp_taxonomies as $tax ) {
    		if ( $tax->hierarchical || ! in_array('post', (array) $tax->object_type, true) )
    			continue;
    
    		$submenu['edit.php'][$i] = array( esc_attr($tax->label), 'manage_categories', 'edit-tags.php?taxonomy=' . $tax->name );
    		++$i;
    	}

    (...)

    If i comment the line 35, the next error is the line 42 with esc_attr() witch is not declared.

    I don't know the structure of Wordpress but it's may be a core file that missed.

  2. esmi
    Member
    Posted 4 months ago #

    Try manually re-uploading the wp-admin and wp-includes folders for WP2.8.

  3. maisondouf
    Member
    Posted 4 months ago #

    Hi,

    For me it's not the same problem, but this function don't run correctly.

    With the same call _x( 'Add New', 'post' ), the function have to return somthing like "Add New Post" and for me it return only "Add New".

    In English version, this is not really a major problem, but in other languages for example in French, the function would return "Ajouter un article" and always return "Add New" in english.

    Someones says that the format of the .MO file is bad, but I see the bug in English original version.

    I don't unterstand the comment above the function in l10n.php, I try to add a '|' in the message like for _c function, but no result.

    Bye, Alain

Reply

You must log in to post.

About this Topic