[wordpress插件] Cision Block切割块

wordpress 插件 文章 2020-03-23 20:00 526 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

This plugin is developed by Cyclonecode and can be used to load and expose press releases made by

此插件是由 Cyclonecode 开发的,可用于加载和公开由

href="http://www.cision.se/" rel="nofollow">Cision.

href =“ http://www.cision.se/” rel =“ nofollow”>切割。

To start pulling feed items from cision you first need to add the unique identifier for you json feed at the configuration page for the plugin.

要开始从切入中提取提要项,首先需要在插件的配置页面上为json提要添加唯一标识符。

You can also change how many feed items to pull, type of feed items, enable pagination, configure caching and much more.

您还可以更改要提取的提要项的数量,提要项的类型,启用分页,配置缓存等等。

If you have questions or perhaps some idea on things that should be added you can also try

如果您对应该添加的内容有疑问或想法,也可以尝试

slack.

松弛。

Widget

小部件

You can display a feed in any sidebar by adding and configure a widget.

您可以通过添加和配置小部件在任何侧边栏中显示供稿。

Shortcode

简码

The shortcode [cision-block] can either be used by adding it to the content field of any post or by using the do_shortcode function in one of your templates.

可以将简码 [cision-block] 添加到任何帖子的内容字段中,也可以在其中一个模板中使用 do_shortcode 功能来使用它。

Shortcode attributes:

