[WordPress] 外掛分享: Post Author IP

WordPress 外掛 Post Author IP 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Post Author IP」是 2018-02-14 上架。
  • 目前有 100 個安裝啟用數。
  • 上一次更新是 2021-06-10,距離現在已有 1424 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.9 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

coffee2code |

外掛標籤

ip | post | audit | author | ip address |

內容簡介

這個外掛會在文章創建時記錄原始發文者的IP位址。

管理員的文章列表會新增一欄「作者IP」,顯示最初儲存文章者的IP位址。

此外掛無法提供在使用之前已經創建的文章IP位址資訊。

連結: 外掛首頁 | 外掛目錄頁面 | GitHub | 作者首頁

鉤子(Hooks)

此外掛可進一步透過四個過濾器進行自訂。通常,使用過濾器的程式碼應該放置在 mu-plugin 或特定網站的插件中 (這超出了本自述檔案的範圍)。

c2c_show_post_author_ip_column (過濾器)

「c2c_show_post_author_ip_column」過濾器允許您決定在管理文章列表中是否應該出現文章作者的IP欄位。您的鉤子函式可以傳送1個引數:

引數:

$show_column (bool) 是否應顯示欄位?預設為真。

範例:

/**
* 只有管理員才顯示文章作者的 IP 欄位。
*
* @param bool $show_column 是否應顯示欄位?預設為真。
* @return bool
*/
function post_author_ip_column_admin_only( $show ) {
if ( ! current_user_can( 'manage_options' ) ) {
$show = false;
}
return $show;
}
add_filter( 'c2c_show_post_author_ip_column', 'post_author_ip_column_admin_only' );

c2c_get_post_author_ip (過濾器)

「c2c_get_post_author_ip」過濾器允許您自訂作為文章作者IP位址儲存的值。您的鉤子函式可以傳送2個引數:

引數:

$ip (string) 文章作者IP位址。
$post_id (int) 文章ID。

範例:

/**
* 將所有來自本機子網路位址的IP地址視為相同的IP位址。
*
* @param string $ip 文章作者IP位址。
* @param int $post_id 文章ID。
* @return string
*/
function customize_post_author_ip( $ip, $post_id ) {
if ( 0 === strpos( $ip, '192.168.' ) ) {
$ip = '192.168.1.1';
}
return $ip;
}
add_filter( 'c2c_get_post_author_ip', 'customize_post_author_ip', 10, 2 );

c2c_get_current_user_ip (過濾器)

「c2c_get_current_user_ip」過濾器允許您自訂外掛所使用的當前用戶的IP位址。您的鉤子函式可以傳送1個引數:

引數:

$ip (string) 文章作者IP位址。

範例:

/**
* 覆蓋本地主機IP地址。
*
* @param string $ip 文章作者IP位址。
* @param int $post_id 文章ID。
* @return string
*/
function customize_post_author_ip( $ip, $post_id ) {
if ( 0 === strpos( $ip, '192.168.' ) ) {
$ip = '192.168.1.1';
}
return $ip;
}
add_filter( 'c2c_get_post_author_ip', 'customize_post_author_ip', 10, 2 );

c2c_post_author_ip_allowed (過濾器)

「c2c_post_author_ip_allowed」過濾器允許您在每篇文章上決定是否應存儲文章作者IP。您的鉤子函式可以傳送3個引數:

引數:

原文外掛簡介

This plugin records the IP address of the original post author when a post first gets created.
The admin listing of posts is amended with a new “Author IP” column that shows the IP address of the author who first saved the post.
The plugin is unable to provide IP address information for posts that were created prior to the use of this plugin.
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
Hooks
The plugin is further customizable via four filters. Typically, code making use of filters should ideally be put into a mu-plugin or site-specific plugin (which is beyond the scope of this readme to explain).
c2c_show_post_author_ip_column (filter)
The ‘c2c_show_post_author_ip_column’ filter allows you to determine if the post author IP column should appear in the admin post listing table. Your hooking function can be sent 1 argument:
Argument :

$show_column (bool) Should the column be shown? Default true.

Example:
/**
* Don't show the post author IP column except to admins.
*
* @param bool $show_column Should the column be shown? Default true.
* @return bool
*/
function post_author_ip_column_admin_only( $show ) {
if ( ! current_user_can( 'manage_options' ) ) {
$show = false;
}
return $show;
}
add_filter( 'c2c_show_post_author_ip_column', 'post_author_ip_column_admin_only' );

c2c_get_post_author_ip (filter)
The ‘c2c_get_post_author_ip’ filter allows you to customize the value stored as the post author IP address. Your hooking function can be sent 2 arguments:
Arguments :

$ip (string) The post author IP address.
$post_id (int) The post ID.

Example:
/**
* Store all IP addresses from local subnet IP addresses as the same IP address.
*
* @param string $ip The post author IP address.
* @param int $post_id The post ID.
* @return string
*/
function customize_post_author_ip( $ip, $post_id ) {
if ( 0 === strpos( $ip, '192.168.' ) ) {
$ip = '192.168.1.1';
}
return $ip;
}
add_filter( 'c2c_get_post_author_ip', 'customize_post_author_ip', 10, 2 );

