Ticket #1057: rosetta-docs.patch
File rosetta-docs.patch, 2.1 KB (added by , 10 years ago) |
---|
-
functions.php
7 7 $content_width = 692; 8 8 } 9 9 10 10 11 /** 11 12 * Sets up theme defaults and registers support for various WordPress features. 12 13 */ … … 32 33 } 33 34 add_action( 'after_setup_theme', 'rosetta_after_setup_theme' ); 34 35 36 37 /** 38 * Add comments hint. 39 */ 35 40 function rosetta_comment_form_support_hint() { 36 41 printf( 37 42 '<p>%s</p>', … … 41 46 } 42 47 add_action( 'comment_form_top', 'rosetta_comment_form_support_hint' ); 43 48 49 50 /** 51 * Show home page link in admin menus. 52 */ 44 53 function rosetta_wp_page_menu_args( $args ) { 45 54 $args['show_home'] = true; 46 55 return $args; … … 47 56 } 48 57 add_filter( 'wp_page_menu_args', 'rosetta_wp_page_menu_args' ); 49 58 59 60 /** 61 * Add navigation JS to admin footer. 62 */ 50 63 function rosetta_admin_footer_nav_menus() { 51 64 echo '<script> wpNavMenu.options.globalMaxDepth = 0; </script>'; 52 65 } 53 66 add_action( 'admin_footer-nav-menus.php', 'rosetta_admin_footer_nav_menus' ); 54 67 68 69 /** 70 * Add custom classes to <body> tag. 71 */ 55 72 function rosetta_body_class( $classes ) { 56 73 $classes[] = 'wporg-responsive'; 57 74 $classes[] = 'wporg-international'; … … 59 76 } 60 77 add_filter( 'body_class', 'rosetta_body_class' ); 61 78 79 80 /** 81 * Check if locale css exists. 82 */ 62 83 function is_locale_css() { 63 84 global $rosetta; 64 85 return file_exists( WP_LANG_DIR . '/css/' . $rosetta->locale . '.css' ); 65 86 } 66 87 88 89 /** 90 * Return locale css URL. 91 */ 67 92 function get_locale_css_url() { 68 93 global $rosetta; 69 94 return set_url_scheme( WP_LANG_URL . '/css/' . $rosetta->locale . '.css?' . filemtime( WP_LANG_DIR . '/css/' . $rosetta->locale . '.css' ) ); 70 95 } 71 96 72 // Makes final space a non-breaking one, to prevent orphaned word. 97 98 /** 99 * Makes final space a non-breaking one, to prevent orphaned word. 100 */ 73 101 function rosetta_orphan_control( $string ) { 74 102 return substr_replace( $string, ' ', strrpos( $string, ' ' ), 1 ); 75 103 } 76 104 add_filter( 'no_orphans', 'rosetta_orphan_control' ); 77 105 106 78 107 /** 79 108 * Custom template tags for this theme. 80 109 */