[WordPress] 外掛分享: Monetize Me

首頁外掛目錄 › Monetize Me
WordPress 外掛 Monetize Me 的封面圖片
全新外掛
安裝啟用
尚無評分
26 天前
最後更新
問題解決
WordPress 5.8+ PHP 7.4+ v3.0.3 上架:2017-08-06

內容簡介

Monetize Me 是一款模組化的廣告管理外掛,專為 Google AdSense 及其他可信的第三方獲利代碼設計。它提供簡單的設定選項,幫助用戶有效管理廣告類別、贊助商及廣告位置,提升網站的獲利能力。

【主要功能】
• 獨立管理廣告類別與贊助商
• 儲存各種獲利代碼(如 Google AdSense)
• 支援隨機選擇廣告顯示
• 使用短碼或 Gutenberg 區塊渲染廣告
• 自訂廣告插入位置與間隔
• 網路管理功能支援多站點安裝

外掛標籤

開發者團隊

⬇ 下載最新版 (v3.0.3) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Monetize Me」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Monetize Me is a modular, option-based advertising manager for Google AdSense and other trusted third-party monetization code. It does not register a custom post type or taxonomy.
The plugin provides four top-level settings tabs:

Ads
Ad Categories
Sponsors
Placements

A new installation includes these starter categories:

Header Ads (header-ads)
Footer Ads (footer-ads)
In-article Ads (in-article-ads)
Sidebar Ads (sidebar-ads)

It also includes the starter sponsor General (general). The records are editable and removable.
Main features:

Manage ad categories and sponsors independently.
Save trusted Google AdSense, script, iframe, HTML, or other monetization code.
Assign one category and one sponsor to each ad.
Enable or disable individual ads.
Keep saved ad cards collapsed initially and expand or collapse them from their headers for easier management of large ad libraries.
Randomly select one enabled ad when several ads match the requested filters.
Render ads through the [mmps] shortcode.
Render ads through the dynamic Advertisement Gutenberg block.
Map categories and sponsors to supported theme action hooks.
Insert ads between archive items using random intervals or exact positions.
Insert ads before content, after content, and between paragraphs.
Select which public post types receive automatic Post Content Ads.
Optionally enqueue the bundled frontend stylesheet.
Extend selection, placement, and rendering with public functions, actions, and filters.

Automatic archive and Post Content Ads are disabled initially. Enable them from Monetize Me > Placements after creating an enabled ad that matches the selected category and sponsor.
On a single-site installation, settings are stored in one regular option and managed from the top-level Monetize Me admin menu.
On WordPress Multisite, the plugin is network-managed. Settings are available only from the top-level Monetize Me page in Network Admin, and one network option controls all sites.
Shortcode
Basic random enabled ad:
[mmps]

Filter by category slug:
[mmps adcategory="in-article-ads"]

Filter by category and sponsor and add an outer CSS class:
[mmps adcategory="in-article-ads" adsponsor="general" classname="article-ad"]

Attributes:

adcategory – Saved category ID, name, or slug.
adsponsor – Saved sponsor ID, name, or slug.
classname – Space-separated CSS classes added to the outer .monetize-me container.

The shortcode always renders one randomly selected enabled ad from the matching records.
Gutenberg Block
Search the block inserter for Advertisement.
Block controls:

Ad Category
Ad Sponsor
Extra CSS Class

The dynamic block always renders one randomly selected matching ad. It always uses the standard frontend wrapper. The editor displays a safe configuration preview and does not execute saved ad scripts or iframes.
Theme Developer Integration
Monetize Me registers callbacks on the following theme action hooks. Add the relevant do_action() call at the intended location in a theme or child theme, then map a category and sponsor to that hook from Monetize Me > Placements. An optional space-separated CSS class string can be passed with each hook and is added to the outer .monetize-me container.
After the site header:

Immediately before the site footer:

Before an archive loop starts:

After an archive loop ends:

After each archive item:
current_post + 1;

do_action(
'monetize_me_between_archive_item',
get_post(),
$position,
'archive-list-ad'
);
?>

$position must be a one-based archive item number. The optional third argument is a space-separated CSS class string. The between-item hook renders only when Archive Loop Ads are enabled and the current position matches the configured interval or exact-position rule.

Random interval example: a minimum of 3 and maximum of 4 displays the next ad after a randomly selected gap of three or four additional archive items.
Exact-position example: 3,7,10 displays ads after archive items 3, 7, and 10.
Post Content Ads
Post Content Ads use the the_content filter only on selected singular public post types in the main query and main loop. Password-protected content, feeds, admin requests, and JSON requests are excluded.
Available placements:

Before content
After content
Between paragraphs

The webmaster can select one or more public post types, including registered custom post types. The standard post type is selected by default.
Inline random interval example: a minimum of 3 and maximum of 4 places each next ad after a randomly selected gap of three or four additional paragraphs.
Inline exact-position example: 3,7,10 inserts ads after paragraphs 3, 7, and 10.
Frontend Markup and CSS
All shortcode, block, hook, archive, and Post Content Ad output uses this structure:

The selected category slug is added to the outer container. Shortcode and block extra classes are also added to that outer container.
The bundled assets/css/frontend.css file is enabled by default. It adds vertical spacing, gives the ad wrapper a measurable full width for responsive networks such as Google AdSense, and centers fixed-size ad content. Disable it from Monetize Me > Placements > Frontend Styles only when the active theme provides equivalent width and alignment rules.
Public Functions
Category APIs:

monetize_me_get_categories()
monetize_me_get_category( $identifier )
monetize_me_get_category_options()

Sponsor APIs:

monetize_me_get_sponsors()
monetize_me_get_sponsor( $identifier )
monetize_me_get_sponsor_options()

Ad selection and rendering APIs:

monetize_me_get_ads( $enabled_only = false )
monetize_me_get_ad( $ad_id )
monetize_me_get_matching_ads( $category = '', $sponsor = '' )
monetize_me_select_ad( $category = '', $sponsor = '', $context = array() )
monetize_me_render_ad( $category = '', $sponsor = '', $classname = '', $context = array() )
monetize_me_render_ad_record( $ad, $classname = '', $context = array() )

Render one random matching ad from a theme template:
'theme_template',
)
);

echo $ad_html; // Intentionally contains trusted ad-network script or iframe markup.
?>

Placement and settings APIs:

monetize_me_get_theme_placements()
monetize_me_get_placement_settings()
monetize_me_get_theme_hook_settings( $hook_name )
monetize_me_get_archive_placement_settings()
monetize_me_get_content_placement_settings()
monetize_me_get_content_post_type_options()
monetize_me_should_display_archive_ad( $position )
monetize_me_get_placement_ad( $hook_name, $context = array(), $classname = '' )
monetize_me_render_placement( $hook_name, $context = array(), $classname = '' )
monetize_me_settings_page_url()

Frontend stylesheet APIs:

monetize_me_should_enqueue_frontend_css()
monetize_me_enqueue_frontend_css()

Important filters include:

monetize_me_get_categories
monetize_me_get_sponsors
monetize_me_get_ads
monetize_me_matching_ads
monetize_me_selected_ad
monetize_me_ad_code
monetize_me_rendered_ad
monetize_me_theme_placements
monetize_me_placement_settings
monetize_me_should_display_archive_ad
monetize_me_content_post_type_options
monetize_me_content_post_types
monetize_me_should_enqueue_frontend_css

Raw Ad Code and Security
Ad network code commonly requires

文章
Filter
Mastodon