regionhalland/region-halland-plugin-nav-menu-parent-page

前端插件,从WP菜单返回当前页面的父级

v1.0.0 2020-04-28 15:33 UTC

This package is auto-updated.

Last update: 2024-09-29 01:43:55 UTC


README

如何使用Region Halland的插件"RhNavMenuParentPage"

以下是如何使用"RhNavMenuParentPage"插件的操作说明。

使用范围

此插件创建一个数组(),包含从wp-menu获取的当前页面的父级

许可证模型

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

LICENSE (https://regionhalland.visualstudio.com/public.RhWpPlugIns/_git/RhNavMenuParentPage?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/RhNavMenuParentPage

通过composer导入插件

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

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

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

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

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

"require": {
  "regionhalland/region-halland-plugin-nav-menu-parent-page": "1.0.0"
},

通过"Blade"链接到父级

@if(function_exists('get_region_halland_nav_menu_parent_page'))
  @php($myParent = get_region_halland_nav_menu_parent_page())
  <a href="{{ $myParent['parent-post-url'] }}">
    <span>{{ $myParent['parent-post-title'] }}</span><br>
  </a>
@endif

数组的示例

array (size=2)
  'parent-post-title' => string 'Nam nunc justo' (length=14)
  'parent-post-url' => string 'http://dev-template.local/lorem-ipsum/nam-nunc-justo/' (length=53)

版本历史

1.0.0

  • 第一个版本,通过Packagist发布