Support » Fixing WordPress » Feed Validation Re-visited! Where does my language go?

  • Resolved Rev. Voodoo

    (@rvoodoo)


    OK, I posted about this years ago, never have I gotten this fixed.

    Just wondering if anyone has any ideas. My feed never validates because the language goes missing

    This feed does not validate.
    
    line 18, column 11: language must be an ISO-639 language code: [help]
    
    	<language></language>

    So, back in the day I would go into the options menu and manually update it every time it went away. Then after a while I just used a mysql query to update it whenever I noticed it missing.

    Still…it keeps disappearing. So I finally made it easy on myself and added an item to my settings->reading menu

    // ADDS RSS LANGUAGE OPTION TO READING SETTINGS
    function voodoo_rss_language_string() {
    	?>
    	<input name="rss_language" type="text" id="rss_language" value="<?php form_option('rss_language'); ?>" class="regular-text" />
    	<span class="description"><?php _e('RSS supports multiple languages through the language element, which contains a short code that identifies that the natural language employed in the channel. See on this table for your <a href="http://www.rssboard.org/rss-language-codes#table">language codes</a>.'); ?></span>
    	<?php
    }

    Like so. Now while this is pretty darned convenient…. I find I have to do this every time I check my feed in the validator. Anybody have any idea where the crap my language keeps going?

    Thansk folks!

Viewing 6 replies - 16 through 21 (of 21 total)
  • off the top of my head:

    add_action('init','fix_my_rss_please');
    function fix_my_rss_please(){
    	$testrss=get_option('rss_language');
    	if($testrss!='en'){
    		update_option('rss_language','en');
    		wp_mail('EMAIL ADDRESS', 'rss language lost again','but I auto fixed it');
    	}
    }

    Thread Starter Rev. Voodoo

    (@rvoodoo)

    OK, its in place, thanks very much….. lets see what happens!

    Don’t forget to change ‘EMAIL ADDRESS’

    and it wasn’t quite off the top of my head, but you could do a quick test by deleting, or setting the option rss_language to something else.

    Thread Starter Rev. Voodoo

    (@rvoodoo)

    yeah, I adjusted the language to en-us, and put my email in there, thanks!

    Will give it a test now!

    Thread Starter Rev. Voodoo

    (@rvoodoo)

    Nice, it works, fixes my language, and sends me an email!

    Thanks very much. I’ll consider this solved for my purposes. But next time the lang gets lost, I’ll try to track down what happened and revisit this thread

    Thread Starter Rev. Voodoo

    (@rvoodoo)

    Ah hah! It just happened again, for the first time since this thread. I can’t find anything causing it to happen. It was the middle of the day. I wasn’t working on the site, nothing had been changed, I can’t find anything that had occurred to cause it!

    But, thanks to the above code, at least its a non-issue

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Feed Validation Re-visited! Where does my language go?’ is closed to new replies.