regionhalland/region-halland-plugin-single-page-information

返回任意页面信息的前端插件

v1.3.0 2022-04-27 14:30 UTC

This package is auto-updated.

Last update: 2024-09-27 19:32:30 UTC


README

如何使用Region Hallands插件"RhSinglePageInformation"

以下是使用"RhSinglePageInformation"插件的操作说明。

应用范围

此插件创建一个包含任意页面所有信息的对象

许可模型

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

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

通过composer导入插件

注意!请确保您下载的是最新版本。

"require": {
  "regionhalland/region-halland-plugin-single-page-information": "1.0.0"
},

通过"Blade"显示"页面"内容

@if(function_exists('get_region_halland_single_page_information'))
  @php($myPage = get_region_halland_single_page_information(30)) 
  <div>
    {{ $myPage->post_title }}
  </div>          
  <div>
    {!! do_shortcode(wpautop($myPage->post_content)) !!}
  </div>          
  <div>
    <img src="{{ $myPage->image_url }}" alt="{{ $myPage->image_alt }}">
  </div>          
@endif

数组的示例

object(WP_Post)[6431]
  public 'ID' => int 30
  public 'post_author' => string '1' (length=1)
  public 'post_date' => string '2018-11-23 11:17:24' (length=19)
  public 'post_date_gmt' => string '2018-11-23 10:17:24' (length=19)
  public 'post_content' => string 'Lorem ipsum dolares' (length=19)
  public 'post_title' => string 'Startsida' (length=9)
  public 'post_excerpt' => string '' (length=0)
  public 'post_status' => string 'publish' (length=7)
  public 'comment_status' => string 'closed' (length=6)
  public 'ping_status' => string 'closed' (length=6)
  public 'post_password' => string '' (length=0)
  public 'post_name' => string 'startsida' (length=9)
  public 'to_ping' => string '' (length=0)
  public 'pinged' => string '' (length=0)
  public 'post_modified' => string '2018-11-26 12:44:01' (length=19)
  public 'post_modified_gmt' => string '2018-11-26 11:44:01' (length=19)
  public 'post_content_filtered' => string '' (length=0)
  public 'post_parent' => int 17
  public 'guid' => string 'http://exempel.se/startsida/' (length=28)
  public 'menu_order' => int 0
  public 'post_type' => string 'page' (length=4)
  public 'post_mime_type' => string '' (length=0)
  public 'comment_count' => string '0' (length=1)
  public 'filter' => string 'raw' (length=3)
  public 'url' => string 'http://exempel.se/startsida/' (length=28)
  public 'image_url' => string 'http://exempel.se/app/uploads/2018/11/myImage.jpg' (length=49)
  public 'image_alt' => string 'Min bild' (length=8)

版本历史

1.2.1

  • 更新了README

1.2.0

  • 添加了Packagist的发布管道

1.1.0

  • 添加了许可模型信息
  • 附加了许可模型文件
  • 图片的alt文本

1.0.0

  • 第一个版本