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”>切割。 p>
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.
您还可以更改要提取的提要项的数量,提要项的类型,启用分页,配置缓存等等。 p>
If you have questions or perhaps some idea on things that should be added you can also try 如果您对应该添加的内容有疑问或想法,也可以尝试
slack
.
松弛。 p>
Widget
小部件 h4>
You can display a feed in any sidebar by adding and configure a widget.
您可以通过添加和配置小部件在任何侧边栏中显示供稿。 p>
Shortcode
简码 h4>
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] strong>添加到任何帖子的内容字段中,也可以在其中一个模板中使用 do_shortcode strong>功能来使用它。 p>
Shortcode attributes:
简码属性: p>
[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]
code> pre>
Notice that all shortcode attributes are optional and that they must be on a single line.
注意 strong>,所有短码属性都是可选的,并且必须 strong>在同一行上。
Default values is taken from the plugins settings page.
默认值来自插件设置页面。 p>
Here is a complete list of the different kind of pressreleases:
以下是各种新闻稿的完整列表: p>
- KMK – Annual Financial statement
- KMK –年度财务报表 li>
- RDV – Annual Report
- RDV –年度报告 li>
- PRM – Company Announcement
- PRM –公司公告 li>
- RPT – Interim Report
- RPT –中期报告 li>
- INB – Invitation
- INB –邀请 li>
- NBR – Newsletter
- NBR –新闻 li>
ul>
More than one block in a page
一页中有多个区块 h4>
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,否则它们将共享相同的缓存条目。 p>
Template
模板 h4>
The template used to render the feed is cision-block/templates/cision-block.php, you can override
用于呈现供稿的模板为 cision-block / templates / cision-block.php strong>,您可以覆盖
this template by copying it to either the root or under a templates folder in your theme.
将该模板复制到主题的根目录或 templates strong>文件夹下。 p>Experimental: Display single press releases in WordPress
实验性:在WordPress中显示单一新闻稿 h4>
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 strong>,您可以覆盖
this template by copying it to either the root or under a templates folder in your theme.
将该模板复制到主题的根目录或 templates strong>文件夹下。 p>The $CisionItem
feed object that is available in the template contains all raw data fetched from Cision.
模板中可用的 $ CisionItem code> feed对象包含从Cision提取的所有原始数据。
Under the Resources section there is a link that explains all the different fields that is available.
资源 strong>部分下,有一个链接,解释了所有可用的不同字段。
For example if you use the $CisionItem->HtmlBody
to display content from the feed item you might have to add custom
例如,如果您使用 $ CisionItem-> HtmlBody code>显示供稿项中的内容,则可能必须添加自定义
css since this contains pre formated html which may include inline css and so on.
css,因为其中包含预格式化的html,其中可能包含嵌入式css等。 p>
Fields
字段 h4>
By default only the following fields are collected for each feed item:
默认情况下,每个提要项仅收集以下字段: p>
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);
code> pre>
Customize the sorting of the feed items:
自定义提要项的排序: p>
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);
code> pre>
Add custom attributes to the pager:
将自定义属性添加到寻呼机: p>
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);
code> pre>
Set a custom class for active pager item:
为活动的寻呼机项目设置自定义类别: p>
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);
code> pre>
To add attributes to the section wrapper in the template:
要将属性添加到模板中的节包装器中: p>
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);
code> pre>
To add attributes to the article wrapper in the template:
要将属性添加到模板中的商品包装器中: p>
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);
code> pre>
Add a prefix that will be displayed at the start of the wrapper:
添加将在包装器的开头显示的前缀: p>
add_filter('cision_block_prefix', function($prefix, $block_id) { add_filter('cision_block_prefix',function($ prefix,$ block_id){ return '
Prefix
';返回'
前缀 h1>';
}, 10, 2);
},10,2);
code> pre>
Add a suffix that will be displayed at the end of the wrapper:
添加一个后缀,该后缀将显示在包装的末尾: p>
add_filter('cision_block_suffix', function($suffix, $block_id) { add_filter('cision_block_suffix',function($ suffix,$ block_id){ return '
Suffix
';返回'
后缀 h1>';
}, 10, 2);
},10,2);
code> pre>
Resources
资源 h4>
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
p>
The following Feed identifier can be used for testing: A275C0BF733048FFAE9126ACA64DD08F
以下Feed标识符可用于测试: A275C0BF733048FFAE9126ACA64DD08F strong> p>Support
支持 h3>
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 p>
You can also try contacting me on slack.
您还可以尝试通过