c2c_get_current_user_ip (filter)
The ‘c2c_get_current_user_ip’ filter allows you to customize the current user’s IP address, as used by the plugin. Your hooking function can be sent 1 argument:
Argument :

$ip (string) The post author IP address.

Example:
/**
* Overrides localhost IP address.
*
* @param string $ip The post author IP address.
* @param int $post_id The post ID.
* @return string
*/
function customize_post_author_ip( $ip, $post_id ) {
if ( 0 === strpos( $ip, '192.168.' ) ) {
$ip = '192.168.1.1';
}
return $ip;
}
add_filter( 'c2c_get_post_author_ip', 'customize_post_author_ip', 10, 2 );

c2c_post_author_ip_allowed (filter)
The ‘c2c_post_author_ip_allowed’ filter allows you to determine on a per-post basis if the post author IP should be stored. Your hooking function can be sent 3 arguments:
Arguments :

$allowed (bool) Can post author IP be saved for post? Default true.
$post_id (int) The post ID.
$ip (string) The post author IP address.

Example:
/**
* Don't bother storing localhost IP addresses.
*
* @param bool $allowed Can post author IP be saved for post? Default true.
* @param int $post_id The post ID.
* @param string $ip The post author IP address.
* @return string
*/
function disable_localhost_post_author_ips( $allowed, $post_id, $ip ) {
if ( $allowed && 0 === strpos( $ip, '192.168.' ) ) {
$allowed = false;
}
return $allowed;
}
add_filter( 'c2c_post_author_ip_allowed', 'disable_localhost_post_author_ips', 10, 3 );

各版本下載點

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

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


1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.2.1 | trunk |

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

  • WP Meta and Date Remover 》移除點擊文章的Meta、作者和日期。 安裝、啟用,完成!, 如何移除文章和頁面的作者Meta和日期?, , 安裝 WP Meta and Date remover。, 啟用外掛。, 選擇隱藏...。
  • Edit Author Slug 》這個外掛程式允許您完全控制使用者永久網址,讓您可以更改作者基底(作者 URL 中「/author/」部分)和作者別名(預設為作者使用者名稱)。您可以在全域設置作...。
  • Hide/Remove Metadata 》Hide/Remove Metadata是一款免費、簡單而非常實用的WordPress外掛,能夠幫助您輕鬆地隱藏或刪除網站上的作者和發布日期。該外掛非常容易使用,僅提供隱藏或移...。
  • Meks Smart Author Widget 》這個簡單的外掛程式讓你可以在 WordPress Widget 中顯示作者/使用者資訊。此外掛的聰明之處在於「自動偵測」使用者/作者,因此它可以選擇性地在單獨的文章頁...。
  • WP Post Author – Boost Your Blog's Engagement with Author Box, Social Links, Co-Authors, Guest Authors, Post Rating System, and Custom User Registration Form Builder 》age/post using the plugin. Users can log in to your website using this block., Widgets, The WP Post Author plugin comes with two widgets, Author Bo...。
  • WP Author, Date and Meta Remover 》即時自訂或刪除您的元數據!WP 作者、日期和元數據移除 Pro+現已上市。WP ADMR Pro+ for Intelligent Meta Data Control。, WordPress 已成為許多線上企業主...。
  • VK Post Author Display 》在內容底部顯示文章作者資訊框。, 任意區段 1。
  • Starbox – the Author Box for Humans 》is plugin., , With Starbox, you'll have a beautiful Author Box that will help your readers connect with the humans behind your content. Plus, you'l...。
  • Head Meta Data 》一款外掛,可通過添加自定義的 標籤到網頁的 部分,提高網頁定義和語義質量。, 基本示例, 在您的網站上顯示任何自定義的 meta 標...。
  • Disable Author Archives 》這是一個簡單輕量的 WordPress 外掛,可以完全停用作者存檔/頁面(無論相應的作者是否存在),並使網頁伺服器返回404狀態碼('未找到')。相關連結也將禁用或...。
  • WP htaccess Control 》WP htaccess Control(也可以稱為 WP htaccess 和 Rewrite Control)提供了一個界面來自定生成WordPress的htaccess文件以及其永久鏈接(作者、分類、歸檔、分...。
  • Fancier Author Box by ThematoSoup 》如果您正在尋找一種方法,讓每個頁面都成為新聯繫和潛在客戶的登陸頁面,那麼您一定會發現 ThematoSoup 的 Fancier Author Box 是非常寶貴的工具。, , 讓每篇...。
  • Guest Author 》這款 WordPress 外掛讓你在任何一篇文章中新增客座作者,而不需要在你的網站上註冊客座作者為使用者。, 功能, , ✍️ 行為就像客座作者是普通作者一樣。, 👤 可...。
  • Authors List 》使用簡碼簡單地顯示文章作者清單或網格,並帶有到其文章彙整頁面的連結。, 簡碼為 [authors_list],並接受以下屬性。, , style(1、2、3), columns (2、3、4...。
  • Author Avatars List/Block 》這個外掛可以方便地在您的 (多使用者) 網站上顯示按用戶角色分組的使用者頭像列表。它還允許您將單個頭像插入到文章或頁面中,以顯示您正在談論的某個人的圖...。

文章
Filter
Apply Filters
Mastodon