[WordPress] 外掛分享: External Content

前言介紹

  • 這款 WordPress 外掛「External Content」是 2015-05-07 上架。
  • 目前有 70 個安裝啟用數。
  • 上一次更新是 2016-01-03,距離現在已有 3410 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.9.0 以上版本才可以安裝。
  • 有 1 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

tfrommen |

外掛標籤

url | content | external |

內容簡介

您是否曾經想要將外部內容,例如外部網站的特定文章,整合到 WordPress 網站中並且像任何其他文章一樣處理?也就是說,讓它顯示為 teaser 或特定(虛擬)存檔的一部分?
這正是 External Content 插件發揮作用的時候。

用法

External Content 註冊了一個自定義文章類型,在預設情況下支援標題、內容、摘要和縮略圖。不過也可以進行自定義。在後台管理文章與管理其他文章類型並無區別。創建新文章、為其命名、編寫一些內容、定義個別摘要(可選),如果需要可以設置文章縮略圖。然後通過相應的元框為每篇文章分配個別的外部網址。這個外部網址將用作文章的永久鏈接。

篩選器

為了自定義插件的某些方面,插件提供了多個篩選器。下面為每個篩選器提供了一個簡短的說明以及如何修改默認行為的代碼示例。只需將相應的代碼片段放入您的主題的 functions.php 文件或自定義插件中的其他適當位置即可。

external_content_args

如果您想要修改特定的文章類型參數,但找不到合適的篩選器,則可以使用 external_content_args 篩選器,它為您提供完整的參數陣列。

/**
* 篩選文章類型參數。
*
* @param array $args 文章類型參數。
*/
add_filter( 'external_content_args', function( $args ) {

// 使用階層式外部內容
$args[ 'hierarchical' ] = TRUE;

return $args;
} );

external_content_description

文章類型描述可以通過使用 external_content_description 篩選器進行自定義。

/**
* 篩選文章類型描述。
*
* @param string $description 文章類型描述。
*/
add_filter( 'external_content_description', function() {

// 提供一個描述
return '用於處理像任何其他文章一樣的外部內容的簡單文章類型。';
} );

external_content_labels

如果您不喜歡標籤,可以輕鬆地將它們適合自己的方式進行調整。

/**
* 篩選文章類型標籤。
*
* @param array $labels 文章類型標籤。
*/
add_filter( 'external_content_labels', function( $labels ) {

// 增加一些恐怖元素...
$labels[ 'not_found' ] = '找不到外部內容!!1!!1!!oneone!!!1!eleven!1!';

return $labels;
} );

external_content_meta_key

如果您想要修改外部網址的元鍵,可以通過此篩選器進行自定義。

/**
* 篩選元鍵。
*
* @param string $meta_key 元鍵。
*/
add_filter( 'external_content_meta_key', function() {

// 讓我們把元鍵變成 Shrek
return 'far_far_away';
} );

external_content_post_type

是的,您還可以修改文章類型(slug)。

/**
* 篩選文章類型。
*
* @param string $post_type 文章類型。
*/
add_filter( 'external_content_post_type', function() {

return '異國情調的東西';
} );

external_content_supports

此篩選器為您提供文章類型的支援功能。

