Making WordPress.org


Ignore:
Timestamp:
05/30/2015 10:26:47 PM (10 years ago)
Author:
ocean90
Message:

Rosetta Theme: Enhancements

  • Move sidebar code to its own files.
  • Show blog section on front page only when show_on_front is posts.
  • Add some inline docs.

props ramiy.
fixes #1057, #1051.
see #1049.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/global.wordpress.org/public_html/wp-content/themes/rosetta/functions.php

    r1631 r1641  
    3333add_action( 'after_setup_theme', 'rosetta_after_setup_theme' );
    3434
     35/**
     36 * Prints a hint, which explains that that support questions belong
     37 * to the forums, on top of the comment form.
     38 */
    3539function rosetta_comment_form_support_hint() {
    3640    printf(
     
    4246add_action( 'comment_form_top', 'rosetta_comment_form_support_hint' );
    4347
     48/**
     49 * Show a home link for our wp_nav_menu() fallback, wp_page_menu().
     50 *
     51 * @param array $args An optional array of arguments.
     52 * @return array The filtered array of arguments.
     53 */
    4454function rosetta_wp_page_menu_args( $args ) {
    4555    $args['show_home'] = true;
     
    4858add_filter( 'wp_page_menu_args', 'rosetta_wp_page_menu_args' );
    4959
     60/**
     61 * The nav menu supports only top level menu items.
     62 */
    5063function rosetta_admin_footer_nav_menus() {
    5164    echo '<script> wpNavMenu.options.globalMaxDepth = 0; </script>';
     
    5366add_action( 'admin_footer-nav-menus.php', 'rosetta_admin_footer_nav_menus' );
    5467
     68/**
     69 * Extend the default WordPress body classes.
     70 *
     71 * @param array $classes A list of existing body class values.
     72 * @return array The filtered body class list.
     73 */
    5574function rosetta_body_class( $classes ) {
    5675    $classes[] = 'wporg-responsive';
     
    6079add_filter( 'body_class', 'rosetta_body_class' );
    6180
     81/**
     82 * Checks if locale provides a custom stylesheet.
     83 *
     84 * @return boolean True if file exists, false if not.
     85 */
    6286function is_locale_css() {
    6387    global $rosetta;
     
    6589}
    6690
     91/**
     92 * Returns URL to locale's custom stylesheet.
     93 *
     94 * @return string URL to custom stylesheet.
     95 */
    6796function get_locale_css_url() {
    6897    global $rosetta;
     
    7099}
    71100
    72 // Makes final space a non-breaking one, to prevent orphaned word.
     101/**
     102 * Makes final space a non-breaking one, to prevent orphaned word.
     103 *
     104 * @param string $string
     105 * @return string
     106 */
    73107function rosetta_orphan_control( $string ) {
    74108    return substr_replace( $string, '&nbsp;', strrpos( $string, ' ' ), 1 );
Note: See TracChangeset for help on using the changeset viewer.