BP_Media_Component:: setup_globals (数组args美元数组()

设置组件全局数据。

描述

另请参阅

参数

args美元

数组(可选)看到BP_Component: setup_globals ()一个描述。

默认值:数组()

文件:bp-media /类/ class-bp-media-component.php

公共函数setup_globals($args = array()) {$bp = buddypress();//如果需要,定义一个鼻涕虫。如果(!define('BP_MEDIA_SLUG')) {define('BP_MEDIA_SLUG', $this->id);} //媒体组件的全局表。$bp->table_prefix . $bp->table_prefix . $bp->table_prefix . $bp->table_prefix . $'bp_media', 'table_name_albums' => $bp->table_prefix . txt '“bp_media_albums”);//获取默认目录标题。$ default_directory_titles = bp_core_get_directory_page_default_titles (); $default_directory_title = $default_directory_titles[$this->id]; // All globals for media component. // Note that global_tables is included in this array. parent::setup_globals( array( 'slug' => 'photos', 'root_slug' => isset( $bp->pages->media->slug ) ? $bp->pages->media->slug : BP_MEDIA_SLUG, 'has_directory' => true, // 'notification_callback' => 'bp_media_format_notifications', 'global_tables' => $global_tables, 'directory_title' => isset( $bp->pages->media->title ) ? $bp->pages->media->title : $default_directory_title, 'search_string' => __( 'Search Photos…', 'buddyboss' ), ) ); /* Single Album Globals **********************************************/ // Are we viewing a single album? if ( bp_is_media_component() && bp_is_single_album() && ( $album_id = BP_Media_Album::album_exists( bp_action_variable( 0 ) ) ) ) { $bp->is_single_item = true; $this->current_album = albums_get_album( $album_id ); // Set current_album to 0 to prevent debug errors. } else { $this->current_album = 0; } }

更新日志

更新日志
版本 描述
BuddyBoss 1.0.0 介绍了。

问题吗?

我们总是很乐意帮助您解决代码或其他问题!搜索我们的开发人员文档联络支持,或与我们联系销售团队