<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Php Development &#187; wordpress</title>
	<atom:link href="http://www.maheshchari.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maheshchari.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 23 May 2010 05:10:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Word Press Plugin API/Filter Reference</title>
		<link>http://www.maheshchari.com/word-press-plugin-apifilter-reference/</link>
		<comments>http://www.maheshchari.com/word-press-plugin-apifilter-reference/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 20:26:37 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=528</guid>
		<description><![CDATA[


Word Press Plugin API/Filter Reference and cheetsheet. 

 Post, Page, and Attachment  Filters 
  Database Reads 

attachment_fields_to_edit
 applied to the form fields to be displayed when editing an attachment. Called in the get_attachment_fields_to_edit function. Filter function arguments: an array of form fields, the post object. 


attachment_icon
 applied to the icon for an attachment [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css">
<!--
#wp-index dl dd {
	display: none;
	position: absolute;
	top: 0px;
	width: 400px;
	background: #FFFFFF;
	right: -380px;
	border: 1px solid #CCCCCC;
	z-index: 55;
	padding: 5px;
}
#wp-index dl.vis dd{
display:block;
}
#wp-index dl {
	display: block;
	position: relative;
	width: 200px;
	margin: 5px 0px 0px;
	padding-left: 20px;
}
#wp-index tt {
	font-weight: bold;
}
#wp-index a {
	text-decoration: none;
	color: #333333;
	font-weight: bold;
}
#wp-index a:hover {
	text-decoration: none;
	color: #FF6600;
	font-weight: bold;
}
-->
</style>
<h1 >Word Press Plugin API/Filter Reference and cheetsheet. </h1>
<div id="wp-index">
<h2> Post, Page, and Attachment  Filters </h2>
<h3> <span class="mw-headline"> Database Reads </span></h3>
<dl>
<dt><a href="#">attachment_fields_to_edit</a></dt>
<dd> applied to the form fields to be displayed when editing an attachment. Called in the <tt>get_attachment_fields_to_edit</tt> function. Filter function arguments: an array of form fields, the post object. </dd>
</dl>
<dl >
<dt><a href="#">attachment_icon</a></dt>
<dd> applied to the icon for an attachment in the <tt>get_attachment_icon</tt> function. Filter function arguments: icon file as an HTML IMG tag, attachment ID. </dd>
</dl>
<dl>
<dt><a href="#">attachment_innerHTML</a></dt>
<dd> applied to the title to be used for an attachment if there is no icon, in the <tt>get_attachment_innerHTML</tt> function. Filter function arguments: inner HTML (defaults to the title), attachment ID. </dd>
</dl>
<dl>
<dt><a href="#">content_edit_pre</a></dt>
<dd> applied to post content prior to display for editing. </dd>
</dl>
<dl>
<dt><a href="#">excerpt_edit_pre</a></dt>
<dd> applied to post excerpt prior to display for editing. </dd>
</dl>
<dl>
<dt><a href="#">get_attached_file</a></dt>
<dd> applied to the attached file information retrieved by the <tt>get_attached_file</tt> function. Filter function arguments: file information, attachment ID. </dd>
</dl>
<dl>
<dt><a href="#">get_enclosed</a></dt>
<dd> applied to the enclosures list for a post by the <tt>get_enclosed</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">get_pages</a></dt>
<dd> applied to the list of pages returned by the <tt>get_pages</tt> function. Filter function arguments: list of pages (each item of which contains a page data array), <tt>get_pages</tt> function argument list (telling which pages were requested). </dd>
</dl>
<dl>
<dt><a href="#">get_pung</a></dt>
<dd> applied to the list of pinged URLs for a post by the <tt>get_pung</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">get_the_excerpt</a></dt>
<dd> applied to the post&#8217;s excerpt in the <tt>get_the_excerpt</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">get_the_guid</a></dt>
<dd> applied to the post&#8217;s GUID in the <tt>get_the_guid</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">get_to_ping</a></dt>
<dd> applied to the list of URLs to ping for a post by the <tt>get_to_ping</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">icon_dir</a></dt>
<dd> applied to the template&#8217;s image directory in several functions. Basically allows a plugin to specify that icons for MIME types should come from a different location. </dd>
</dl>
<dl>
<dt><a href="#">icon_dir_uri</a></dt>
<dd> applied to the template&#8217;s image directory URI in several functions. Basically allows a plugin to specify that icons for MIME types should come from a different location. </dd>
</dl>
<dl>
<dt><a href="#">prepend_attachment</a></dt>
<dd> applied to the HTML to be prepended by the <tt>prepend_attachment</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">sanitize_title</a></dt>
<dd> applied to a post title by the <tt>sanitize_title</tt> function, after stripping out HTML tags. </dd>
</dl>
<dl>
<dt><a href="#">single_post_title</a></dt>
<dd> applied to the post title when used to create a blog page title by the <tt>wp_title</tt> and <tt>single_post_title</tt> functions. </dd>
</dl>
<dl>
<dt><a href="#">the_content</a></dt>
<dd> applied to the post content retrieved from the database, prior to printing on the screen (also used in some other operations, such as trackbacks). </dd>
</dl>
<dl>
<dt><a href="#">the_content_rss</a></dt>
<dd> applied to the post content prior to including in an RSS feed. </dd>
</dl>
<dl>
<dt><a href="#">the_editor_content</a></dt>
<dd> applied to post content before putting it into a rich editor window. </dd>
</dl>
<dl>
<dt><a href="#">the_excerpt</a></dt>
<dd> applied to the post excerpt (or post content, if there is no excerpt) retrieved from the database, prior to printing on the screen (also used in some other operations, such as trackbacks). </dd>
</dl>
<dl>
<dt><a href="#">the_excerpt_rss</a></dt>
<dd> applied to the post excerpt prior to including in an RSS feed. </dd>
</dl>
<dl>
<dt><a href="#">the_tags</a></dt>
<dd> applied to the tags retrieved from the database, prior to printing on the screen. </dd>
</dl>
<dl>
<dt><a href="#">the_title</a></dt>
<dd> applied to the post title retrieved from the database, prior to printing on the screen (also used in some other operations, such as trackbacks). </dd>
</dl>
<dl>
<dt><a href="#">the_title_rss</a></dt>
<dd> applied to the post title before including in an RSS feed (after first filtering with <tt>the_title</tt>. </dd>
</dl>
<dl>
<dt><a href="#">title_edit_pre</a></dt>
<dd> applied to post title prior to display for editing. </dd>
</dl>
<dl>
<dt><a href="#">wp_dropdown_pages</a></dt>
<dd> applied to the HTML dropdown list of WordPress pages generated by the <tt>wp_dropdown_pages</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">wp_list_pages</a></dt>
<dd> applied to the HTML list generated by the <tt>wp_list_pages</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">wp_list_pages_excludes</a></dt>
<dd> applied to the list of excluded pages (an array of page IDs) in the <tt>wp_list_pages</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">wp_get_attachment_metadata</a></dt>
<dd> applied to the attachment metadata retrieved by the <tt>wp_get_attachment_metadata</tt> function. Filter function arguments: meta data, attachment ID. </dd>
</dl>
<dl>
<dt><a href="#">wp_get_attachment_thumb_file</a></dt>
<dd> applied to the attachment thumbnail file retrieved by the <tt>wp_get_attachment_thumb_file</tt> function. Filter function arguments: thumbnail file, attachment ID. </dd>
</dl>
<dl>
<dt><a href="#">wp_get_attachment_thumb_url</a></dt>
<dd> applied to the attachment thumbnail URL retrieved by the <tt>wp_get_attachment_thumb_URL</tt> function. Filter function arguments: thumbnail URL, attachment ID. </dd>
</dl>
<dl>
<dt><a href="#">wp_get_attachment_url</a></dt>
<dd> applied to the attachment URL retrieved by the <tt>wp_get_attachment_url</tt> function. Filter function arguments: URL, attachment ID. </dd>
</dl>
<dl>
<dt><a href="#">wp_mime_type_icon</a></dt>
<dd> applied to the MIME type icon for an attachment calculated by the <tt>wp_mime_type_icon</tt> function. Filter function arguments: icon URI calculated, MIME type, post ID. </dd>
</dl>
<dl>
<dt><a href="#">wp_title</a></dt>
<dd> applied to the blog page title before sending to the browser in the <tt>wp_title</tt> function. </dd>
</dl>
<h3> <span class="mw-headline"> Database Writes </span></h3>
<dl>
<dt><a href="#">add_ping</a></dt>
<dd> applied to the new value of the pinged field on a post when a ping is added, prior to saving the new information in the database. </dd>
</dl>
<dl>
<dt><a href="#">attachment_fields_to_save</a></dt>
<dd> applied to fields associated with an attachment prior to saving them in the database. Called in the <tt>media_upload_form_handler</tt> function. Filter function arguments: an array of post attributes, an array of attachment fields including the changes submitted from the form. </dd>
</dl>
<dl>
<dt><a href="#">attachment_max_dims</a></dt>
<dd> applied to the maximum image dimensions before reducing an image size. Filter function input (and return value) is either false (if no maximum dimensions have been specified) or a two-item list (width, height). </dd>
</dl>
<dl>
<dt><a href="#">category_save_pre</a></dt>
<dd> applied to post category comma-separated list prior to saving it in the database (also used for attachments). </dd>
</dl>
<dl>
<dt><a href="#">comment_status_pre</a></dt>
<dd> applied to post comment status prior to saving it in the database (also used for attachments). </dd>
</dl>
<dl>
<dt><a href="#">content_filtered_save_pre</a></dt>
<dd> applied to filtered post content prior to saving it in the database (also used for attachments). </dd>
</dl>
<dl>
<dt><a href="#">content_save_pre</a></dt>
<dd> applied to post content prior to saving it in the database (also used for attachments). </dd>
</dl>
<dl>
<dt><a href="#">excerpt_save_pre</a></dt>
<dd> applied to post excerpt prior to saving it in the database (also used for attachments). </dd>
</dl>
<dl>
<dt><a href="#">name_save_pre</a></dt>
<dd> applied to post name prior to saving it in the database (also used for attachments). </dd>
</dl>
<dl>
<dt><a href="#">phone_content</a></dt>
<dd> applied to the content of a post submitted by email, before saving. </dd>
</dl>
<dl>
<dt><a href="#">ping_status_pre</a></dt>
<dd> applied to post ping status prior to saving it in the database (also used for attachments). </dd>
</dl>
<dl>
<dt><a href="#">post_mime_type_pre</a></dt>
<dd> applied to the MIME type for an attachment prior to saving it in the database. </dd>
</dl>
<dl>
<dt><a href="#">status_save_pre</a></dt>
<dd> applied to post status prior to saving it in the database. </dd>
</dl>
<dl>
<dt><a href="#">thumbnail_filename</a></dt>
<dd> applied to the file name for the thumbnail when uploading an image. </dd>
</dl>
<dl>
<dt><a href="#">wp_thumbnail_creation_size_limit</a></dt>
<dd> applied to the size of the thumbnail when uploading an image. Filter function arguments: max file size, attachment ID, attachment file name. </dd>
</dl>
<dl>
<dt><a href="#">wp_thumbnail_max_side_length</a></dt>
<dd> applied to the size of the thumbnail when uploading an image. Filter function arguments: image side max size, attachment ID, attachment file name. </dd>
</dl>
<dl>
<dt><a href="#">title_save_pre</a></dt>
<dd> applied to post title prior to saving it in the database (also used for attachments). </dd>
</dl>
<dl>
<dt><a href="#">update_attached_file</a></dt>
<dd> applied to the attachment information prior to saving in post metadata in the <tt>update_attached_file</tt> function. Filter function arguments: attachment information, attachment ID. </dd>
</dl>
<dl>
<dt><a href="#">wp_delete_file</a></dt>
<dd> applied to an attachment file name just before deleting. </dd>
</dl>
<dl>
<dt><a href="#">wp_generate_attachment_metadata</a></dt>
<dd> applied to the attachment metadata array before saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">wp_update_attachment_metadata</a></dt>
<dd> applied to the attachment metadata just before saving in the <tt>wp_update_attachment_metadata</tt> function. Filter function arguments: meta data, attachment ID. </dd>
</dl>
<h2> <span class="mw-headline"> Comment, Trackback, and Ping Filters </span></h2>
<dl>
<dt><a href="#">comment_excerpt</a></dt>
<dd> applied to the comment excerpt by the <tt>comment_excerpt</tt> function. See also <tt>get_comment_excerpt</tt>. </dd>
</dl>
<dl>
<dt><a href="#">comment_flood_filter</a></dt>
<dd> applied when someone appears to be flooding your blog with comments. Filter function arguments: already blocked (true/false, whether a previous filtering plugin has already blocked it; set to true and return true to block this comment in a plugin), time of previous comment, time of current comment. </dd>
</dl>
<dl>
<dt><a href="#">comment_post_redirect</a></dt>
<dd> applied to the redirect location after someone adds a comment. Filter function arguments: redirect location, comment info array. </dd>
</dl>
<dl>
<dt><a href="#">comment_text</a></dt>
<dd> applied to the comment text before displaying on the screen by the <tt>comment_text</tt> function, and in the admin menus. </dd>
</dl>
<dl>
<dt><a href="#">comment_text_rss</a></dt>
<dd> applied to the comment text prior to including in an RSS feed. </dd>
</dl>
<dl>
<dt><a href="#">comments_array</a></dt>
<dd> applied to the array of comments for a post in the <tt>comments_template</tt> function. Filter function arguments: array of comment information structures, post ID. </dd>
</dl>
<dl>
<dt><a href="#">comments_number</a></dt>
<dd> applied to the formatted text giving the number of comments generated by the <tt>comments_number</tt> function. See also <tt>get_comments_number</tt>. </dd>
</dl>
<dl>
<dt><a href="#">get_comment_excerpt</a></dt>
<dd> applied to the comment excerpt read from the database by the <tt>get_comment_excerpt</tt> function (which is also called by <tt>comment_excerpt</tt>. See also <tt>comment_excerpt</tt>. </dd>
</dl>
<dl>
<dt><a href="#">get_comment_ID</a></dt>
<dd> applied to the comment ID read from the global <tt>$comments</tt> variable by the <tt>get_comment_ID</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">get_comment_text</a></dt>
<dd> applied to the comment text of the current comment in the <tt>get_comment_text</tt> function, which is also called by the <tt>comment_text</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">get_comment_type</a></dt>
<dd> applied to the comment type (&#8220;comment&#8221;, &#8220;trackback&#8221;, or &#8220;pingback&#8221;) by the <tt>get_comment_type</tt> function (which is also called by <tt>comment_type</tt>). </dd>
</dl>
<dl>
<dt><a href="#">get_comments_number</a></dt>
<dd> applied to the comment count read from the <tt>$post</tt> global variable by the <tt>get_comments_number</tt> function (which is also called by the <tt>comments_number</tt> function; see also <tt>comments_number</tt> filter). </dd>
</dl>
<dl>
<dt><a href="#">post_comments_feed_link</a></dt>
<dd> applied to the feed URL generated for the comments feed by the <tt>comments_rss</tt> function. </dd>
</dl>
<h3> <span class="mw-headline"> Database Writes </span></h3>
<dl>
<dt><a href="#">comment_save_pre</a></dt>
<dd> applied to the comment data just prior to updating/editing comment data. Function arguments: comment data array, with indices &#8220;comment_post_ID&#8221;, &#8220;comment_author&#8221;, &#8220;comment_author_email&#8221;, &#8220;comment_author_url&#8221;, &#8220;comment_content&#8221;, &#8220;comment_type&#8221;, and &#8220;user_ID&#8221;. </dd>
</dl>
<dl>
<dt><a href="#">pre_comment_approved</a></dt>
<dd> applied to the current comment&#8217;s approval status (true/false) to allow a plugin to override. Return true/false and set first argument to true/false to approve/disapprove the comment, and use global variables such as <tt>$comment_ID</tt> to access information about this comment. </dd>
</dl>
<dl>
<dt><a href="#">pre_comment_content</a></dt>
<dd> applied to the content of a comment prior to saving the comment in the database. </dd>
</dl>
<dl>
<dt><a href="#">preprocess_comment</a></dt>
<dd> applied to the comment data prior to any other processing, when saving a new comment in the database. Function arguments: comment data array, with indices &#8220;comment_post_ID&#8221;, &#8220;comment_author&#8221;, &#8220;comment_author_email&#8221;, &#8220;comment_author_url&#8221;, &#8220;comment_content&#8221;, &#8220;comment_type&#8221;, and &#8220;user_ID&#8221;. </dd>
</dl>
<dl>
<dt><a href="#">wp_insert_post_data</a></dt>
<dd> applied to modified and unmodified post data in wp_insert_post() prior to update or insertion of post into database. Function arguments: modified and extended post array and sanitized post array. </dd>
</dl>
<h2> <span class="mw-headline"> Category Filters </span></h2>
<dl>
<dt><a href="#">category_description</a></dt>
<dd> applied to the &#8220;description&#8221; field categories by the <tt>category_description</tt> and <tt>wp_list_categories</tt> functions. Filter function arguments: description, category ID when called from <tt>category_description</tt>; description, category information array (all fields from the category table for that particular category) when called from <tt>wp_list_categories</tt> (sorry, but that&#8217;s how it is). </dd>
</dl>
<dl>
<dt><a href="#">category_feed_link</a></dt>
<dd> applied to the feed URL generated for the category feed by the <tt>get_category_rss_link</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">category_link</a></dt>
<dd> applied to the URL created for a category by the <tt>get_category_link</tt> function. Filter function arguments: link URL, category ID. </dd>
</dl>
<dl>
<dt><a href="#">get_categories</a></dt>
<dd> applied to the category list generated by the <tt>get_categories</tt> function (which is in turn used by many other functions). Filter function arguments: category list, <tt>get_categories</tt> options list. </dd>
</dl>
<dl>
<dt><a href="#">get_category</a></dt>
<dd> applied to the category information that the <tt>get_category</tt> function looks up, which is basically an array of all the fields in WordPress&#8217;s category table for a particular category ID. </dd>
</dl>
<dl>
<dt><a href="#">list_cats</a></dt>
<dd> called for two different purposes: </dd>
</dl>
<dl>
<dt><a href="#">list_cats_exclusions</a></dt>
<dd> applied to the SQL WHERE statement giving the categories to be excluded by the <tt>get_categories</tt> function. Typically, a plugin would add to this list, in order to exclude certain categories or groups of categories from category lists. Filter function arguments: excluded category WHERE clause, <tt>get_categories</tt> options list. </dd>
</dl>
<dl>
<dt><a href="#">single_cat_title</a></dt>
<dd> applied to the category name when used to create a blog page title by the <tt>wp_title</tt> and <tt>single_cat_title</tt> functions. </dd>
</dl>
<dl>
<dt><a href="#">the_category</a></dt>
<dd> applied to the list of categories (an HTML list with links) created by the <tt>get_the_category_list</tt> function. Filter function arguments: generated HTML text, list separator being used (empty string means it is a default LI list), <tt>parents</tt> argument to <tt>get_the_category_list</tt>. </dd>
</dl>
<dl>
<dt><a href="#">the_category_rss</a></dt>
<dd> applied to the category list (a list of category XML elements) for a post by the <tt>get_the_category_rss</tt> function, before including in an RSS feed. Filter function arguments are the list text and the type (&#8220;rdf&#8221; or &#8220;rss&#8221; generally). </dd>
</dl>
<dl>
<dt><a href="#">wp_dropdown_cats</a></dt>
<dd> applied to the drop-down category list (a text string containing HTML option elements) generated by the <tt>wp_dropdown_categories</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">wp_list_categories</a></dt>
<dd> applied to the category list (an HTML list) generated by the <tt>wp_list_categories</tt> function. </dd>
</dl>
<h3> <span class="mw-headline"> Database Writes </span></h3>
<dl>
<dt><a href="#">pre_category_description</a></dt>
<dd> applied to the category desription prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_category_name</a></dt>
<dd> applied to the category name prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_category_nicename</a></dt>
<dd> applied to the category nice name prior to saving in the database. </dd>
</dl>
<h2> <span class="mw-headline"> Link Filters </span></h2>
<dl>
<dt><a href="#">attachment_link</a></dt>
<dd> applied to the calculated attachment permalink by the <tt>get_attachment_link</tt> function. Filter function arguments: link URL, attachment ID. </dd>
</dl>
<dl>
<dt><a href="#">author_feed_link</a></dt>
<dd> applied to the feed URL generated for the author feed by the <tt>get_author_rss_link</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">author_link</a></dt>
<dd> applied to the author&#8217;s archive permalink created by the <tt>get_author_posts_url</tt> function. Filter function arguments: link URL, author&#8217;s &#8220;nice&#8221; name, author ID. Note that <tt>get_author_posts_url</tt> is called within functions <tt>wp_list_authors</tt> and <tt>the_author_posts_link</tt>. </dd>
</dl>
<dl>
<dt><a href="#">comment_reply_link</a></dt>
<dd> applied to the link generated for replying to a specific comment by the <tt>get_comment_reply_link</tt> function which is called within function <tt>comments_template</tt>. Filter function arguments: link (string), custom options (array), current comment (object), current post (object). </dd>
</dl>
<dl>
<dt><a href="#">day_link</a></dt>
<dd> applied to the link URL for a daily archive by the <tt>get_day_link</tt> function. Filter function arguments: URL, year, month number, day number. </dd>
</dl>
<dl>
<dt><a href="#">feed_link</a></dt>
<dd> applied to the link URL for a feed by the <tt>get_feed_link</tt> function. Filter function arguments: URL, type of feed (e.g. &#8220;rss2&#8243;, &#8220;atom&#8221;, etc.). </dd>
</dl>
<dl>
<dt><a href="#">get_comment_author_link</a></dt>
<dd> applied to the HTML generated for the author&#8217;s link on a comment, in the <tt>get_comment_author_link</tt> function (which is also called by <tt>comment_author_link</tt>. Action function arguments: user name </dd>
</dl>
<dl>
<dt><a href="#">get_comment_author_url_link</a></dt>
<dd> applied to the HTML generated for the author&#8217;s lnik on a comment, in the <tt>get_comment_author_url_link</tt> function (which is also called by <tt>comment_author_link</tt>). </dd>
</dl>
<dl>
<dt><a href="#">month_link</a></dt>
<dd> applied to the link URL for a monthly archive by the <tt>get_month_link</tt> function. Filter function arguments: URL, year, month number. </dd>
</dl>
<dl>
<dt><a href="#">page_link</a></dt>
<dd> applied to the calculated page URL by the <tt>get_page_link</tt> function. Filter function arguments: URL, page ID. Note that there is also an internal filter called <tt>_get_page_link</tt> that can be used to filter the URLS of pages that are not designated as the blog&#8217;s home page (same arguments). </dd>
</dl>
<dl>
<dt><a href="#">post_link</a></dt>
<dd> applied to the calculated post permalink by the <tt>get_permalink</tt> function, which is also called by the <tt>the_permalink</tt>, <tt>post_permalink</tt>, <tt>previous_post_link</tt>, and <tt>next_post_link</tt> functions. Filter function arguments: permalink URL, post data list. </dd>
</dl>
<dl>
<dt><a href="#">the_permalink</a></dt>
<dd> applied to the permalink URL for a post prior to printing by function <tt>the_permalink</tt>. </dd>
</dl>
<dl>
<dt><a href="#">year_link</a></dt>
<dd> applied to the link URL for a yearly archive by the <tt>get_year_link</tt> function. Filter function arguments: URL, year. </dd>
</dl>
<dl>
<dt><a href="#">tag_link</a></dt>
<dd> applied to the URL created for a tag by the get_tag_link function. Filter function arguments: link URL, tag ID. </dd>
</dl>
<h2> <span class="mw-headline"> Date and Time Filters </span></h2>
<dl>
<dt><a href="#">get_comment_date</a></dt>
<dd> applied to the formatted comment date generated by the <tt>get_comment_date</tt> function (which is also called by <tt>comment_date</tt>). </dd>
</dl>
<dl>
<dt><a href="#">get_comment_time</a></dt>
<dd> applied to the formatted comment time in the <tt>get_comment_time</tt> function (which is also called by <tt>comment_time</tt>). </dd>
</dl>
<dl>
<dt><a href="#">get_the_modified_date</a></dt>
<dd> applied to the formatted post modification date generated by the <tt>get_the_modified_date</tt> function (which is also called by the <tt>the_modified_date</tt> function). </dd>
</dl>
<dl>
<dt><a href="#">get_the_modified_time</a></dt>
<dd> applied to the formatted post modification time generated by the <tt>get_the_modified_time</tt> and <tt>get_post_modified_time</tt> functions (which are also called by the <tt>the_modified_time</tt> function). </dd>
</dl>
<dl>
<dt><a href="#">get_the_time</a></dt>
<dd> applied to the formatted post time generated by the <tt>get_the_time</tt> and <tt>get_post_time</tt> functions (which are also called by the <tt>the_time</tt> function). </dd>
</dl>
<dl>
<dt><a href="#">the_date</a></dt>
<dd> applied to the formatted post date generated by the <tt>the_date</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">the_modified_date</a></dt>
<dd> applied to the formatted post modification date generated by the <tt>the_modified_date</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">the_modified_time</a></dt>
<dd> applied to the formatted post modification time generated by the <tt>the_modified_time</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">the_time</a></dt>
<dd> applied to the formatted post time generated by the <tt>the_time</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">the_weekday</a></dt>
<dd> applied to the post date weekday name generated by the <tt>the_weekday</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">the_weekday_date</a></dt>
<dd> applied to the post date weekday name generated by the <tt>the_weekday_date</tt> function. Function arguments are the weekday name, before text, and after text (before text and after text are added to the weekday name if the current post&#8217;s weekday is different from the previous post&#8217;s weekday). </dd>
</dl>
<h2> <span class="mw-headline"> Author and User Filters </span></h2>
<dl>
<dt><a href="#">login_redirect</a></dt>
<dd> applied to the <tt>redirect_to</tt> post/get variable during the user login process. </dd>
</dl>
<h3> <span class="mw-headline"> Database Reads </span></h3>
<dl>
<dt><a href="#">author_email</a></dt>
<dd> applied to the comment author&#8217;s email address retrieved from the database by the <tt>comment_author_email</tt> function. See also <tt>get_comment_author_email</tt>. </dd>
</dl>
<dl>
<dt><a href="#">comment_author</a></dt>
<dd> applied to the comment author&#8217;s name retrieved from the database by the <tt>comment_author</tt> function. See also <tt>get_comment_author</tt>. </dd>
<dt><a href="#">comment_author_rss</a></dt>
<dd> applied to the comment author&#8217;s name prior to including in an RSS feed. </dd>
</dl>
<dl>
<dt><a href="#">comment_email</a></dt>
<dd> applied to the comment author&#8217;s email address retrieved from the database by the <tt>comment_author_email_link</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">comment_url</a></dt>
<dd> applied to the comment author&#8217;s URL retrieved from the database by the <tt>comment_author_url</tt> function (see also <tt>get_comment_author_url</tt>). </dd>
</dl>
<dl>
<dt><a href="#">get_comment_author</a></dt>
<dd> applied to the comment author&#8217;s name retrieved from the database by <tt>get_comment_author</tt>, which is also called by <tt>comment_author</tt>. See also <tt>comment_author</tt>. </dd>
</dl>
<dl>
<dt><a href="#">get_comment_author_email</a></dt>
<dd> applied to the comment author&#8217;s email address retrieved from the database by <tt>get_comment_author_email</tt>, which is also called by <tt>comment_author_email</tt>. See also <tt>author_email</tt>. </dd>
</dl>
<dl>
<dt><a href="#">get_comment_author_IP</a></dt>
<dd> applied to the comment author&#8217;s IP address retrieved from the database by the <tt>get_comment_author_IP</tt> function, which is also called by <tt>comment_author_IP</tt>. </dd>
</dl>
<dl>
<dt><a href="#">get_comment_author_url</a></dt>
<dd> applied to the comment author&#8217;s URL retrieved from the database by the <tt>get_comment_author_url</tt> function, which is also called by <tt>comment_author_url</tt>. See also <tt>comment_url</tt>. </dd>
</dl>
<dl>
<dt><a href="#">login_errors</a></dt>
<dd> applied to the login error message printed on the login screen. </dd>
</dl>
<dl>
<dt><a href="#">login_headertitle</a></dt>
<dd> applied to the title for the login header URL (Powered by WordPress by default) printed on the login screen. </dd>
</dl>
<dl>
<dt><a href="#">login_headerurl</a></dt>
<dd> applied to the login header URL (points to wordpress.org by default) printed on the login screen. </dd>
</dl>
<dl>
<dt><a href="#">login_message</a></dt>
<dd> applied to the login message printed on the login screen. </dd>
</dl>
<dl>
<dt><a href="#">role_has_cap</a></dt>
<dd> applied to a role&#8217;s capabilities list in the <tt>WP_Role-&gt;has_cap</tt> function. Filter function arguments are the capabilities list to be filtered, the capability being questioned, and the role&#8217;s name. </dd>
</dl>
<dl>
<dt><a href="#">sanitize_user</a></dt>
<dd> applied to a user name by the <tt>sanitize_user</tt> function. Filter function arguments: user name (after some cleaning up), raw user name, strict (true or false to use strict ASCII or not). </dd>
</dl>
<dl>
<dt><a href="#">the_author</a></dt>
<dd> applied to a post author&#8217;s displayed name by the <tt>get_the_author</tt> function, which is also called by the <tt>the_author</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">the_author_email</a></dt>
<dd> applied to a post author&#8217;s email address by the <tt>the_author_email</tt> function. </dd>
</dl>
<h3> <span class="mw-headline"> Database Writes </span></h3>
<dl>
<dt><a href="#">pre_comment_author_email</a></dt>
<dd> applied to a comment author&#8217;s email address prior to saving the comment in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_comment_author_name</a></dt>
<dd> applied to a comment author&#8217;s user name prior to saving the comment in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_comment_author_url</a></dt>
<dd> applied to a comment author&#8217;s URL prior to saving the comment in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_comment_user_agent</a></dt>
<dd> applied to the comment author&#8217;s user agent prior to saving the comment in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_comment_user_ip</a></dt>
<dd> applied to the comment author&#8217;s IP address prior to saving the comment in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_user_id</a></dt>
<dd> applied to the comment author&#8217;s user ID prior to saving the comment in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_user_description</a></dt>
<dd> applied to the user&#8217;s description prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_user_display_name</a></dt>
<dd> applied to the user&#8217;s displayed name prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_user_email</a></dt>
<dd> applied to the user&#8217;s email address prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_user_first_name</a></dt>
<dd> applied to the user&#8217;s first name prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_user_last_name</a></dt>
<dd> applied to the user&#8217;s last name prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_user_login</a></dt>
<dd> applied to the user&#8217;s login name prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_user_nicename</a></dt>
<dd> applied to the user&#8217;s &#8220;nice name&#8221; prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_user_nickname</a></dt>
<dd> applied to the user&#8217;s nickname prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_user_url</a></dt>
<dd> applied to the user&#8217;s URL prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">registration_errors</a></dt>
<dd> applied to the list of registration errors generated while registering a user for a new account. </dd>
</dl>
<dl>
<dt><a href="#">user_registration_email</a></dt>
<dd> applied to the user&#8217;s email address read from the registration page, prior to trying to register the person as a new user. </dd>
</dl>
<dl>
<dt><a href="#">validate_username</a></dt>
<dd> applied to the validation result on a new user name. Filter function arguments: valid (true/false), user name being validated. </dd>
</dl>
<h2> <span class="mw-headline"> Blogroll Filters </span></h2>
<dl>
<dt><a href="#">get_bookmarks</a></dt>
<dd> applied to link/blogroll database query results by the <tt>get_bookmarks</tt> function. Filter function arguments: database query results list, <tt>get_bookmarks</tt> arguments list. </dd>
</dl>
<dl>
<dt><a href="#">link_category</a></dt>
<dd> applied to the link category by the <tt>get_links_list</tt> and <tt>wp_list_bookmarks</tt> functions (as of WordPress 2.2). </dd>
</dl>
<dl>
<dt><a href="#">link_description</a></dt>
<dd> applied to the link description by the <tt>get_links</tt> and <tt>wp_list_bookmarks</tt> functions (as of WordPress 2.2). </dd>
</dl>
<dl>
<dt><a href="#">link_rating</a></dt>
<dd> applied to the link rating number by the <tt>get_linkrating</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">link_title</a></dt>
<dd> applied to the link title by the <tt>get_links</tt> and <tt>wp_list_bookmarks</tt> functions (as of WordPress 2.2) </dd>
</dl>
<dl>
<dt><a href="#">pre_link_description</a></dt>
<dd> applied to the link description prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_link_image</a></dt>
<dd> applied to the link image prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_link_name</a></dt>
<dd> applied to the link name prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_link_notes</a></dt>
<dd> applied to the link notes prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_link_rel</a></dt>
<dd> applied to the link relation information prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_link_rss</a></dt>
<dd> applied to the link RSS URL prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_link_target</a></dt>
<dd> applied to the link target information prior to saving in the database. </dd>
</dl>
<dl>
<dt><a href="#">pre_link_url</a></dt>
<dd> applied to the link URL prior to saving in the database. </dd>
</dl>
<h2> <span class="mw-headline"> Blog Information and Option Filters </span></h2>
<dl>
<dt><a href="#">all_options</a></dt>
<dd> applied to the option list retrieved from the database by the <tt>get_alloptions</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">bloginfo</a></dt>
<dd> applied to the blog option information retrieved from the database by the <tt>bloginfo</tt> function, after first retrieving the information with the <tt>get_bloginfo</tt> function. A second argument <tt>$show</tt> gives the name of the bloginfo option that was requested. Note that <tt>bloginfo("url")</tt>, <tt>bloginfo("directory")</tt> and <tt>bloginfo("home")</tt> do <i>not</i> use this filtering function (see <tt>bloginfo_url</tt>). </dd>
</dl>
<dl>
<dt><a href="#">bloginfo_rss</a></dt>
<dd> applied to the blog option information by function <tt>get_bloginfo_rss</tt> (which is also called from <tt>bloginfo_rss</tt>), after first retrieving the information with the <tt>get_bloginfo</tt> function, stripping out HTML tags, and converting characters appropriately. A second argument <tt>$show</tt> gives the name of the bloginfo option that was requested. </dd>
</dl>
<dl>
<dt><a href="#">bloginfo_url</a></dt>
<dd> applied to the the output of <tt>bloginfo("url")</tt>, <tt>bloginfo("directory")</tt> and <tt>bloginfo("home")</tt> before returning the information. </dd>
</dl>
<dl>
<dt><a href="#">loginout</a></dt>
<dd> applied to the HTML link for logging in and out (generally placed in the sidebar) generated by the <tt>wp_loginout</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">option_(option name)</a></dt>
<dd> applied to the option value retrieved from the database by the <tt>get_option</tt> function, after unserializing (which decodes array-based options). To use this filter, you will need to add filters for specific options names, such as &#8220;option_foo&#8221; to filter the output of <tt>get_option("foo")</tt>. </dd>
</dl>
<dl>
<dt><a href="#">pre_option_(option name)</a></dt>
<dd> applied to the option value retrieved from the database by the <tt>get_alloptions</tt> function, after unserializing (which decodes array-based options). To use this filter, you will need to add filters for specific options names, such as &#8220;pre_option_foo&#8221; to filter the option &#8220;foo&#8221;. </dd>
</dl>
<dl>
<dt><a href="#">register</a></dt>
<dd> applied to the sidebar link created for the user to register (if allowed) or visit the admin panels (if already logged in) by the <tt>wp_register</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">upload_dir</a></dt>
<dd> applied to the directory to be used for uploads calculated by the <tt>wp_upload_dir</tt> function. Filter function argument is an array with components &#8220;dir&#8221; (the upload directory path), &#8220;url&#8221; (the URL of the upload directory), and &#8220;error&#8221; (which you can set to true if you want to generate an error). </dd>
</dl>
<dl>
<dt><a href="#">upload_mimes</a></dt>
<dd> allows a filter function to return a list of MIME types for uploads, if there is no MIME list input to the <tt>wp_check_filetype</tt> function. Filter function argument is an associated list of MIME types whose component names are file extensions (separated by vertical bars) and values are the corresponding MIME types. </dd>
</dl>
<h2> <span class="mw-headline"> General Text Filters </span></h2>
<dl>
<dt><a href="#">attribute_escape</a></dt>
<dd> applied to post text and other content by the <tt>attribute_escape</tt> function, which is called in many places in WordPress to change certain characters into HTML attributes before sending to the browser. </dd>
</dl>
<dl>
<dt><a href="#">js_escape</a></dt>
<dd> applied to JavaScript code before sending to the browser in the <tt>js_escape</tt> function. </dd>
</dl>
<h2> <span class="mw-headline"> Administrative Filters </span></h2>
<dl>
<dt><a href="#">autosave_interval</a></dt>
<dd> applied to the interval for auto-saving posts. </dd>
</dl>
<dl>
<dt><a href="#">cat_rows</a></dt>
<dd> applied to the category rows HTML generated for managing categories in the admin menus. </dd>
</dl>
<dl>
<dt><a href="#">comment_edit_pre</a></dt>
<dd> applied to comment content prior to display in the editing screen. </dd>
</dl>
<dl>
<dt><a href="#">comment_edit_redirect</a></dt>
<dd> applied to the redirect location after someone edits a comment in the admin menus. Filter function arguments: redirect location, comment ID. </dd>
</dl>
<dl>
<dt><a href="#">comment_moderation_subject</a></dt>
<dd> applied to the mail subject before sending email notifying the administrator of the need to moderate a new comment. Filter function arguments: mail subject, comment ID.  Note that this happens inside the default <tt>wp_notify_moderator</tt> function, which is a &#8220;pluggable&#8221; function, meaning that plugins can override it; see <a href="#">Plugin API</a>). </dd>
</dl>
<dl>
<dt><a href="#">comment_moderation_text</a></dt>
<dd> applied to the body of the mail message before sending email notifying the administrator of the need to moderate a new comment. Filter function arguments: mail body text, comment ID.  Note that this happens inside the default <tt>wp_notify_moderator</tt> function, which is a &#8220;pluggable&#8221; function, meaning that plugins can override it; see <a href="#">Plugin API</a>). </dd>
</dl>
<dl>
<dt><a href="#">comment_notification_headers</a></dt>
<dd> applied to the mail headers before sending email notifying the post author of a new comment. Filter function arguments: mail header text, comment ID.  Note that this happens inside the default <tt>wp_notify_postauthor</tt> function, which is a &#8220;pluggable&#8221; function, meaning that plugins can override it; see <a href="#">Plugin API</a>). </dd>
</dl>
<dl>
<dt><a href="#">comment_notification_subject</a></dt>
<dd> applied to the mail subject before sending email notifying the post author of a new comment. Filter function arguments: mail subject, comment ID.  Note that this happens inside the default <tt>wp_notify_postauthor</tt> function, which is a &#8220;pluggable&#8221; function, meaning that plugins can override it; see <a href="#">Plugin API</a>). </dd>
</dl>
<dl>
<dt><a href="#">comment_notification_text</a></dt>
<dd> applied to the body of the mail message before sending email notifying the post author of a new comment. Filter function arguments: mail body text, comment ID.  Note that this happens inside the default <tt>wp_notify_postauthor</tt> function, which is a &#8220;pluggable&#8221; function, meaning that plugins can override it; see <a href="#">Plugin API</a>). </dd>
</dl>
<dl>
<dt><a href="#">cron_schedules</a></dt>
<dd> applied to an empty array to allow a plugin to generate cron schedules in the <tt>wp_get_schedules</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">custom_menu_order</a></dt>
<dd> used to activate the &#8216;menu_order&#8217; filter. </dd>
</dl>
<dl>
<dt><a href="#">default_content</a></dt>
<dd> applied to the default post content prior to opening the editor for a new post. </dd>
</dl>
<dl>
<dt><a href="#">default_excerpt</a></dt>
<dd> applied to the default post excerpt prior to opening the editor for a new post. </dd>
</dl>
<dl>
<dt><a href="#">default_title</a></dt>
<dd> applied to the default post title prior to opening the editor for a new post. </dd>
</dl>
<dl>
<dt><a href="#">editable_slug</a></dt>
<dd> applied to the post, page, tag or category slug by the <tt>get_sample_permalink</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">explain_nonce_(verb)-(noun)</a></dt>
<dd> allows a filter function to define text to be used to explain a nonce that is otherwise not explained by the WordPress core code. You will need to define specific verb/noun filters to use this. For instance, if your plugin defines a nonce for updating a tag, you would define a filter for &#8220;explain_nonce_update-tag&#8221;. Filter function arguments: text to display (defaults to a generic &#8220;Are you sure you want to do this?&#8221; message) and extra information from the end of the action URL. In the example here, your function might simply return the string &#8220;Are you sure you want to update this tag?&#8221;. </dd>
</dl>
<dl>
<dt><a href="#">format_to_edit</a></dt>
<dd> applied to post content, excerpt, title, and password by the <tt>format_to_edit</tt> function, which is called by the admin menus to set up a post for editing. Also applied to when editing comments in the admin menus. </dd>
</dl>
<dl>
<dt><a href="#">format_to_post</a></dt>
<dd> applied to post content by the <tt>format_to_post</tt> function, which is not used in WordPress by default. </dd>
</dl>
<dl>
<dt><a href="#">manage_link-manager_columns</a></dt>
<dd> was <tt>manage_link_columns</tt> until wordpress 2.7. applied to the list of columns to print on the blogroll management screen. Filter function argument/return value is an associative list where the element key is the name of the column, and the value is the header text for that column. See also action <tt>manage_link_custom_column</tt>, which puts the column information into the edit screen. </dd>
</dl>
<dl>
<dt><a href="#">manage_posts_columns</a></dt>
<dd> applied to the list of columns to print on the manage posts screen. Filter function argument/return value is an associative array where the element key is the name of the column, and the value is the header text for that column. See also action <tt>manage_posts_custom_column</tt>, which puts the column information into the edit screen. (see <a href="#">Scompt&#8217;s tutorial</a> for examples and use.) </dd>
</dl>
<dl>
<dt><a href="#">manage_pages_columns</a></dt>
<dd> applied to the list of columns to print on the manage pages screen. Filter function argument/return value is an associative array where the element key is the name of the column, and the value is the header text for that column. See also action <tt>manage_pages_custom_column</tt>, which puts the column information into the edit screen. </dd>
</dl>
<dl>
<dt><a href="#">menu_order</a></dt>
<dd> applied to the array for the admin menu order. Must be activated with the &#8216;custom_menu_order&#8217; filter before. </dd>
</dl>
<dl>
<dt><a href="#">postmeta_form_limit</a></dt>
<dd> applied to the number of post-meta information items shown on the post edit screen. </dd>
</dl>
<dl>
<dt><a href="#">pre_upload_error</a></dt>
<dd> applied to allow a plugin to create an XMLRPC error for uploading files. </dd>
</dl>
<dl>
<dt><a href="#">preview_page_link</a></dt>
<dd> applied to the link on the page editing screen that shows the page preview at the bottom of the screen. </dd>
</dl>
<dl>
<dt><a href="#">preview_post_link</a></dt>
<dd> applied to the link on the post editing screen that shows the post preview at the bottom of the screen. </dd>
</dl>
<dl>
<dt><a href="#">richedit_pre</a></dt>
<dd> applied to post content by the <tt>wp_richedit_pre</tt> function, before displaying in the rich text editor. </dd>
</dl>
<dl>
<dt><a href="#">show_password_fields</a></dt>
<dd> applied to the true/false variable that controls whether the user is presented with the opportunity to change their password on the user profile screen (true means to show password changing fields; false means don&#8217;t). </dd>
</dl>
<dl>
<dt><a href="#">the_editor</a></dt>
<dd> applied to the HTML DIV created to house the rich text editor, prior to printing it on the screen. Filter function argument/return value is a string. </dd>
</dl>
<dl>
<dt><a href="#">user_can_richedit</a></dt>
<dd> applied to the calculation of whether the user&#8217;s browser has rich editing capabilities, and whether the user wants to use the rich editor, in the <tt>user_can_richedit</tt> function. Filter function argument and return value is true/false if the current user can/cannot use the rich editor. </dd>
</dl>
<dl>
<dt><a href="#">user_has_cap</a></dt>
<dd> applied to a user&#8217;s capabilities list in the <tt>WP_User-&gt;has_cap</tt> function (which is called by the <tt>current_user_can</tt> function). Filter function arguments are the capabilities list to be filtered, the capability being questioned, and the argument list (which has things such as the post ID if the capability is to edit posts, etc.) </dd>
</dl>
<dl>
<dt><a href="#">wp_handle_upload</a></dt>
<dd> applied to the upload information when uploading a file. Filter function argument: array with elements &#8220;file&#8221; (file name), &#8220;url&#8221;, &#8220;type&#8221;. </dd>
</dl>
<dl>
<dt><a href="#">wp_upload_tabs</a></dt>
<dd> applied to the list of custom tabs to display on the upload management admin screen. Use action <tt>upload_files_(tab)</tt> to display a page for your custom tab (see <a href="#">Plugin API/Action Reference</a>). </dd>
</dl>
<h2> <span class="mw-headline"> Rich Text Editor Filters </span></h2>
<dl>
<dt><a href="#">mce_spellchecker_languages</a></dt>
<dd> applied to the language selection available in the spell checker. </dd>
</dl>
<dl>
<dt><a href="#">mce_buttons, mce_buttons_2, mce_buttons_3, mce_buttons_4</a></dt>
<dd> applied to the rows of buttons for the rich editor toolbar (each is an array of button names). </dd>
</dl>
<dl>
<dt><a href="#">mce_css</a></dt>
<dd> applied to the CSS file URL for the rich text editor. </dd>
</dl>
<dl>
<dt><a href="#">mce_external_plugins</a></dt>
<dd> applied to the array of external plugins to be loaded by the rich text editor. </dd>
</dl>
<dl>
<dt><a href="#">mce_external_languages</a></dt>
<dd> applied to the array of language files loaded by external plugins, allowing them to use the standard translation method (see tinymce/langs/wp-langs.php for reference). </dd>
</dl>
<dl>
<dt><a href="#">tiny_mce_before_init</a></dt>
<dd> applied to the whole init array for the editor. </dd>
</dl>
<h2> <span class="mw-headline"> Template Filters </span></h2>
<dl>
<dt><a href="#">kubrick_header_color</a></dt>
<dd> applied to the color for the header of the default theme. </dd>
</dl>
<dl>
<dt><a href="#">kubrick_header_display</a></dt>
<dd> applied to the display option for the header of the default theme. </dd>
</dl>
<dl>
<dt><a href="#">kubrick_header_image</a></dt>
<dd> applied to the header image file for the default theme. </dd>
</dl>
<dl>
<dt><a href="#">locale_stylesheet_uri</a></dt>
<dd> applied to the locale-specific stylesheet URI returned by the <tt>get_locale_stylesheet_uri</tt> function. Filter function arguments: URI, stylesheet directory URI. </dd>
</dl>
<dl>
<dt><a href="#">stylesheet</a></dt>
<dd> applied to the stylesheet returned by the <tt>get_stylesheet</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">stylesheet_directory</a></dt>
<dd> applied to the stylesheet directory returned by the <tt>get_stylesheet_directory</tt> function. Filter function arguments: stylesheet directory, stylesheet. </dd>
</dl>
<dl>
<dt><a href="#">stylesheet_directory_uri</a></dt>
<dd> applied to the stylesheet directory URI returned by the <tt>get_stylesheet_directory_uri</tt> function. Filter function arguments: stylesheet directory URI, stylesheet. </dd>
</dl>
<dl>
<dt><a href="#">stylesheet_uri</a></dt>
<dd> applied to the stylesheet URI returned by the <tt>get_stylesheet_uri</tt> function. Filter function arguments: stylesheet URI, stylesheet. </dd>
</dl>
<dl>
<dt><a href="#">template</a></dt>
<dd> applied to the template returned by the <tt>get_template</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">template_directory</a></dt>
<dd> applied to the template directory returned by the <tt>get_template_directory</tt> function. Filter function arguments: template directory, template. </dd>
</dl>
<dl>
<dt><a href="#">template_directory_uri</a></dt>
<dd> applied to the template directory URI returned by the <tt>get_template_directory_uri</tt> function. Filter function arguments: template directory URI, template. </dd>
</dl>
<dl>
<dt><a href="#">theme_root</a></dt>
<dd> applied to the theme root directory (normally wp-content/themes) returned by the <tt>get_theme_root</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">theme_root_uri</a></dt>
<dd> applied to the theme root directory URI returned by the <tt>get_theme_root_uri</tt> function. Filter function arguments: URI, site URL.</p>
<p>You can also replace individual template files from your theme, by using the following filter hooks.  See also the <tt>template_redirect</tt> action hook. Each of these filters takes as input the path to the corresponding template file in the current theme. A plugin can modify the file to be used by returning a new path to a template file. </p>
</dd>
<dd><a href="#"> 404_template</a> </dd>
<dt><a href="#"> archive_template</a> </dt>
<dd><a href="#"> attachment_template</a> </dd>
</dl>
<dl>
<dd> </dd>
<dt><a href="#"> author_template</a></dt>
<dd> </dd>
<dt><a href="#"> category_template</a></dt>
<dd> </dd>
<dt><a href="#"> comments_popup_template</a></dt>
<dd> </dd>
<dt><a href="#"> comments_template</a></dt>
<dd> </dd>
<dt><a href="#"> date_template</a></dt>
<dd> </dd>
<dt><a href="#"> home_template</a></dt>
<dd> </dd>
<dt><a href="#"> page_template</a></dt>
<dd> </dd>
<dt><a href="#"> paged_template</a></dt>
<dd> </dd>
<dt><a href="#"> search_template</a></dt>
<dd> </dd>
<dt><a href="#"> single_template</a></dt>
<dd> </dd>
</dl>
<h2> <span class="mw-headline"> Advanced WordPress Filters </span></h2>
<dl>
<dt><a href="#">author_rewrite_rules</a></dt>
<dd> applied to the author-related rewrite rules after they are generated. </dd>
</dl>
<dl>
<dt><a href="#">category_rewrite_rules</a></dt>
<dd> applied to the category-related rewrite rules after they are generated. </dd>
</dl>
<dl>
<dt><a href="#">comments_rewrite_rules</a></dt>
<dd> applied to the comment-related rewrite rules after they are generated. </dd>
</dl>
<dl>
<dt><a href="#">create_user_query</a></dt>
<dd> applied to the query used to save a new user&#8217;s information to the database, just prior to running the query. </dd>
</dl>
<dl>
<dt><a href="#">date_rewrite_rules</a></dt>
<dd> applied to the date-related rewrite rules after they are generated. </dd>
</dl>
<dl>
<dt><a href="#">found_posts</a></dt>
<dd> applied to the list of posts, just after querying from the database. </dd>
</dl>
<dl>
<dt><a href="#">found_posts_query</a></dt>
<dd> after the list of posts to display is queried from the database, WordPress selects rows in the query results. This filter allows you to do something other than <tt>SELECT FOUND_ROWS()</tt> at that step. </dd>
</dl>
<dl>
<dt><a href="#">get_editable_authors</a></dt>
<dd> applied to the list of post authors that the current user is authorized to edit in the <tt>get_editable_authors</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">gettext</a></dt>
<dd> applied to the translated text by the <tt>__</tt> and <tt>_e</tt> internationalization functions. Filter function arguments: translated text and untranslated text. Only gets applied if internationalization is in effect, and if the text domain has been loaded. </dd>
</dl>
<dl>
<dt><a href="#">get_next_post_join</a></dt>
<dd> in function <tt>get_next_post</tt> (which finds the post after the currently-displayed post), applied to the SQL JOIN clause (which normally joins to the category table if user is viewing a category archive). Filter function arguments: JOIN clause, stay in same category (true/false), list of excluded categories. </dd>
</dl>
<dl>
<dt><a href="#">get_next_post_sort</a></dt>
<dd> in function <tt>get_next_post</tt> (which finds the post after the currently-displayed post), applied to the SQL ORDER BY clause (which normally orders by post date in ascending order with a limit of 1 post). Filter function arguments: ORDER BY clause. </dd>
</dl>
<dl>
<dt><a href="#">get_next_post_where</a></dt>
<dd> in function <tt>get_next_post</tt> (which finds the post after the currently-displayed post), applied to the SQL WHERE clause (which normally looks for the next dated published post). Filter function arguments: WHERE clause, stay in same category (true/false), list of excluded categories. </dd>
</dl>
<dl>
<dt><a href="#">get_others_drafts</a></dt>
<dd> applied to the query that selects the other users&#8217; drafts for display in the admin menus. </dd>
</dl>
<dl>
<dt><a href="#">get_previous_post_join</a></dt>
<dd> in function <tt>get_previous_post</tt> (which finds the post before the currently-displayed post), applied to the SQL JOIN clause (which normally joins to the category table if user is viewing a category archive). Filter function arguments: join clause, stay in same category (true/false), list of excluded categories. </dd>
</dl>
<dl>
<dt><a href="#">get_previous_post_sort</a></dt>
<dd> in function <tt>get_previous_post</tt> (which finds the post before the currently-displayed post), applied to the SQL ORDER BY clause (which normally orders by post date in descending order with a limit of 1 post). Filter function arguments: ORDER BY clause. </dd>
</dl>
<dl>
<dt><a href="#">get_previous_post_where</a></dt>
<dd> in function <tt>get_previous_post</tt> (which finds the post before the currently-displayed post), applied to the SQL WHERE clause (which normally looks for the previous dated published post). Filter function arguments: WHERE clause, stay in same category (true/false), list of excluded categories. </dd>
</dl>
<dl>
<dt><a href="#">get_users_drafts</a></dt>
<dd> applied to the query that selects the users&#8217; drafts for display in the admin menus. </dd>
</dl>
<dl>
<dt><a href="#">locale</a></dt>
<dd> applied to the locale by the <tt>get_locale</tt> function. </dd>
</dl>
<dl>
<dt><a href="#">mod_rewrite_rules</a></dt>
<dd> applied to the list of rewrite rules given to the user to put into their .htaccess file when they change their permalink structure. (Note: replaces deprecated filter <tt>rewrite_rules</tt>.) </dd>
</dl>
<dl>
<dt><a href="#">post_limits</a></dt>
<dd> applied to the <tt>LIMIT</tt> clause of the query that returns the post array. </dd>
</dl>
<dl>
<dt><a href="#">posts_distinct</a></dt>
<dd> allows a plugin to add a <tt>DISTINCTROW</tt> clause to the query that returns the post array. </dd>
</dl>
<dl>
<dt><a href="#">posts_fields</a></dt>
<dd> applied to the field list for the query that returns the post array. </dd>
</dl>
<dl>
<dt><a href="#">posts_groupby</a></dt>
<dd> applied to the <tt>GROUP BY</tt> clause of the query that returns the post array (normally empty). </dd>
</dl>
<dl>
<dt><a href="#">posts_join_paged</a></dt>
<dd> applied to the <tt>JOIN</tt> clause of the query that returns the post array, after the paging is calculated (though paging does not affect the JOIN, so this is actually equivalent to <tt>posts_join</tt>). </dd>
</dl>
<dl>
<dt><a href="#">posts_orderby</a></dt>
<dd> applied to the <tt>ORDER BY</tt> clause of the query that returns the post array. </dd>
</dl>
<dl>
<dt><a href="#">posts_request</a></dt>
<dd> applied to the entire SQL query that returns the post array, just prior to running the query. </dd>
</dl>
<dl>
<dt><a href="#">post_rewrite_rules</a></dt>
<dd> applied to the post-related rewrite rules after they are generated. </dd>
</dl>
<dl>
<dt><a href="#">root_rewrite_rules</a></dt>
<dd> applied to the root-level rewrite rules after they are generated. </dd>
</dl>
<dl>
<dt><a href="#">page_rewrite_rules</a></dt>
<dd> applied to the page-related rewrite rules after they are generated. </dd>
</dl>
<dl>
<dt><a href="#">posts_where_paged</a></dt>
<dd> applied to the <tt>WHERE</tt> clause of the query that returns the post array, after the paging is calculated (though paging does not affect the WHERE, so this is actually equivalent to <tt>posts_where</tt>). </dd>
</dl>
<dl>
<dt><a href="#">posts_join</a></dt>
<dd> applied to the <tt>JOIN</tt> clause of the query that returns the post array. This is typically used to add a table to the <tt>JOIN</tt>, in combination with the <tt>posts_where</tt> filter. </dd>
</dl>
<dl>
<dt><a href="#">posts_where</a></dt>
<dd> applied to the <tt>WHERE</tt> clause of the query that returns the post array. </dd>
</dl>
<dl>
<dt><a href="#">query</a></dt>
<dd> applied to all queries (at least all queries run after plugins are loaded). </dd>
</dl>
<dl>
<dt><a href="#">query_string</a></dt>
<dd> deprecated &#8211; use <tt>query_vars</tt> or <tt>request</tt> instead. </dd>
<dt><a href="#">query_vars</a></dt>
<dd> applied to the list of public WordPress query variables before the SQL query is formed. Useful for removing extra permalink information the plugin has dealt with in some other manner. </dd>
</dl>
<dl>
<dt><a href="#">request</a></dt>
<dd> like <tt>query_vars</tt>, but applied after &#8220;extra&#8221; and private query variables have been added. </dd>
</dl>
<dl>
<dt><a href="#">rewrite_rules_array</a></dt>
<dd> applied to the entire rewrite rules array after it is generated. </dd>
</dl>
<dl>
<dt><a href="#">search_rewrite_rules</a></dt>
<dd> applied to the search-related rewrite rules after they are generated. </dd>
</dl>
<dl>
<dt><a href="#">the_posts</a></dt>
<dd> applied to the list of posts queried from the database after minimal processing for permissions and draft status on single-post pages. </dd>
</dl>
<dl>
<dt><a href="#">excerpt_length</a></dt>
<dd> Defines the lenght of a single-post excerpt. </dd>
</dl>
<dl>
<dt><a href="#">excerpt_more</a></dt>
<dd> Defines the more string at the end of the excerpt. </dd>
</dl>
<dl>
<dt><a href="#">update_user_query</a></dt>
<dd> applied to the update query used to update user information, prior to running the query. </dd>
</dl>
<dl>
<dt><a href="#">wp_redirect</a></dt>
<dd> applied to a redirect URL by the default <tt>wp_redirect</tt> function. Filter function arguments: URL, HTTP status code. Note that <tt>wp_redierct</tt> is also a &#8220;pluggable&#8221; function, meaning that plugins can override it). </dd>
</dl>
<dl>
<dt><a href="#">xmlrpc_methods</a></dt>
<dd> applied to list of defined XMLRPC methods for the XMLRPC server. </dd>
</dl>
<dl>
<dt><a href="#">wp_mail_from</a></dt>
<dd> applied before any mail is sent by the wp_mail function. Supplied value is the calculated from address which is wordpress at the current hostname (set by $_SERVER['SERVER_NAME']). The filter should return an email address or name/email combo in the form &#8220;user@example.com&#8221; or &#8220;Name &lt;user@example.com&gt;&#8221; (without the quotes!). </dd>
</dl>
<dl>
<dt><a href="#">wp_mail_from_name</a></dt>
<dd> applied before any mail is sent by the wp_mail function. The filter should return a name string to be used as the email from name. </dd>
</dl>
<p><script>
jQuery().ready(function(){
jQuery('#wp-index dl').hover(function(){jQuery(this).addClass('vis');},function(){jQuery(this).removeClass('vis');});
});
</script>
</div>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=528&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/word-press-plugin-apifilter-reference/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add theme page option menu</title>
		<link>http://www.maheshchari.com/add-theme-page-option-menu/</link>
		<comments>http://www.maheshchari.com/add-theme-page-option-menu/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 14:34:36 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=517</guid>
		<description><![CDATA[Adding sub menu our word press theme to word press admin panel
We have already learned that how to add all available menu ,sub menu to word press plug in.
Now we learn how to add our themes option menu to word press admin panel.
You must aware some knowledge on developing word press theme.

Word press template tags.
word [...]]]></description>
			<content:encoded><![CDATA[<h1>Adding sub menu our word press theme to word press admin panel</h1>
<p>We have already learned that how to add all available menu ,<a href="http://www.maheshchari.com/wordpress-add-admin-menu/" target="_blank">sub menu to word press plug in</a>.<br />
Now we learn how to add our themes option menu to word press admin panel.</p>
<p>You must aware some knowledge on developing word press theme.</p>
<ul>
<li>Word press template tags.</li>
<li>word press theme file structure.</li>
<li>Little bit php concepts.</li>
</ul>
<p>From above specifications word press template comes with main file &#8220;<b>functions.php</b>&#8220;, that synchronize word press core and template.And add below code to that file.
</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'myThemeMenu'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> myThemeMenu<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">//global theme name stored in this variable</span>
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$ThemeName</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//add this menu to our theme edit page</span>
add_theme_page<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$ThemeName</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' Theme Options'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ThemeName</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' Options'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'edit_themes'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'myThemePage'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//wat ever you want to change the theme settings here.</span>
<span style="color: #666666; font-style: italic;">//this function was called when user clicks on the </span>
<span style="color: #666666; font-style: italic;">//theme edit link on appearence admin panel</span>
<span style="color: #000000; font-weight: bold;">function</span> myThemePage <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;h1&gt;My Theme Options Page ,we can add any options to change our theme settings.&lt;/h1&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Above code comments tells the concept of each line .  Now you can see the options on appearance admin panel. </p>
<p>Fore example your theme name is <b>My-theme</b>,then you see <b>My-theme options </b> link on the appearance admin panel.</p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=517&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/add-theme-page-option-menu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>first step to developing   word press plugin</title>
		<link>http://www.maheshchari.com/first-step-to-developing-word-press-plugin/</link>
		<comments>http://www.maheshchari.com/first-step-to-developing-word-press-plugin/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 19:39:40 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=501</guid>
		<description><![CDATA[Very Basic first step to write a word press plug in
To start our first plug in ,first we must have a plan what our plug in do on blog. However this topic we continue on later. To write a plug in ,we have to get idea of our plugin name that suggests to it.Here we [...]]]></description>
			<content:encoded><![CDATA[<h1>Very Basic first step to write a word press plug in</h1>
<p>To start our first plug in ,first we must have a plan what our plug in do on blog. However this topic we continue on later. To write a plug in ,we have to get idea of our plugin name that suggests to it.Here we write a plugin that filters the post or page title and content.<br />
That replaces &#8220;hello&#8221; to &#8220;hello Mahesh world&#8221;.And i named it <b>my-plugin</b></p>
<h3><a href='http://www.maheshchari.com/wp-content/uploads/2010/03/my-plugin.zip'>Download Demo</a></h3>
<p></br></p>
<h3>Manage Files</h3>
<p>create a folder called &#8220;my-plugin&#8221; in the word press plugin directory. </p>
<p>Add a file called &#8220;my-plugin.php&#8221; and code in that is just PHP tags.</br><br />
<b>Remember</b> plugin directory and plugin name should be same.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>After Adding code go to your admin panel and click the link <b>installed</b> on the <b>All</b> tab of plugins we  <b>don&#8217;t get our plug in listed there!!!</b>. </p>
<h3>Getting listed our plug in on the plug ins page</h3>
<p>Yes,absolutely we didn&#8217;t great job by adding only file . To get listed we have to add a plug in description and its name.Add below comment code to your plug in page.<a href="http://www.maheshchari.com/wp-content/uploads/2010/03/plugin-getlisted.jpg"><img src="http://www.maheshchari.com/wp-content/uploads/2010/03/plugin-getlisted.jpg" alt="" title="plugin-getlisted" width="472" height="59" class="alignleft size-full wp-image-509" /></a></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*
Plugin Name: My Plugin
Plugin URI: http://maheshchari.com/
Description: Description of my plugin
Author URI: http://maheshchari.com/
*/</span></pre></div></div>

<h3>Adding functionality to plug in</h3>
<p>Here plugin works as filtering post content and post title while it displayed. Logic is simple for that we use <b> str_replace</b> function.<br />
Word press had to action filters for displaying title,content . they are <b>the_content,the_title</b>.we add  our function to this filters by  default priority.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #666666; font-style: italic;">/*
Plugin Name: My Plugin
Plugin URI: http://maheshchari.com/
Description: Description of my plugin
Author URI: http://maheshchari.com/
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> my_plugin_filter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$text</span><span style="color: #339933;">=</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Hello'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&lt;b&gt;hello Mahesh&lt;/b&gt;'</span><span style="color: #339933;">,</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$text</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_plugin_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_title'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_plugin_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h3>Testing plug in</h3>
<p>Now we add a post that contains <b>Hello</b> word in the post title and in the content of it.<br />
It shows this word as Hello Mahesh on title and content.</p>
<h3><a href='http://www.maheshchari.com/wp-content/uploads/2010/03/my-plugin.zip'>Download Demo</a></h3>
<p>Now we successfully created our plugin and next <a href="http://www.maheshchari.com/wordpress-add-admin-menu/">adding sub menu on admin panel of word press .</a></p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=501&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/first-step-to-developing-word-press-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress add admin menu</title>
		<link>http://www.maheshchari.com/wordpress-add-admin-menu/</link>
		<comments>http://www.maheshchari.com/wordpress-add-admin-menu/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 01:19:41 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=477</guid>
		<description><![CDATA[Add  menu,sub menu,top level menu of our plug in  on admin panel of word press
Here we learn how to add the menu to word press admin side panels to control our plug ins functionality like settings ,over view etc.
Download  Demo
Word press comes with some admin menus by default ,listed below

Dash board- To [...]]]></description>
			<content:encoded><![CDATA[<h1>Add  menu,sub menu,top level menu of our plug in  on admin panel of word press</h1>
<p>Here we learn how to add the menu to word press admin side panels to control our plug ins functionality like settings ,over view etc.</p>
<h3><a href='http://www.maheshchari.com/wp-content/uploads/2010/03/maheshchari.zip'>Download  Demo</a></h3>
<p>Word press comes with some admin menus by default ,listed below</p>
<ol>
<li><strong>Dash board</strong>- To get the over view of blog on the admin home page.</li>
<li><strong>Posts</strong> &#8211;  mainain the blog posts</li>
<li><strong>Media</strong> &#8211; manage media files on blog</li>
<li><strong>Links</strong>-blogs default links</li>
<li><strong>Pages</strong>-manage blog pages</li>
<li><strong>Comments</strong>-manage blog comments</li>
<li><strong>Appearence</strong> -maintain blog themes and blog theme settings.</li>
<li><strong>Plugins </strong>- manage blog plug ins </li>
<li><strong>Users</strong>- manage blog users for admins and registered users</li>
<li><strong>Tools</strong>-manage database and files back up.</li>
<li><strong>Settings</strong> &#8211; blogs over all settings</li>
</ol>
<p><strong>To continue this tutorial we must aware about </strong></p>
<ol>
<li> word press hooks ,filters and their functions.</li>
<li> PHP OOP&#8217;s concepts </li>
</ol>
<p>Okay, no problem even you don&#8217;t know much about word press hooks,we can manage with a main action hook for this tutorial.</p>
<p><b>admin_menu</b> action</p>
<p>This action was triggered before admin menu begins and here we can add our menus .</p>
<h3>Let start over view of the our plugin</h3>
<p>We define the class for our plugin and instantiate  it.<br />
In the constructor our class   we attach the <b>admin_menu</b> hook as below,that runs our class method <b>my_admin_menu</b></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_admin_menu'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Add our own panel with add_menu_page</h3>
<p><a href="http://www.maheshchari.com/wp-content/uploads/2010/03/wordpress-add-custom-adminmenu.jpg"><img src="http://www.maheshchari.com/wp-content/uploads/2010/03/wordpress-add-custom-adminmenu.jpg" alt="" title="wordpress-add-custom-adminmenu" width="164" height="108" class="alignleft size-full wp-image-488" /></a><br />
add_menu_page(&#8216;Panel Title&#8217;, &#8216;Panel first sub link title &#8216;, &#8216;level of handler &#8216;,&#8217;unique identifier for page&#8217;,'function that to be called&#8217;));</br><br />
In the above line <b>add_menu_page</b> adds the main panel on the word press admin page.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_menu_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mahesh Chari'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh Chari'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span> 
<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'overview'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Adding our sub links to own panel</h3>
<p>Now we add sub links above panel titled settings, general with unique identifiers.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_submenu_page<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Settings'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Settings'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'settings'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_submenu_page<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'General'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'General'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span> 
<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'generel'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Now we add our plug ins link to existing word press panels mentioned above</h3>
<p>Word press has already pre built functions to add respective panels. </p>
<h3>Add sub menu link to existing  posts panel</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_posts_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mahesh posts'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_posts'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Add sub menu link to existing Media panel</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_media_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mahesh media'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_media'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Add sub menu link to existing pages panel</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_pages_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mahesh pages'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_pages'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Add sub menu link to existing appearance panel</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> add_theme_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'maheshchari'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_themes'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Add sub menu link to existing users panel</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_users_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mahesh users'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_users'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Add sub menu link to existing tools panel</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_management_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'maheshchari'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span>
<span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_tools'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Add sub menu link to existing options panel</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_options_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mahesh Options'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_options'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Together all the sub menus </h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Plugin Name: Mahesh Chari
Plugin URI: http://www.maheshchari.com/
Description: Description of my plugin
Author URI: http://www.maheshchari.com/
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> Maheshchari
<span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> Maheshchari<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_admin_menu'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> my_admin_menu<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>	<span style="color: #666666; font-style: italic;">//create a main admin panel</span>
		<span style="color: #666666; font-style: italic;">//create a sub admin panel link above</span>
        add_menu_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mahesh Chari'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh Chari'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'overview'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        add_submenu_page<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Settings'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Settingss'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'settings'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        add_submenu_page<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Generel'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Generel'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'generel'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//These functions adds sub menu for different kinds of admin panel on back end</span>
        add_options_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mahesh Options'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_options'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        add_posts_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mahesh posts'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_posts'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        add_media_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mahesh media'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_media'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        add_pages_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mahesh pages'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_pages'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        add_users_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mahesh users'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_users'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        add_management_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'maheshchari'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_tools'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        add_theme_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'maheshchari'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mahesh  Plugin'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__file__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_plugin_themes'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> overview<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;h2&gt;My Wordpress Plugin Overview&lt;/h2&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> settings<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;h2&gt;My Wordpress Plugin Settings&lt;/h2&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> generel<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;h2&gt;My Wordpress Plugin Generel&lt;/h2&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">function</span> my_plugin_options<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;h2&gt;My Wordpress Plugin Options&lt;/h2&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">function</span> my_plugin_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;h2&gt;My Wordpress Plugin posts&lt;/h2&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">function</span> my_plugin_media<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;h2&gt;My Wordpress Plugin media&lt;/h2&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">function</span> my_plugin_pages<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;h2&gt;My Wordpress Plugin pages&lt;/h2&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">function</span> my_plugin_users<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;h2&gt;My Wordpress Plugin users&lt;/h2&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> my_plugin_tools<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;h2&gt;My Wordpress Plugin tools&lt;/h2&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> my_plugin_themes<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;h2&gt;My Wordpress Plugin themes&lt;/h2&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #000088;">$mybackuper</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">&amp;new</span> Maheshchari<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//instance of the plugin class</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>To see the above code inaction,please download the zip of demo plug in and copy to your word press plug ins directory and activate the plugin ,then you see all the sub menus in admin panels menu</p>
<h3><a href='http://www.maheshchari.com/wp-content/uploads/2010/03/maheshchari.zip'>Download the Demo</a></h3>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=477&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/wordpress-add-admin-menu/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>wordpress custom contact form template</title>
		<link>http://www.maheshchari.com/wordpress-custom-contact-form-template/</link>
		<comments>http://www.maheshchari.com/wordpress-custom-contact-form-template/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 02:03:05 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=314</guid>
		<description><![CDATA[How to make contact us  form page for wordpress default theme  . 
We know that word press is popular open source blog.it has thousands of plugins to enhance it&#8217;s features.we can extend it to complicated CMS.here we learn how to make a simple contact form,that needs a every web site.please refere my previous [...]]]></description>
			<content:encoded><![CDATA[<h1>How to make contact us  form page for wordpress default theme  . </h1>
<p>We know that word press is popular open source blog.it has thousands of plugins to enhance it&#8217;s features.we can extend it to complicated CMS.here we learn how to make a simple contact form,that needs a every web site.please refere my previous article &quot;<a href="http://www.maheshchari.com/wordpress-custom-page-template/" target="_blank">how to make a custom page template</a>&quot; before moving . word press comes with two default thems classic,default. here we customize the default theme. </p>
<p>go to wp-content/themes/default directory and make a php file name contact_form.php.</p>
<p>open contact_form.php and single.php in the default template directory with your favorite editor.</p>
<p>copy the every code in single.php to contact_form.php.</p>
<p>delete every thing in the between &lt;div id=&quot;content&quot; class=&quot;widecolumn&quot;&gt; and &lt;/div&gt;. </p>
<p>replace that with our generel contact form. </p>
<p>then click add new link in main page side navigation.make title as contact form .</p>
<p>then select a contact_form template attribute of the page on right .</p>
<p>publish this page you have done.  </p>
<p>you can <strong><a href='http://www.maheshchari.com/wp-content/uploads/2009/07/contact_form.zip'>download</a></strong> the template file and test yourself.</p>
<h3>Template Code</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Template Name: contact_form
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;div id=&quot;content&quot; class=&quot;narrowcolumn&quot;&gt; 
&lt;!-- replaced contact start here --&gt;
&lt;span class=&quot;breadcrumbs&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/&quot;&gt;Home&lt;/a&gt; &lt;/span&gt;
  &lt;h2 class=&quot;title&quot;&gt;Contact Us&lt;/h2&gt;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Submit'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//check if user submitted the contact form</span>
<span style="color: #000088;">$error</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'contact_name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #000088;">$error</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;Name required.&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'contact_email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #000088;">$error</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;Email required.&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'contact_phone'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #000088;">$error</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;Phone  required.&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'contact_comment'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #000088;">$error</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;Comment required.&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$error</span><span style="color: #339933;">!=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">//if any errors skip mailing and display the errors for users.</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;span style='color:red'&gt;<span style="color: #006699; font-weight: bold;">$error</span>&lt;/span&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// get admin email from wordpress default options</span>
	<span style="color: #000088;">$to</span><span style="color: #339933;">=</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_email'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$subject</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;One contact enquire at noblefligh re: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'contact_reason'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$body</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span> Hi Admin&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$body</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span> You had an enquiry:&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$body</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span> Regarding:<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'contact_reason'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$body</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span> Name: <span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'contact_name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$body</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span> Email: <span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'contact_email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$body</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span> Phone:<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'contact_phone'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$body</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span> Comment: <span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span> &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'contact_comment'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">// wordpress default handy mail function</span>
	wp_mail<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;span style='color:green;'&gt;your comment sent to admin successfully&lt;/span&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">// display success message.</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;form id=&quot;contact_form&quot; name=&quot;contact_form&quot; method=&quot;post&quot; action=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
    &lt;table border=&quot;0&quot;&gt;
      &lt;tr&gt;
        &lt;td&gt;About &lt;/td&gt;
        &lt;td&gt;&lt;select name=&quot;contact_reason&quot; id=&quot;contact_reason&quot; style=&quot;width:145px;&quot;&gt;
            &lt;option value=&quot;Product&quot;&gt;Product&lt;/option&gt;
            &lt;option value=&quot;Service&quot;&gt;Service&lt;/option&gt;
            &lt;option value=&quot;Other&quot;&gt;Other&lt;/option&gt;
          &lt;/select&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Name&lt;/td&gt;
        &lt;td&gt;&lt;input name=&quot;contact_name&quot; type=&quot;text&quot; id=&quot;contact_name&quot; style=&quot;width:145px&quot; /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Email&lt;/td&gt;
        &lt;td&gt;&lt;input name=&quot;contact_email&quot; type=&quot;text&quot; id=&quot;contact_email&quot; style=&quot;width:145px&quot; /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Phone&lt;/td&gt;
        &lt;td&gt;&lt;input name=&quot;contact_phone&quot; type=&quot;text&quot; id=&quot;contact_phone&quot; style=&quot;width:145px&quot; /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Comment&lt;/td&gt;
        &lt;td&gt;&lt;textarea name=&quot;contact_comment&quot; id=&quot;contact_comment&quot; style=&quot;width:300px&quot;&gt;&lt;/textarea&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td colspan=&quot;2&quot; align=&quot;center&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot; /&gt;
          &lt;input type=&quot;reset&quot; name=&quot;Submit2&quot; value=&quot;Reset&quot; /&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/form&gt;
&lt;!-- replaced content end here --&gt;
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_sidebar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>&nbsp; </p>
<p>&nbsp; </p>
<h3>Preview</h3>
<p><a href="http://www.maheshchari.com/wp-content/uploads/2009/07/wordpress-contactform.jpg"><img src="http://www.maheshchari.com/wp-content/uploads/2009/07/wordpress-contactform-300x218.jpg" alt="wordpress-contactform" title="wordpress-contactform" width="300" height="218" class="alignnone size-medium wp-image-318" /></a></p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=314&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/wordpress-custom-contact-form-template/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>wordpress custom page template</title>
		<link>http://www.maheshchari.com/wordpress-custom-page-template/</link>
		<comments>http://www.maheshchari.com/wordpress-custom-page-template/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 04:25:55 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=289</guid>
		<description><![CDATA[How to add custom template to wordpress page or post
It is need to some pages of wordpress should be different for different pages or categories as per client requirements.but wordpress theme looks common for all pages and all posts. here we find simple steps to customize the wordpress theme templates.
just make custom template with your [...]]]></description>
			<content:encoded><![CDATA[<h1>How to add custom template to wordpress page or post</h1>
<p>It is need to some pages of wordpress should be different for different pages or categories as per client requirements.but wordpress theme looks common for all pages and all posts. here we find simple steps to customize the wordpress theme templates.<br />
just make custom template with your requirement.<br />
add below code to start of the file.<br />
upload it to wp_content/thems/your active theme folder via any FTP program.<br />
go to admin panel of your wordpress and click add new link on pages  left navigation.<br />
then you can see  a select box of templates on below attributes section on right side.<br />
select custompagetemplate from template.<br />
publish the page.<br />
you can see a button view page.click it.<br />
its done.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Template Name: custompagetemplate
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Simple Code</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Template Name: custompagetemplate
*/</span>
<span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;</span>This is your customized template <span style="color: #339933;">.&lt;/</span>h1<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Download Example Template </h3>
<p><a href='http://www.maheshchari.com/wp-content/uploads/2009/07/custometemplate.zip'>custometemplate</a></p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=289&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/wordpress-custom-page-template/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>break long post wordpress</title>
		<link>http://www.maheshchari.com/break-long-post-wordpress/</link>
		<comments>http://www.maheshchari.com/break-long-post-wordpress/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 00:05:00 +0000</pubDate>
		<dc:creator>mahesh chari</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.maheshchari.com/?p=259</guid>
		<description><![CDATA[How to Break A post or page on wordpress 
Actually i have this problem while posting articles in this blog. so i googled the codex of wordpress and  discovered solution.
just simple,while posting just decide where you want break the post or page, place a comment like below,its over worderess symptomatically splits into pages.
Code

&#60;!–nextpage–&#62;

Output
Page 1,2,3..
]]></description>
			<content:encoded><![CDATA[<h1>How to Break A post or page on wordpress </h1>
<p>Actually i have this problem while posting articles in this blog. so i googled the codex of wordpress and  discovered solution.<br />
just simple,while posting just decide where you want break the post or page, place a comment like below,its over worderess symptomatically splits into pages.</p>
<h3>Code</h3>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;!–nextpage–&gt;</pre></div></div>

<h3>Output</h3>
<p><strong>Page 1,2,3..</strong></p>
<img src="http://www.maheshchari.com/?ak_action=api_record_view&id=259&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.maheshchari.com/break-long-post-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