/**
* 篩選文章類型支援。
*
* @param array $supports 文章類型支援。
*/
add_filter( 'external_content_sup

原文外掛簡介

Have you ever wanted to integrate external content such as a specific post of an external website into your WordPress website? But treat it like any other post? That is, have it appear as teaser or part of a specific (pseudo) archive?
This is exactly when External Content kicks in.
Usage
External Content registers a custom post type that, by default, supports title, content, excerpt and thumbnail. This can be customized, though. Managing your posts in your backend is no different from any other post type. Create a new post, give it a title, write some text, define an individual excerpt, and set a post thumbnail, if you wish. Then assign each post an individual external URL by means of the according meta box. This external URL will be used as the post’s permalink.
Filters
In order to customize certain aspects of the plugin, it provides you with several filters. For each of these, a short description as well as a code example on how to alter the default behavior is given below. Just put the according code snippet in your theme’s functions.php file or your customization plugin, or to some other appropriate place.
external_content_args
If you want to alter a specific post type argument but you can’t find a fitting filter, there’s external_content_args, which provides you with the complete args array.
/**
* Filter the post type args.
*
* @param array $args Post type args.
*/
add_filter( 'external_content_args', function( $args ) {

// Use hierarchical external content
$args[ 'hierarchical' ] = TRUE;

return $args;
} );

external_content_description
The post type description can be customized by using the external_content_description filter.
/**
* Filter the post type description.
*
* @param string $description Post type description.
*/
add_filter( 'external_content_description', function() {

// Provide a description
return 'Simple post type for handling external content like any other post.';
} );

external_content_labels
In case you don’t like the labels, easily adapt them to your liking.
/**
* Filter the post type labels.
*
* @param array $labels Post type labels.
*/
add_filter( 'external_content_labels', function( $labels ) {

// A little more horror, please...
$labels[ 'not_found' ] = 'ZOMG, no external content found!!1!!1!!oneone!!!1!eleven!1!';

return $labels;
} );

external_content_meta_key
If you want to alter the meta key for the external URL, feel free to do it via this filter.
/**
* Filter the meta key.
*
* @param string $meta_key Meta key.
*/
add_filter( 'external_content_meta_key', function() {

// Let's Shrekify the meta key
return 'far_far_away';
} );

external_content_post_type
Yes, you can also alter the post type (slug).
/**
* Filter the post type.
*
* @param string $post_type Post type.
*/
add_filter( 'external_content_post_type', function() {

return 'exotic_stuff';
} );

external_content_supports
This filter provides you with the post type supports.
/**
* Filter the post type supports.
*
* @param array $supports Post type supports.
*/
add_filter( 'external_content_supports', function( $supports ) {

// If your theme uses the excerpt for teasers, just remove the editor to prevent confusion
foreach ( $supports as $key => $value ) {
if ( 'editor' === $value ) {
unset( $supports[ $key ] );
}
}

return $supports;
} );

external_content_use_external_url
The permalink of external content is, by default, replaced with the post’s according external URL (i.e., post meta). To disable this behavior, just do the following:
/**
* Filter the usage of the external URL as permalink.
*
* @param bool $use_external_url Use the external URL as permalink?
*/
add_filter( 'external_content_use_external_url', '__return_false' );

Contribution
To contribute to this plugin, please see its GitHub repository.
If you have a feature request, or if you have developed the feature already, please feel free to use the Issues and/or Pull Requests section.
Of course, you can also provide me with translations if you would like to use the plugin in another not yet included language.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「External Content」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.4.0 | 1.4.1 | 1.4.2 |

延伸相關外掛(你可能也想知道)

  • One Click Demo Import 》這個外掛的最佳功能在於主題作者可以在他們的主題中定義導入文件,所以所有使用該主題的用戶只需點擊「導入演示數據」按鈕即可。, , 你是主題作者嗎?, 為你...。
  • Advanced Excerpt 》這個外掛可以改進 WordPress 原有的摘錄文章功能。, , 保留摘錄中的 HTML 標記,並可自選需要保留的標記, 按字元數或字數截斷摘錄, 只計算「真正的」文字(HT...。
  • Rara One Click Demo Import 》您喜歡 Rara Theme 製作的主題展示嗎?還是需要設定主題的指南?, 那麼,您只需要這個外掛!, Rara One Click Demo Import 外掛可以幫助您一鍵匯入演示內容,...。
  • Advanced WP Columns 》Advanced WP Columns 外掛提供了簡單易用的介面,讓您可以在部落格中使用多欄位顯示內容,而無需使用任何簡碼。此外,也支援回應式排版。, , 基本資訊, 外掛...。
  • WP Subtitle 》WP Subtitle 外掛能讓你的頁面和文章擁有副標題。這個短小的文字通常出現在文章(或頁面)標題之下,也可以在你選擇的任何地方插入你的樣板。, 你可以使用以...。
  • WP-ShowHide 》預設情況下,內容是隱藏的,使用者必須點擊「顯示內容」連結來切換內容。與 Engadget 為他們的新聞稿所做的方式相似。範例用法:[showhide type="pressreleas...。
  • TutorMate 》TutorMate 是一款專為 Tutor Starter 主題設計的外掛程式,可將預先設計好的時尚示範頁面匯入由 Tutor LMS 外掛提供的 eLearning 網站。如果您想讓使用 Tutor...。
  • Themebeez Toolkit 》這是我們開發的一個適用於 WordPress 主題 的基本工具包,Themebeez Toolkit 可以幫助您導入虛擬演示內容,還為我們的主題添加了額外的功能和功能。, ✨ 包括...。
  • RSSImport 》這款外掛可使用 PHP、小工具或短代碼在您的部落格中顯示 RSS 資訊。此外掛僅使用 WordPress 標準功能,因此不需要外部庫。對於較舊版本的 WordPress,使用內...。
  • Custom Content Shortcode 》停用通知, , 此外掛已不再維護。, 請改使用下一代範本系統:Loops & Logic。, 概述, , 從單一欄位到整個頁面,Custom Content Shortcode 是一套指令,可...。
  • Blaze Demo Importer 》首頁 | 所有主題 | 部落格 | 支援, , Blaze Demo Importer 可在所有 BlazeThemes 開發的官方主題中使用。此外掛可以用於將任意可用的起始網站設置匯入到您的...。
  • AI Assistant by 10Web – SEO Pack 》EO errors in the paragraph., Content Generator, The AI Assistant by 10Web – SEO Pack can generate long-form content such as articles and blog posts...。
  • 10Web AI Assistant – AI content writing assistant 》10Web AI Assistant for WordPress是專門為WordPress開發的AI內容編輯和AI內容創作工具。透過10Web AI助手,您可以在不離開WordPress環境的情況下比傳統方式...。
  • AF Companion – Build Stylish WordPress Websites in Minutes – No Coding, Just Click and Go! Starter Sites Importer for WordPress 》m/products/newsever-pro/" rel="nofollow ugc">Newsever Pro, Shopical Pro, Elegant Magazine Pro, And More.., , __ Check all of our Plugins __, , News...。
  • Access Demo Importer 》這個外掛會為現行主題匯入與此外掛相容的示範內容。預設下外掛會從我們的伺服器取得設定檔案。, 若您想要使用外掛設定自己的主題,只需指向您的 config.json ...。

文章
Filter
Mastodon