[wordpress插件] BW Twitter BlocksBW Twitter块

wordpress 插件 文章 2020-03-14 19:50 509 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

#BW Twitter Blocks fetches tweets using the Twitter API, stores them as posts and provides functionality to display them in blocks based on hash tags and mentions.

#BW Twitter块使用Twitter API提取推文,将其存储为帖子,并提供基于哈希标签和提及以块形式显示它们的功能。

Two custom post types are created:

创建了两种自定义帖子类型:

    1. Twitter Post Blocks (twitterblocks): To create the blocks of posts for display.

    2. Twitter帖子块(twitterblocks):创建要显示的帖子块。

      Include custom fields for displaying based on either mentions of the authenticated user or hash tags.

    3. 包括自定义字段,用于根据已认证用户或哈希标签的提及进行显示。

    4. Twitter Posts (twittercache): To store fetched tweets as a cache.

    5. Twitter帖子(twittercache):将获取的tweet存储为缓存。

      Uses custom fields to store hash tags and mentions (for filtering on display), twitter ID and raw (un-linkified) tweet text.

      使用自定义字段存储哈希标签和提及(用于在显示时进行过滤),Twitter ID和原始(未链接的)tweet文本。

    Tweets are fetched from the Twitter API.

    推文是从Twitter API获取的。

    Due to limitations with the API, only the most recent couple hundred tweets can be fetched, so this plugin stores tweets to ensure older tweets can still be accessed after they disappear from the Twitter API.

    由于API的限制,只能获取最近的200条推文,因此此插件存储推文,以确保从Twitter API消失后仍可以访问较旧的推文。

    The plugin fetches tweets from the authenticated user’s account as well as any tweets in which they are mentioned.

    该插件会从经过身份验证的用户的帐户中获取推文以及提及这些推文的任何推文。

    Also includes a widget to display individual blocks of tweets in the sidebar (or other widgetized area).

    还包括一个小部件,用于在侧边栏(或其他小部件化的区域)中显示各个推文块。

    To-do

    待办事项

      • Shortcode to display block of tweets on a page
      • 短代码以在页面上显示推文块

安装步骤

    1. Upload bw-twitter-blocks folder to your /wp-content/plugins/ directory
    2. 将bw-twitter-blocks文件夹上传到您的/ wp-content / plugins /目录

    3. Activate the plugin in WordPress admin
    4. 在WordPress管理员中激活插件

    5. Setup plugin options under #BW Options -> Twitter Blocks

    6. 在#BW选项-> Twitter阻止下设置插件选项

      3a.

      3a。

      Connect Twitter Account: Connect to your Twitter account by clicking the “Sign in with Twitter” button.

      连接Twitter帐户:通过单击“使用Twitter登录”按钮连接到您的Twitter帐户。

      You will be taken to twitter.com to sign in and authorize the plugin to access your tweets and then be redirected back to WordPress.

      您将被带到twitter.com登录并授权该插件访问您的推文,然后将其重定向回WordPress。

      3b.

      3b。

      Twitter Update Frequency: The plugin will automatically fetch new tweets on a regular schedule, set here.

      Twitter更新频率::该插件将定期自动获取新的tweet(在此处设置)。

      3c.

      3c。

      Convert to Links: Selected types of links in tweets will be converted to HTML links, with some additional data tags for use by custom scripts.

      转换为链接:推文中选定的链接类型将转换为HTML链接,还有一些其他数据标签供自定义脚本使用。

      3d.

      3d。

      Unshorten Links: The plugin will convert shortened links to their original full URL.

      取消缩短链接:该插件会将缩短的链接转换为其原始完整URL。

      The conversion significantly affects performance so please specify only the services you absolutely need to convert.

      转换会显着影响性能,因此请仅指定您绝对需要转换的服务。

      In practice most links do not need to be converted.

      实际上,大多数链接不需要转换。

      3e.

      3e。

      Manual Update Twitter Blocks: Click “Update Now!”

      手动更新Twitter阻止:点击“立即更新!”

      to manually fetch new tweets.

      手动获取新的推文。

      You will need to click this when setting up the plugin, after connecting your twitter account.

      连接Twitter帐户后,设置插件时需要单击此按钮。

      3f.

      3楼

      Clear Stored Tweets: Delete all cached twitter posts.

      清除存储的推文:删除所有缓存的推文。

    7. After connecting your Twitter account for the first time, you must manually fetch new tweets (see 3e above).
    8. 首次连接您的Twitter帐户后,您必须手动获取新的tweet(请参阅上面的3e)。

    9. Add bw_twitter_blocks_fetch() to template file to display tweet blocks.
    10. 将bw_twitter_blocks_fetch()添加到模板文件以显示tweet块。

    How to display tweet blocks:

    如何显示鸣叫块:

    Use

    使用 <?php $ blocks = bw_twitter_blocks_fetch($ args);

    ?> in a template file.

    ?> 在模板文件中。

      <?php $ default_args = array(    

    'orderby' => 'menu_order', // orderby for blocks of tweets    

    'orderby'=>'menu_order',//鸣叫块的orderby    

    'order' => 'ASC', // order for blocks    

    'order'=>'ASC',//块的顺序    

    'blocks' => -1,// how many blocks to display (-1 for all)    

    'blocks'=> -1,//要显示多少个块(全部为-1)    

    'tweets_per_block' => 6, // how many tweets to display per block,    

    'tweets_per_block'=> 6,//每个块显示多少条推文,    

    'single' => 0 // pass a post ID to fetch a single specific block (returns a single post object)

    'single'=> 0 //传递帖子ID以获取单个特定块(返回单个post对象)

    );

    );

    ?>

    ?>

    Return value is an array of objects from get_posts()

    返回值是get_posts()中的对象组成的数组

    for the blocks.

    对于块。

    The ‘tweets’ key for each object holds an array from get_posts for the tweets within that block.

    每个对象的“ tweets”键包含该块中tweets的get_posts数组。

    Tweets within each block are ordered by original tweet date.

    每个区块中的推文均按原始推文日期排序。

下载地址
https://downloads.wordpress.org/plugin/bw-twitter-blocks.zip
-EOF-

AI助手支持GPT4.0