02 admin_notices 管理者後台時,通知管理者動作

function hello_dolly_get_lyric() {
/** These are the lyrics to Hello Dolly */
$lyrics = "Hello, Dolly
Well, hello, Dolly
Dolly’ll never go away again";

// Here we split it into lines
$lyrics = explode( "\n", $lyrics );

// And then randomly choose a line
return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) – 1 ) ] );

// This just echoes the chosen line, we’ll position it later
function hello_dolly() {
$chosen = hello_dolly_get_lyric();
echo "<p id=’dolly’>$chosen</p>";

// Now we set that function up to execute when the admin_notices action is called
add_action( ‘admin_notices’, ‘hello_dolly’ );



CH02用戶資料CH03基本APICH05 分類頁面Category.phpCH09Screen Options(顯示選項)CH10外掛pluginsCH11 add_actionCH12 add_filterCH13Meta Box(自訂區塊)CH14widget(自訂模組)CH15 DBCH16AJAXCH17ShortcodeCH20 wordpress muCH30WooCommerce