regionhalland/region-halland-plugin-acf-site-settings-front-logo

上传您的网站前端logo

v1.2.0 2020-08-31 08:11 UTC

This package is auto-updated.

Last update: 2024-09-29 05:48:45 UTC


README

如何使用Region Hallands插件"RhAcfSiteSettingsFrontLogo"

以下是如何使用"RhAcfSiteSettingsFrontLogo"插件的说明。

应用范围

此插件返回一个包含上传图片数据的数组

许可模式

此插件使用GPL-3.0许可模式。您可以通过随附的文件了解更多关于此许可模式的信息

LICENSE (https://regionhalland.visualstudio.com/public.RhWpPlugIns/_git/RhAcfSiteSettingsFrontLogo?path=%2FLICENSE&version=GBmaster)

安装和激活

A) Hämta pluginen via Git eller läs in det med Composer
B) Installera Region Hallands plugin i Wordpress plugin folder
C) Aktivera pluginet inifrån Wordpress admin

通过Git下载插件

git https://regionhalland.visualstudio.com/public.RhWpPlugIns/_git/RhAcfSiteSettingsFrontLogo

通过composer导入插件

这些部分需要添加到您的composer文件中

Repositories = 插件存储的位置,在本例中为github

"repositories": [
  {
    "type": "vcs",
    "url": "https://regionhalland.visualstudio.com/public.RhWpPlugIns/_git/RhAcfSiteSettingsFrontLogo"
  },
],

Require = 指定您想要使用的插件版本,在本例中为1.0.0

注意!请确保您获取了最新版本。

"require": {
  "regionhalland/region-halland-plugin-acf-site-settings-front-logo: "1.0.0"
},

通过"Blade"显示图片和链接

@if(function_exists('get_region_halland_acf_site_settings_front_logo'))
  @php($myLogo = get_region_halland_acf_site_settings_front_logo())
  @if($myLogo['has-logo'] == 1)
    <div>
      <a href="{{ $myLogo['home-url'] }}""><img src="{{ $myLogo['image-url'] }}" width="{{ $myLogo['image-width'] }}" height="{{ $myLogo['image-height'] }}"></a>
    </div>
  @endif
@endif

数组的示例

array (size=5)
  'home-url' => string 'http://dev-template.local' (length=25)
  'has-logo' => int 1
  'logo-url' => string 'http://dev-template.local/app/uploads/2020/04/sol-a.jpg' (length=55)
  'logo-width' => int 832
  'logo-height' => int 795
  'logo-alt' => string '' (length=0)

版本历史

1.2.0

  • 图片大小至少为200x200像素,最大为2000x2000像素

1.1.0

  • 添加一个变量以确定是否存在图片

1.0.0

  • 第一个版本包括通过Packagist发布的版本