简码属性:

    • id

      id

      Assign a specific name for a block.

      为块分配一个特定的名称。

    • source_uid

      source_uid

      A unique feed identifier.

      唯一的供稿标识符。

    • language

      语言

      The language code for each feed item.

      每个提要项的语言代码。

      For example ‘en’ for english.

      例如,英语为“ en”。

    • date_format

      date_format

      The date format to use.

      要使用的日期格式。

    • readmore

      readmore

      The readmore button text.

      阅读更多按钮的文字。

    • count

      计数

      The maximum number of items to include in the feed.

      供稿中包含的最大项目数。

    • view

      查看

      This states what kind of items to include:

      这说明要包括哪些项目:

      1 – include both regulatory and non-regulatory items.

      1 –包括管制和非管制物品。

      2 – include only regulatory items.

      2 –仅包括管制项目。

      3 – include only non-regulatory items.

      3 –仅包括非管制物品。

    • start

      开始

      Sets the start date for the feed items.

      设置提要项的开始日期。

      The format to use is 2016-12-31.

      使用的格式为2016-12-31。

    • end

      end

      Sets the end date for the feed items.

      设置提要项的结束日期。

      The format to use is 2016-12-31.

      使用的格式为2016-12-31。

    • items_per_page

      items_per_page

      Sets the number of feed items to display on each page.

      设置要在每个页面上显示的供稿项的数量。

    • tags

      标签

      Only press releases with the specified tag will be included.

      仅包含具有指定标签的新闻稿。

      Multiple tags can be separated with a comma.

      多个标签可以用逗号分隔。

    • categories

      类别

      Only press releases that has one or more of the specified categories will be included.

      仅包含具有一个或多个指定类别的新闻稿。

      Multiple categories can be separated with a comma.

      多个类别可以用逗号分隔。

    • types

      类型

      Only press releases of the specified types will be included.

      仅包含指定类型的新闻稿。

    • image_style

      image_style

      The image style to use:

      要使用的图片样式:

        • DownloadUrl
        • DownloadUrl

        • UrlTo100x100ArResized
        • UrlTo100x100ArResized

        • UrlTo200x200ArResized
        • UrlTo200x200ArResized

        • UrlTo400x400ArResized
        • UrlTo400x400ArResized

        • UrlTo800x800ArResized
        • UrlTo800x800ArResized

        • UrlTo100x100Thumbnail
        • UrlTo100x100缩略图

        • UrlTo200x200Thumbnail
        • UrlTo200x200Thumbnail

      • flush

        冲洗

        Clears the cache for the block.

        清除该块的缓存。

      Here is an example using all of the above attributes:

      以下是使用上述所有属性的示例:

      [cision-block id=example_block source_uid=A275C0BF733048FFAE9126ACA64DD08F language=sv date_format=mdY readmore="Read more" view=1 count=6 items_per_page=2 tags="cision,company" categories="New Year,

        [cision-block id = example_block source_uid = A275C0BF733048FFAE9126ACA64DD08F language = sv date_format = mdY readmore =“阅读更多” view = 1 count = 6 items_per_page = 2标签=“ cision,company” Categories =“新年,

      Summer camp" types="PRM, RDV" start=2016-01-12 end=2019-06-12 image_style=UrlTo400x400ArResized flush=true]

      夏令营” types =“ PRM,RDV”开始= 2016-01-12结束= 2019-06-12 image_style = UrlTo400x400ArResized flush = true]

      Notice that all shortcode attributes are optional and that they must be on a single line.

      注意,所有短码属性都是可选的,并且必须在同一行上。

      Default values is taken from the plugins settings page.

      默认值来自插件设置页面。

      Here is a complete list of the different kind of pressreleases:

      以下是各种新闻稿的完整列表:

        • KMK – Annual Financial statement
        • KMK –年度财务报表

        • RDV – Annual Report
        • RDV –年度报告

        • PRM – Company Announcement
        • PRM –公司公告

        • RPT – Interim Report
        • RPT –中期报告

        • INB – Invitation
        • INB –邀请

        • NBR – Newsletter
        • NBR –新闻

        More than one block in a page

        一页中有多个区块

        To use more than one block in a single page you will need to set a unique id for each block or else they will both share the same cache entry.

        要在一个页面中使用多个块,则需要为每个块设置唯一的ID,否则它们将共享相同的缓存条目。

        Template

        模板

        The template used to render the feed is cision-block/templates/cision-block.php, you can override

        用于呈现供稿的模板为 cision-block / templates / cision-block.php ,您可以覆盖

        this template by copying it to either the root or under a templates folder in your theme.

        将该模板复制到主题的根目录或 templates 文件夹下。

        Experimental: Display single press releases in WordPress

        实验性:在WordPress中显示单一新闻稿

        Since version 2.0.0 it is possible to fetch and display press releases directly from within WordPress.

        从2.0.0版开始,可以直接从WordPress中获取和显示新闻稿。

        The template used in this case is cision-block/templates/cision-block-post.php, you can override

        在这种情况下使用的模板是 cision-block / templates / cision-block-post.php ,您可以覆盖

        this template by copying it to either the root or under a templates folder in your theme.

        将该模板复制到主题的根目录或 templates 文件夹下。

        The $CisionItem feed object that is available in the template contains all raw data fetched from Cision.

        模板中可用的 $ CisionItem feed对象包含从Cision提取的所有原始数据。

        Under the Resources section there is a link that explains all the different fields that is available.

        资源部分下,有一个链接,解释了所有可用的不同字段。

        For example if you use the $CisionItem->HtmlBody to display content from the feed item you might have to add custom

        例如,如果您使用 $ CisionItem-> HtmlBody 显示供稿项中的内容,则可能必须添加自定义

        css since this contains pre formated html which may include inline css and so on.

        css,因为其中包含预格式化的html,其中可能包含嵌入式css等。

        Fields

        字段

        By default only the following fields are collected for each feed item:

        默认情况下,每个提要项仅收集以下字段:

          • Title
          • 标题

          • Intro
          • 简介

          • Body
          • 身体

          • PublishDate
          • PublishDate

          • CisionWireUrl
          • CisionWireUrl

          • IsRegulatory
          • IsRegulatory

          • Images[0]

          • 图片[0]

              • DownloadUrl
              • DownloadUrl

              • Description
              • 说明

            Filters

            过滤器

            Add more fields to each feed item:

            向每个供稿项添加更多字段:

            add_filter('cision_map_source_item', function($item, $data, $block_id) {  

              add_filter('cision_map_source_item',function($ item,$ data,$ block_id){  

            $item['Header'] = sanitize_text_field($data->Header);  

            $ item ['Header'] = sanitize_text_field($ data-> Header);  

            $item['LogoUrl'] = esc_url_raw($data->LogoUrl);  

            $ item ['LogoUrl'] = esc_url_raw($ data-> LogoUrl);  

            $item['SocialMediaPitch'] = sanitize_text_field($data->SocialMediaPitch);  

            $ item ['SocialMediaPitch'] = sanitize_text_field($ data-> SocialMediaPitch);  

            return $item;

            返回$ item;

            }, 10, 3);

            },10,3);

            Customize the sorting of the feed items:

            自定义提要项的排序:

            add_filter('cision_block_sort', function($items, $block_id) {  

              add_filter('cision_block_sort',function($ items,$ block_id){  

            usort($items, function($a, $b) {    

            usort($ items,function($ a,$ b){    

            return $a->PublishDate > $b->PublishDate;  

            返回$ a-> PublishDate> $ b-> PublishDate;  

            });  

            });  

            return $items;

            返回$ items;

            }, 10, 2);

            },10,2);

            Add custom attributes to the pager:

            将自定义属性添加到寻呼机:

            add_filter('cision_block_pager_attributes', function(array $attributes, $block_id) {  

              add_filter('cision_block_pager_attributes',function(array $ attributes,$ block_id){  

            return array_merge(    

            返回array_merge(    

            $attributes,    

            $属性,    

            array(      

            数组(      

            'class' => 'custom-class',      

            'class'=>'custom-class',      

            'id' => 'custom-id',    

            'id'=>'custom-id',    

            )  

            )  

            );

            );

            }, 10, 2);

            },10,2);

            Set a custom class for active pager item:

            为活动的寻呼机项目设置自定义类别:

            add_filter('cision_block_pager_active_class', function($class, $block_id) {  

              add_filter('cision_block_pager_active_class',function($ class,$ block_id){  

            return 'custom-class';

            返回“自定义类”;

            }, 10, 2);

            },10,2);

            To add attributes to the section wrapper in the template:

            要将属性添加到模板中的节包装器中:

            add_filter('cision_block_wrapper_attributes', function(array $attributes, $block_id) {  

              add_filter('cision_block_wrapper_attributes',function(array $ attributes,$ block_id){  

            return array(    

            返回数组(    

            'class' => array(      

            'class'=>数组(      

            'custom-class',    

            “自定义类”,    

            ),  

            ),  

            );

            );

            }, 10, 2);

            },10,2);

            To add attributes to the article wrapper in the template:

            要将属性添加到模板中的商品包装器中:

            add_filter('cision_block_media_attributes', function(array $attributes, $block_id) {  

              add_filter('cision_block_media_attributes',function(array $ attributes,$ block_id){  

            return array(    

            返回数组(    

            'class' => array(      

            'class'=>数组(      

            'custom-class',    

            “自定义类”,    

            ),  

            ),  

            );

            );

            }, 10, 2);

            },10,2);

            Add a prefix that will be displayed at the start of the wrapper:

            添加将在包装器的开头显示的前缀:

            add_filter('cision_block_prefix', function($prefix, $block_id) {  

              add_filter('cision_block_prefix',function($ prefix,$ block_id){  

            return '

            Prefix

            ';

            返回'

            前缀';

            }, 10, 2);

            },10,2);

            Add a suffix that will be displayed at the end of the wrapper:

            添加一个后缀,该后缀将显示在包装的末尾:

            add_filter('cision_block_suffix', function($suffix, $block_id) {  

              add_filter('cision_block_suffix',function($ suffix,$ block_id){  

            return '

            Suffix

            ';

            返回'

            后缀';

            }, 10, 2);

            },10,2);

            Resources

            资源

            A complete list of fields can be found at: https://websolutions.ne.

            完整的字段列表可以在以下位置找到: https://websolutions.ne。

            cision.com/documents/P2_Feed.pdf

            cision.com/documents/P2_Feed.pdf

            The following Feed identifier can be used for testing: A275C0BF733048FFAE9126ACA64DD08F

            以下Feed标识符可用于测试: A275C0BF733048FFAE9126ACA64DD08F

            Support

            支持

            If you run into any trouble, don’t hesitate to add a new topic under the support section:

            如果遇到任何麻烦,请随时在支持部分下添加新主题:

            https://wordpress.org/support/plugin/cision-block

            https://wordpress.org/support/plugin/cision-block

            You can also try contacting me on slack.

            您还可以尝试通过

安装步骤

    1. Upload cision block to the /wp-content/plugins/ directory,
    2. 将切割块上传到 / wp-content / plugins / 目录,

    3. Activate the plugin through the Plugins menu in WordPress.
    4. 通过WordPress中的插件菜单激活插件。

下载地址
https://downloads.wordpress.org/plugin/cision-block.2.1.0.zip
-EOF-

AI助手支持GPT4.0