[WordPress] 外掛分享: Permalinks Customizer

WordPress 外掛 Permalinks Customizer 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Permalinks Customizer」是 2016-02-01 上架。 目前已經下架不再更新,不建議安裝使用。
  • 目前有 3000 個安裝啟用數。
  • 上一次更新是 2020-06-17,距離現在已有 1782 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.5 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 5.2.4 以上。
  • 有 32 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

sasiddiqui | aliya-yasir |

外掛標籤

url | link | tags | permalink | redirects |

內容簡介

自定義永久網址助手(Permalinks Customizer)可為公開訪問的不同文章類型和分類定義不同的永久網址結構。您可以使用 WordPress 中已定義的標籤,如此處所述的標籤,也可以使用由此外掛程式自定義的文章類型和分類的標籤。在 WordPress 導覽列上的 Permalinks Customizer 選單中(若已安裝此外掛)也可以找到這些標籤。

如何為不同文章類型設定永久網址?假設您有六個文章類型,並希望為它們應用不同的永久網址結構,如下所述:

1. 博客(Blog):您希望為此文章類型創建一個永久網址,如:http://www.example.com/blog/year-month-date-postname/
2. 客戶(Customers):您希望為此文章類型創建一個永久網址,如:http://www.example.com/customers/postname/
3. 活動(Events):您希望為此文章類型創建一個永久網址,如:http://www.example.com/events/year-month-date-postname/
4. 媒體(Press):您希望為此文章類型創建一個永久網址,如:http://www.example.com/press/category/year/postname/
5. 新聞(News):您希望為此文章類型創建一個永久網址,如:http://www.example.com/news/year/postname/
6. 贊助商(Sponsors):您希望為此文章類型創建一個永久網址,如:http://www.example.com/company/sponsor/post_title/

這個外掛非常容易實現此目的。您只需要前往 Permalinks Customizer 設置頁面,就可以看到帶有文章類型名稱的文本欄。在每個文章類型中定義您要創建的永久網址即可。

如果您未填寫任何文章類型欄位,Permalinks Customizer 將會使用預設的永久網址設置為該文章類型創建永久網址。

如何配置 Permalinks Customizer?導覽到 WordPress 儀表板上的 Permalinks Customizer 選單即可進行配置。

結構標籤(Structure Tags)可協助您查找 Permalinks Customizer 目前支援的所有標籤。

文章類型的預設標籤(Default Tags for PostTypes)由 WordPress 定義。這些標籤可用於預設的 WordPress 永久網址設置頁面以及 Permalinks Customizer 設置頁面。

自定義文章類型的標籤(Custom Tags for PostTypes)由 Permalink

原文外掛簡介

Permalinks Customizer helps you to set the different permalink structure for different PostTypes and Taxonomies which are publicly available.
You can use the tags which are defined by the WordPress as mentioned here. Also, you can use the tags which are customily defined by this plugin for PostTypes and Taxonomies. You can also find these tags in Permalinks Customizer menu on WordPress Dashboard (if the plugin is installed).
How to set the Permalinks for different PostTypes
Let’s assume that you have 6 PostTypes and you like to apply differnet permalink structure for them. Like:

Blog : For this post type you want to create a permalink which looks like this: http://www.example.com/blog/year-month-date-postname/
Customers : For this post type you want to create a permalink which looks like this: http://www.example.com/customers/postname/
Events : For this post type you want to create a permalink which looks like this: http://www.example.com/events/year-month-date-postname/
Press : For this post type you want to create a permalink which looks like this: http://www.example.com/press/category/year/postname/
News : For this post type you want to create a permalink which looks like this: http://www.example.com/news/year/postname/
Sponsors : For this post type you want to create a permalink which looks like this: http://www.example.com/company/sponsor/post_title/

This plugin allows you to do this very easily. You just need to go on Permalinks Customizer Settings Page. Where text fields are shown with PostType name. You can define your permalinks you want to create for each post type.
If you leave any PostType field empty, Permalinks Customizer will create a permalink for that PostType by using the default permalink settings.
How to Configure Permalinks Customizer
You can configure the plugin by navigating to the Permalinks Customizer menu from the WordPress Dashboard
Structure Tags
You can find all the tags which are currently supported by the Permalinks Customizer.
Default Tags for PostTypes
Below mentioned tags are provided by the WordPress. These tags can be used on Default WordPress Permalink Settings Page as well as Permalinks Customizer Settings page.

%year%: The year of the post, four digits, for example 2019
%monthnum%: Month of the year, for example 01
%day%: Day of the month, for example 02
%hour%: Hour of the day, for example 15
%minute%: Minute of the hour, for example 43
%second%: Second of the minute, for example 33
%post_id%: The unique ID of the post, for example 123
%postname%: A sanitized version of the title of the post (post slug field on Edit Post/Page panel). So “This Is A Great Post!” becomes this-is-a-great-post in the URI.
%category%: A sanitized version of the category name (category slug field on New/Edit Category panel). Nested sub-categories appear as nested directories in the URI.
%author%: A sanitized version of the author name.

