WordPress Snippet

ワードプレスをカスタマイズしよう

Dashboard Right Nowへのメッセージの追加

functions.php

Action hooks below

add_action('right_now_content_table_end', 'custom_post_dashboard');
function custom_post_dashboard(){

	echo "<tr><td> right_now_content_table_end hook title</td><td style='color:red'> text</td></tr>";
}

add_action('right_now_discussion_table_end', 'custom_post_dashboard2');
function custom_post_dashboard2(){
	echo "<tr><td>right_now_discussion_table_end hook title</td><td style='color:red'>right_now_discussion_table_end hook text</td></tr>";
}

add_action('rightnow_end', 'custom_post_dashboard3');
function custom_post_dashboard3(){

	echo "rightnow_end hook text maybe strip_tags";
}

add_action('right_now_table_end', 'custom_post_dashboard4');
function custom_post_dashboard4(){

	echo "<tr><td>right_now_table_end hook title</td><td style='color:red'>rright_now_table_end hook text</td></tr>";
}

Output html

<div id="dashboard_right_now" class="postbox ">
	<div class="handlediv" title="Click to toggle"><br></div>
	<h3 class="hndle">
		<span>Right Now</span>
	</h3>
	<div class="inside">
		<div class="table table_content">
			<p class="sub">Content</p>
			<table>
			<tbody>
				<tr class="first">
					<td class="first b b-posts">
						<a href="edit.php">25</a>
					</td>
					<td class="t posts">
						<a href="edit.php">Posts</a>
					</td>
				</tr>
				<tr>
					<td class="first b b_pages">
						<a href="edit.php?post_type=page">12</a>
					</td>
					<td class="t pages">
						<a href="edit.php?post_type=page">Pages</a>
					</td>
				</tr>
				<tr>
					<td class="first b b-cats">
						<a href="edit-tags.php?taxonomy=category">54</a>
					</td>
					<td class="t cats">
						<a href="edit-tags.php?taxonomy=category">Categories</a>
					</td>
				</tr>
				<tr>
					<td class="first b b-tags">
						<a href="edit-tags.php">49</a>
					</td>
					<td class="t tags">
						<a href="edit-tags.php">Tags</a>
					</td>
				</tr>
				<tr>
					<td>your title</td>
					<td style="color:red">Add your text</td>
				</tr>
			</tbody>
			</table>
		</div>
		<div class="table table_discussion">
			<p class="sub">Discussion</p>
			<table>
			<tbody>
				<tr class="first">
					<td class="b b-comments">
						<a href="edit-comments.php">
							<span class="total-count">29</span>
						</a>
					</td>
					<td class="last t comments">
						<a href="edit-comments.php">Comments</a>
					</td>
				</tr>
				<tr>
					<td class="b b_approved">
						<a href="edit-comments.php?comment_status=approved">
							<span class="approved-count">29</span>
						</a>
					</td>
					<td class="last t">
						<a class="approved" href="edit-comments.php?comment_status=approved">pproved
						</a>
					</td>
				</tr>
				<tr>
					<td class="b b-waiting">
						<a href="edit-comments.php?comment_status=moderated">
							<span class="pending-count">0</span>
						</a>
					</td>
					<td class="last t">
						<a class="waiting" href="edit-comments.php?comment_status=moderated">ending
						</a>
					</td>
				</tr>
				<tr>
					<td class="b b-spam">
						<a href="edit-comments.php?comment_status=spam">
							<span class="spam-count">0</span>
						</a>
					</td>
					<td class="last t">
						<a class="spam" href="edit-comments.php?comment_status=spam">Spam</a>
					</td>
				</tr>
				
				<tr>
					<td>
						right_now_table_end
						hook title
					</td>
					<td style="color:red">rright_now_table_end hook text</td>
				</tr>
				
				<tr>
					<td>right_now_discussion_table_end hook title</td>
					<td style="color:red">right_now_discussion_table_end hook text</td>
				</tr>
				
			</tbody>
			</table>
		</div>
		<div class="versions">
			<p>
				Theme
				<span class="b">
					<a href="themes.php">Enough</a>
				</span>
				with
				<span class="b">
					<a href="widgets.php">6 Widgets</a>
				</span>
			</p>
			<p>
					<a href="options-privacy.php" title="Your site is asking search engines not to index its content">
					Search Engines Blocked
				</a>
			</p>
			<span id="wp-version-message">
				You are using
				<span class="b">WordPress 3.3.1</span>
				.
			</span>
			<br class="clear">
		</div>

		rightnow_end
		hook titlerightnow_end hook text
	</div>
</div>

[emulsion_relate_posts]