• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bp_attachments_is_wp_version_supported函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中bp_attachments_is_wp_version_supported函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_attachments_is_wp_version_supported函数的具体用法?PHP bp_attachments_is_wp_version_supported怎么用?PHP bp_attachments_is_wp_version_supported使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了bp_attachments_is_wp_version_supported函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: bp_avatar_is_front_edit

/**
 * Checks whether Avatar UI should be loaded.
 *
 * @since  2.3.0
 *
 * @return bool True if Avatar UI should load, false otherwise.
 */
function bp_avatar_is_front_edit()
{
    $retval = false;
    // No need to carry on if the current WordPress version is not supported.
    if (!bp_attachments_is_wp_version_supported()) {
        return $retval;
    }
    if (bp_is_user_change_avatar() && 'crop-image' !== bp_get_avatar_admin_step()) {
        $retval = !bp_core_get_root_option('bp-disable-avatar-uploads');
    }
    if (bp_is_active('groups')) {
        // Group creation
        if (bp_is_group_create() && bp_is_group_creation_step('group-avatar') && 'crop-image' !== bp_get_avatar_admin_step()) {
            $retval = !bp_disable_group_avatar_uploads();
            // Group Manage
        } elseif (bp_is_group_admin_page() && bp_is_group_admin_screen('group-avatar') && 'crop-image' !== bp_get_avatar_admin_step()) {
            $retval = !bp_disable_group_avatar_uploads();
        }
    }
    /**
     * Use this filter if you need to :
     * - Load the avatar UI for a component that is !groups or !user (return true regarding your conditions)
     * - Completely disable the avatar UI introduced in 2.3 (eg: __return_false())
     *
     * @since  2.3.0
     *
     * @param bool whether to load the Avatar UI.
     */
    return apply_filters('bp_avatar_is_front_edit', $retval);
}
开发者ID:toby-bushell,项目名称:triumph,代码行数:37,代码来源:bp-core-avatars.php


示例2: user_admin_avatar_metabox

        /**
         * Render the Avatar metabox to moderate inappropriate images.
         *
         * @since 2.0.0
         *
         * @param WP_User|null $user The WP_User object for the user being edited.
         */
        public function user_admin_avatar_metabox($user = null)
        {
            if (empty($user->ID)) {
                return;
            }
            ?>

		<div class="avatar">

			<?php 
            echo bp_core_fetch_avatar(array('item_id' => $user->ID, 'object' => 'user', 'type' => 'full', 'title' => $user->display_name));
            ?>

			<?php 
            if (bp_get_user_has_avatar($user->ID)) {
                $query_args = array('user_id' => $user->ID, 'action' => 'delete_avatar');
                if (!empty($_REQUEST['wp_http_referer'])) {
                    $query_args['wp_http_referer'] = urlencode(wp_unslash($_REQUEST['wp_http_referer']));
                }
                $community_url = add_query_arg($query_args, buddypress()->members->admin->edit_profile_url);
                $delete_link = wp_nonce_url($community_url, 'delete_avatar');
                ?>

				<a href="<?php 
                echo esc_url($delete_link);
                ?>
" title="<?php 
                esc_attr_e('Delete Profile Photo', 'buddypress');
                ?>
" class="bp-xprofile-avatar-user-admin"><?php 
                esc_html_e('Delete Profile Photo', 'buddypress');
                ?>
</a>

			<?php 
            }
            // Load the Avatar UI templates if user avatar uploads are enabled and current WordPress version is supported.
            if (!bp_core_get_root_option('bp-disable-avatar-uploads') && bp_attachments_is_wp_version_supported()) {
                ?>
				<a href="#TB_inline?width=800px&height=400px&inlineId=bp-xprofile-avatar-editor" title="<?php 
                esc_attr_e('Edit Profile Photo', 'buddypress');
                ?>
" class="thickbox bp-xprofile-avatar-user-edit"><?php 
                esc_html_e('Edit Profile Photo', 'buddypress');
                ?>
</a>
				<div id="bp-xprofile-avatar-editor" style="display:none;">
					<?php 
                bp_attachments_get_template_part('avatars/index');
                ?>
				</div>
			<?php 
            }
            ?>

		</div>
		<?php 
        }
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:65,代码来源:class-bp-xprofile-user-admin.php


示例3: bp_group_use_cover_image_header

/**
 * Should we use the group's cover image header.
 *
 * @since 2.4.0
 *
 * @return bool True if the displayed user has a cover image,
 *              False otherwise
 */
function bp_group_use_cover_image_header()
{
    return (bool) bp_is_active('groups', 'cover_image') && !bp_disable_group_cover_image_uploads() && bp_attachments_is_wp_version_supported();
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:12,代码来源:bp-groups-template.php


示例4: bp_displayed_user_use_cover_image_header

/**
 * Should we use the cover image header
 *
 * @since 2.4.0
 *
 * @return bool True if the displayed user has a cover image,
 *              False otherwise
 */
function bp_displayed_user_use_cover_image_header()
{
    return (bool) bp_is_active('xprofile', 'cover_image') && !bp_disable_cover_image_uploads() && bp_attachments_is_wp_version_supported();
}
开发者ID:mawilliamson,项目名称:wordpress,代码行数:12,代码来源:bp-members-template.php



注:本文中的bp_attachments_is_wp_version_supported函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bp_avatar_delete_link函数代码示例发布时间:2022-05-24
下一篇:
PHP bp_attachments_get_template_part函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap