Making WordPress.org

Changeset 13559


Ignore:
Timestamp:
04/18/2024 03:16:55 AM (5 months ago)
Author:
adamwood
Message:

wporg-support-2024: :lipstick: Rename functions

Follow theme naming conventions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024/functions.php

    r13552 r13559  
    3232 * Register a local nav menu for non-English forums, if it doesn't already exist.
    3333 */
    34 function register_local_nav_menu() {
     34function wporg_support_register_local_nav_menu() {
    3535    if ( substr( get_locale(), 0, 2 ) === 'en' || get_local_nav_menu_object() ) {
    3636        return;
     
    3939    register_nav_menu( 'local-navigation', __( 'Local Navigation', 'wporg-forums' ) );
    4040}
    41 add_action( 'after_setup_theme', 'register_local_nav_menu' );
     41add_action( 'after_setup_theme', 'wporg_support_register_local_nav_menu' );
    4242
    4343/**
    4444 * Provide a list of local navigation menus.
    4545 */
    46 function add_site_navigation_menus( $menus ) {
     46function wporg_support_add_site_navigation_menus( $menus ) {
    4747    if ( is_admin() ) {
    4848        return;
     
    101101    }
    102102}
    103 add_filter( 'wporg_block_navigation_menus', '\add_site_navigation_menus' );
     103add_filter( 'wporg_block_navigation_menus', 'wporg_support_add_site_navigation_menus' );
    104104
    105105/**
    106106 * Register patterns from the patterns directory.
    107107 */
    108 function register_patterns() {
     108function wporg_support_register_patterns() {
    109109    $pattern_directory = new DirectoryIterator( get_template_directory() . '/patterns/' );
    110110    foreach ( $pattern_directory as $file ) {
     
    114114    }
    115115}
    116 add_action( 'init', 'register_patterns' );
     116add_action( 'init', 'wporg_support_register_patterns' );
    117117
    118118/**
     
    181181 * @return WP_Theme_JSON_Data The updated theme.json settings.
    182182 */
    183 function merge_parent_support_theme_json( $theme_json ) {
     183function wporg_support_merge_parent_support_theme_json( $theme_json ) {
    184184    $support_theme_json_data = $theme_json->get_data();
    185185    $parent_theme_json_data = json_decode( file_get_contents( get_theme_root( 'wporg-parent-2021' ) . '/wporg-parent-2021/theme.json' ), true );
     
    213213
    214214}
    215 add_filter( 'wp_theme_json_data_theme', 'merge_parent_support_theme_json' );
     215add_filter( 'wp_theme_json_data_theme', 'wporg_support_merge_parent_support_theme_json' );
    216216
    217217/**
Note: See TracChangeset for help on using the changeset viewer.