• Resolved baltaran

    (@baltaran)


    Hi, after having googled for this problem for more than three hours I am podting here in the hope of finding someone to help me. I have installed a fresh wordpress website and I have included tow custom posts. I did everything I could so far to to prevent the following error message to appear in my server error.log:

    [Fri Nov 04 06:03:06 2011] [error] [client 116.28.20.19] PHP Warning: Missing argument 2 for _x(), called in /var/nas/jails/myhost/home/user/www/wp-content/themes/itq/_/inc/custom-posts.php on line 91 and defined in /var/nas/jails/myhost/home/user/www/wp-includes/l10n.php on line 189

    This doesn′t give me any clues of what is going on, but I am sure there is someone out there who can kindly help. Thanks in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Tim S

    (@tim-s)

    Well, let’s break down the error. It’s actually just a php warning so it won’t stop the WordPress installation from functioning. So my next question is, does the site function as you expected?

    Back to the argument, the code is being called in the custom-posts.php file and the argument is defined in the wp-includes/|10n.php file

    So your first step is to review the code in custom-posts.php file on line 91

    If thats correctly coded then go to line 189 of the file that is defining the argument and verify the code is correct there

    Basically, the custom-posts are not passing all the required arguments parameters.

    If this is related to a specific plugin you may need to contact the plugins developers. IF this is custom coded you will need to review your code.

    Thread Starter baltaran

    (@baltaran)

    Hi Tim S and thanks for your quick answer. Yes the site does function to perfection. The only thing is that it annoys me seeing thousands of lines of the same error in my error.log file. I guess I figuered it out buy just changing the _x() prefixes with __() in my custom labels array. so in stead of this:

    'labels' => array(
    	         'name' => _x( 'Super Dupers' ),
    	        'singular_name' => _x( 'Super Duper' )
    		),

    to the following:

    'labels' => array(
    	         'name' => __( 'Super Dupers' ),
    	        'singular_name' => __( 'Super Duper' )
    		),

    Thanks a lot anyway and I hope that this would help others experiencing the same problem.

    Tim S

    (@tim-s)

    No worries! I’m glad you were able to get it resolved. Don’t forget to mark the question resolved, so other know there was a solution.

    Based on the piece of code the OP has posted, he is working through the Lynda.com tutorial on custom post types. I’ve done that one and it does have a glitch in the latest version of WordPress but it’s not WP’s fault.

    If subsequent help seekers find this post, they need to wait for the next chapter when:

    $args = array(
    	'label' => _x('Foos')
    	'singular_label' => _x('Foo')

    Becomes:

    $args = array(
    	'label' => _x('Foos', 'post type general name'),
    	'singular_label' => _x('Foo', 'post type singular name')

    At which point the second argument DOES exist and the error message goes away. By simply eliminating the argument call, they invalidate the custom description of their label.

    Thanks man, you save-me… =D

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘I am getting a strange l10n.php error’ is closed to new replies.