[WordPress] 外掛分享: George Page Name Retrieval

前言介紹

  • 這款 WordPress 外掛「George Page Name Retrieval」是 2009-12-20 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2020-08-23,距離現在已有 1714 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.8.6 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

phkcorp2005 |

外掛標籤

george page post name page id title |

內容簡介

您有一個主題,需要過濾某些頁面,使其顯示獨特或進行一些自定義操作。為了在您的主題中進行這些自定義修改,您需要獲取頁面 ID、標題或永久鏈接,然後當該頁面加載時,您可以適當地操作。在「George Page Name ID Retrieval」之前,沒有簡單的方法來檢索此頁面/文章信息。George讓這項任務變得非常簡單。您現在可以直接從 PHP API 或從 WordPress 頁面/文章中使用短代碼獲取此信息。

使用方法

您可以從您的 WordPress 帖子和頁面或者 PHP/主題文件中使用 George。要使用 API,只需調用返回所需頁面信息的函數。為此,有三個 API:

george_get_post_id(); => 返回當前頁面/文章的文章 ID
george_get_post_title(); => 返回頁面標題
george_get_post_name(); => 返回永久鏈接
george_get_pageid_by_permalink($permalink); => 返回指定永久鏈接的頁面/文章 ID
george_get_permalink_by_id($id); => 返回指定頁面/文章 ID的永久鏈接
george_display_shopp_cart_count($url); => 返回指向您的 Shopp 購物車頁面的鏈接,以及總共購物車商品數量,例如「購物車(0)」[需要安裝和啟用 Shopp]

您還可以通過短代碼從 WordPress 頁面/文章調用 API。

[george-query choice=”id|title|name|outid|outperm” value=”permalink|id|url”] => 支援以下選項:

id = 頁面/文章 ID
title = 頁面/文章標題
name = 頁面/文章永久鏈接
outperm = 包含要檢索的頁面 ID 的永久鏈接
outid = 包含指定永久鏈接的頁面 ID
shopp = 獲取您的 Shopp 購物車的購物車數量

您需要在雙引號之間輸入以下值之一:

permalink(outid選項)
id(outperm選項)
url,即您的 Shopp 購物車頁面的 URL

自定義

此插件的代碼直接,易於自定義。如果您定制了此插件並提交了更改,我們將在感謝中提到您的自定義。

您可以編輯george_display_shopp_cart_count()函數,以返回與「購物車」不同的文本。

致謝

感謝所有幫助 George 成為更好插件的人!

聯繫方式

如需支援,請訪問https://github.com/presspage2018/george-page-name-id-retrieval/issues。您需要在github.com上註冊免費帳戶。

如有問題、評論或請求,請聯繫[email protected]或訪問以上論壇。

原文外掛簡介

You have a theme and you need to filter certain pages to either display uniquely or perform
some customized operation. In order to make these custom modifications in your theme, you need
to get the page id, title or permalink and then when that page is loaded, you can act
appropriately. Before “George Page Name ID Retrieval,” ther was no easy way of retrieving this
page/post information. George makes this task very easy. You can now retrieve this information
directly in your theme files from PHP API’s, or from your wordpress pages/posts using shortcodes
Usage
You may use George either in you PHP/Theme files or from your WordPress posts
and pages. To use the API, simple invoke the function that returns the page
information requested. There are three API’s for this purpose:

george_get_post_id(); => Returns the Post ID of the current page/post
george_get_post_title(); => Returns the Page Title
george_get_post_name(); => Returns the permalink page/post name
george_get_pageid_by_permalink($permalink); => Returns the page/post ID for the specified permalink
george_get_permalink_by_id($id); => Returns the permalink for the specified page/post id
george_display_shopp_cart_count($url); => Returns a link to your Shopp shopping cart page with the total cart items as, Shopping Cart (0) [requires Shopp to be installed and activated]

You can also invoke the API’s from your WordPress pages/posts through short codes.
[george-query choice=”id|title|name|outid|outperm” value=”permalink|id|url”] => where,

id = the page/post id
title = the page/post title
name = the page/post permalink name
outperm = contains the permalink of the page id to retrieve
outid = contains the id of the page from the specified permalink
shopp = gets the cart count for your Shopp shopping cart

You enter one of the following values between double quotes:

permalink for choice outid
id for choice outperm
url is the url of your Shopp shopping cart page

Customization
The code written for this plugin is straight forward and can easily be customized.
If you do customized this plugin and submit your changes to us, we will make honorable
mention of your customization in the Credits.
You can edit the george_display_shopp_cart_count() function to return a different text other
than “Shopping cart”
Credits
We make honorable mention to anyone who helps make George a better plugin!
Contact
For support, go to https://github.com/presspage2018/george-page-name-id-retrieval/issues. You will require a free account on github.com.0
Please contact [email protected] or visit the above forum with questions, comments, or requests.

各版本下載點

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

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


最新版本

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

暫無相關外掛推薦。

文章
Filter
Apply Filters
Mastodon