Custom Tags for PostTypes
Below mentioned tags are provided by the Permalinks Customizer for PostTypes. These tags can not be used on the Default WordPress Permalink Settings Page.

%title%: Title of the post. let’s say the title is “This Is A Great Post!” so, it becomes this-is-a-great-post in the URI.
%parent_title%: This tag is similar as %title%.Only the difference is that it appends the immediate Parent Page Title in the URI if any parent page is selected.
%all_parents_title%: This tag is similar as %title%.Only the difference is that it appends all the Parents Page Title in the URI if any parent page is selected.
%parent_postname%: This tag is similar as %postname%.Only difference is that it appends the immediate Parent Page Slug if any parent page is selected.
%all_parents_postname%: This tag is similar as %postname%.Only the difference is that it appends all the Parents Page Slug in the URI if any parent page is selected.
%child-category%: A sanitized version of the category name (category slug field on New/Edit Category panel).
%product_cat%: A sanitized version of the product category name (category slug field on New/Edit Category panel). Nested sub-categories appear as nested directories in the URI.
This tag is specially used in WooCommerce Products.
: A sanitized version of the custom taxonomy where the taxonomy name is custom_taxonomy. Replace the custom_taxonomy with your appropriate created taxonomy name.
If you want to provide the default slug which is used when the category/taxonomy doesn’t be selected so, make sure to provide default name/slug which looks like this: . Value which is written between the ?? and %> is used as default slug.
: This tag is similar as .Only the difference is that it appends all the Parents Slug in the URI if any parent Term/Category is selected.
%author_firstname%: A sanitized version of the author first name. If author first name is not available then it uses the author’s username.
%author_lastname%: A sanitized version of the author last name. If author last name is not available then it uses the author’s username.

Note: %title% is similar as %postname% tag but the difference is that %postname% can only be set once by WordPress whereas %title% can be changed by user at multiple times. let’s say the title is “This Is A Great Post!” so, it becomes “this-is-a-great-post” in the URI(At the first time, %postname% and %title% works same) but if you edit and change title let’s say “This Is A WordPress Post!” so, %postname% in the URI remains same “this-is-a-great-post” whereas %title% in the URI becomes “this-is-a-wordpress-post”
Custom Tags for Taxonomies
Below mentioned tags are provided by the Permalinks Customizer for Taxonomies. These can not be used on the Default WordPress Permalink Settings Page.

%name%: Name of the Term/Category. let’s say the name is “External API” so, it becomes external-api in the URI.
%term_id%: The unique ID # of the Term/Category, for example 423
%slug%: A sanitized version of the name of the Term/Category. So “External API” becomes external-api in the URI.
%parent_slug%: This tag is similar as %slug%.
Only the difference is that it appends the immediate Parent Term/Category Slug in the URI if any parent Term/Category is selected.
%all_parents_slug%: This tag is similar as %slug%.
Only the difference is that it appends all the Parent Terms/Category Slugs in the URI if any parent Term/Category is selected.

Filters
You can find all the filters below which are provided by Permalinks Customizer plugin. These filters can be used as per your Website requirement.
Exclude Permalinks
If you want to exclude some Permalink to processed with the plugin so, just add the filter looks like this:
function yasglobal_exclude_url( $permalink ) {
if ( false !== strpos( $permalink, '/contact-us/' ) ) {
return '__true';
}
return;
}
add_filter( 'permalinks_customizer_exclude_request', 'yasglobal_exclude_url' );

Show Relative Permalink/URL
To show relative permalink/url in Edit Post, add this filter in your themes functions.php.s
add_filter( 'permalinks_customizer_remove_home_url', '__return_true' );

Exclude PostType from the Plugin
To exclude the plugin to be worked on any PostType. Add this filter in your themes functions.php.
function yasglobal_exclude_post_types( $post_type ) {
if ( $post_type == 'page' ) {
return '__true';
}
return '__false';
}
add_filter( 'permalinks_customizer_exclude_post_type', 'yasglobal_exclude_post_types');

Note: Plugin stops working on the backend. No more permalinks would be generated by the plugin but the permalink which are already created will remains in work.
Disable automatically create redirects
To disable automatically create redirects feature on creating and updating the post/pages/categories, add this filter in your themes functions.php.
add_filter( 'permalinks_customizer_auto_created_redirects', '__return_false');

This filter stops to be creating new redirects but existed redirects keeps working. To stop existed redirects, add permalinks_customizer_disable_redirects filter.
Disable Redirects
To disable redirects to be applied , add this filter in your themes functions.php.
add_filter( 'permalinks_customizer_disable_redirects', '__return_false');

