WordPress.org

Making WordPress.org

Ticket #1057: rosetta-docs.patch

File rosetta-docs.patch, 2.1 KB (added by ramiy, 6 years ago)
  • functions.php

     
    77        $content_width = 692;
    88}
    99
     10
    1011/**
    1112 * Sets up theme defaults and registers support for various WordPress features.
    1213 */
     
    3233}
    3334add_action( 'after_setup_theme', 'rosetta_after_setup_theme' );
    3435
     36
     37/**
     38 * Add comments hint.
     39 */
    3540function rosetta_comment_form_support_hint() {
    3641        printf(
    3742                '<p>%s</p>',
     
    4146}
    4247add_action( 'comment_form_top', 'rosetta_comment_form_support_hint' );
    4348
     49
     50/**
     51 * Show home page link in admin menus.
     52 */
    4453function rosetta_wp_page_menu_args( $args ) {
    4554        $args['show_home'] = true;
    4655        return $args;
     
    4756}
    4857add_filter( 'wp_page_menu_args', 'rosetta_wp_page_menu_args' );
    4958
     59
     60/**
     61 * Add navigation JS to admin footer.
     62 */
    5063function rosetta_admin_footer_nav_menus() {
    5164        echo '<script> wpNavMenu.options.globalMaxDepth = 0; </script>';
    5265}
    5366add_action( 'admin_footer-nav-menus.php', 'rosetta_admin_footer_nav_menus' );
    5467
     68
     69/**
     70 * Add custom classes to <body> tag.
     71 */
    5572function rosetta_body_class( $classes ) {
    5673        $classes[] = 'wporg-responsive';
    5774        $classes[] = 'wporg-international';
     
    5976}
    6077add_filter( 'body_class', 'rosetta_body_class' );
    6178
     79
     80/**
     81 * Check if locale css exists.
     82 */
    6283function is_locale_css() {
    6384        global $rosetta;
    6485        return file_exists( WP_LANG_DIR . '/css/' . $rosetta->locale . '.css' );
    6586}
    6687
     88
     89/**
     90 * Return locale css URL.
     91 */
    6792function get_locale_css_url() {
    6893        global $rosetta;
    6994        return set_url_scheme( WP_LANG_URL . '/css/' . $rosetta->locale . '.css?' . filemtime( WP_LANG_DIR . '/css/' . $rosetta->locale . '.css' ) );
    7095}
    7196
    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 */
    73101function rosetta_orphan_control( $string ) {
    74102        return substr_replace( $string, '&nbsp;', strrpos( $string, ' ' ), 1 );
    75103}
    76104add_filter( 'no_orphans', 'rosetta_orphan_control' );
    77105
     106
    78107/**
    79108 * Custom template tags for this theme.
    80109 */