1. PHP / Говнокод #11758

    +49

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    wordpress:
    function __( $text, $domain = 'default' ) {
    	        return translate( $text, $domain );
    }
    
    function translate( $text, $domain = 'default' ) {
    	        $translations = &get_translations_for_domain( $domain );
    	        return apply_filters( 'gettext', $translations->translate( $text ), $text, $domain );
    }
    
    PHP-manual:
    PHP reserves all function names starting with __ as magical. It is recommended that you do not use function names with __ in PHP unless you want some documented magic functionality. 
    
    wordpress:
    /*
    * Don't use translate() directly, use __()
    */

    Запостил: xcont, 12 Сентября 2012

    Комментарии (8) RSS

    Добавить комментарий