This filter only stop redirects to be work but the automatically create redirects still works. To stop automatically create redirects feature add permalinks_customizer_auto_created_redirects filter.
Bug reports
Bug reports for Permalinks Customizer are welcomed on GitHub. Please note GitHub is not a support forum, and issues that aren’t properly qualified as bugs will be closed.

各版本下載點

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

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


0.1 | 0.2 | 0.3 | 0.4 | 1.0 | 1.1 | 1.2 | 1.3 | 0.3.1 | 0.3.2 | 0.3.3 | 0.3.4 | 0.3.5 | 0.3.6 | 0.3.7 | 0.3.8 | 0.3.9 | 1.0.1 | 1.0.2 | 1.2.1 | 1.2.2 | 1.2.3 | 1.2.4 | 1.2.5 | 1.3.1 | 1.3.2 | 1.3.3 | 1.3.4 | 1.3.5 | 1.3.6 | 1.3.7 | 1.3.8 | 1.3.9 | 2.0.0 | 2.0.1 | 2.1.0 | 2.2.0 | 2.3.0 | 2.3.1 | 2.4.0 | 2.5.0 | 2.5.1 | 2.5.2 | 2.6.0 | 2.7.0 | 2.8.0 | 2.8.1 | 2.8.2 | trunk | 0.3.10 |

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

  • Page Links To 》這個外掛可以讓你將 WordPress 的頁面(或文章或自訂文章類型)連結至你選擇的 URL,而非 WordPress 的 URL。此外,它還會將前往舊的 URL(或「正常」的 URL...。
  • Custom Post Type Permalinks 》自訂文章類型永久連結允許您編輯自訂文章類型的永久連結結構。, 更改自訂分類目錄的永久鏈接,以“example.org/post_type/taxonomy_name/term_slug̶...。
  • Custom Permalinks 》name or slug), add the filter that looks like this:, function yasglobal_exclude_posts( $post ) {, // Replace '2' with ID of the post you want to ...。
  • VK Link Target Controller 》外掛介紹, VK Link Target Controller 外掛可在最近文章列表或存檔頁面中,讓使用者點選文章標題時轉址到其他網頁而非文章內容頁面。, 使用範例, 假設你在 eB...。
  • Title and Nofollow For Links (Classic Editor) 》這個外掛程式在插入連結彈出框中恢復了 WordPress 4.2 中刪除的「Title」欄位,並新增了一個「將連結加上 rel="nofollow"」的勾選框。, Gutengerg(區塊編輯...。
  • Flexy Breadcrumb 》PressTigers 的 Flexy Breadcrumb 是一個簡單而強大的麵包屑導覽系統外掛,適用於 WordPress 網站。使用此外掛,您可以透過 [flexy_breadcrumb] 短碼在網站的...。
  • Nofollow for external link 》這個外掛可以自動為您網站文章、頁面或主題菜單中所有外部連結插入 rel=nofollow 和 target=_blank。, 您也可以設置要排除的域名,選擇不為特定外部連結添加 ...。
  • Link Library 》此外掛用於在您的網站上建立一個頁面,列出 WordPress 管理介面內的 "連結" 部分中所定義的所有連結分類及其內所包含的所有連結。使用者可以選擇是否顯示某些...。
  • Link Juice Keeper 》錯誤 404 ( 找不到頁面 ) 很常見,也是造成搜尋引擎,例如 Google,把網站排名降低的主要原因之一。處理 404 錯誤對於非技術人員來說可能相當複雜。有了這個...。
  • rus to lat advanced 》這款 WordPress 外掛將俄文標題的文件名和連結(從標題中建立)轉換為拉丁字母。俄文標題的文件名和連結在 WordPress 中儲存時經常是不正確的。, 例如,在標...。
  • Custom Meta Widget 》這個外掛的功能和 WordPress 標準的 Meta widget 完全相同,除了它增加了選項來控制要顯示哪些 5 個標準的 Meta widget 連結,並提供一個新增自訂連結的選項...。
  • Autologin Links 》這個外掛讓管理員可以為其 WordPress 網站生成自動登入連結,並以特定使用者名稱登入訪客。管理員可以編輯(生成和刪除)使用者的自動登入連結,而使用者只能...。
  • Track The Click 》追踪點擊次數, Track The Click 外掛能夠幫助網站擁有者更好地了解網站訪客與網站上連結的互動情形。這款外掛主要功能是即時追踪 WordPress 網站上發生的點擊...。
  • Sape – website monetization 》這個外掛程式能夠自動將 Sape 系統的程式碼安裝到網站上。, 這是一個從 Sape 取得利益的網站收益外掛程式。此外掛支援以下的網站收益方式:, , 租借連結, 全...。
  • Ambrosite Next/Previous Post Link Plus 》重要提示:請確保使用正確的外掛程式。, , Next/Previous Post Link Plus 外掛程式適用於單篇文章模板。, Next/Previous Page Link Plus 外掛程式適用於頁面...。

文章
Filter
Apply Filters
Mastodon