Пример #1
0
" src="<?php 
        echo esc_attr($img_src);
        ?>
" />
	<?php 
    }
    ?>
	</div>
	<div style="clear: left"></div>

	<input type="submit" name="achievement-change-picture" id="achievement-change-picture" value="<?php 
    _e('Update Picture', 'dpa');
    ?>
">
	<input type="hidden" name="picture_id" id="picture_id" value="<?php 
    echo esc_attr(dpa_get_achievement_picture_id());
    ?>
" />

	<?php 
    nxt_nonce_field('achievement-change-picture-' . dpa_get_achievement_slug());
    ?>
	</form>

	<div id="pag-bottom" class="pagination no-ajax">
		<div class="pag-count" id="achievement-change-picture-dir-count">
			<?php 
    dpa_change_picture_pagination_count();
    ?>
		</div>
/**
 * Returns width of the Achievement's picture
 *
 * @since 2.0
 * @global DPA_Achievement_Template $achievements_template Achievements template tag object
 * @return int
 */
function dpa_get_achievement_picture_width()
{
    $is_thumbnail = dpa_get_achievement_picture_is_thumbnail();
    $picture_id = dpa_get_achievement_picture_id();
    if ($picture_id < 1) {
        if ($is_thumbnail) {
            $width = apply_filters('dpa_get_achievement_picture_gravatar_width', BP_AVATAR_THUMB_WIDTH, 'thumb');
        } else {
            $width = apply_filters('dpa_get_achievement_picture_gravatar_width', BP_AVATAR_FULL_WIDTH, 'full');
        }
    } else {
        if ($is_thumbnail) {
            $width = apply_filters('dpa_get_achievement_picture_width', BP_AVATAR_THUMB_WIDTH, 'thumb');
        } else {
            list($url, $width, $height) = nxt_get_attachment_image_src($picture_id, 'full');
            $width = apply_filters('dpa_get_achievement_picture_width', $width, 'full');
        }
    }
    return apply_filters('dpa_get_achievement_picture_width', $width);
}