<?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>Tareq's Planet &#187; WordPress</title>
	<atom:link href="http://tareq.wedevs.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://tareq.wedevs.com</link>
	<description></description>
	<lastBuildDate>Sat, 14 Jan 2012 16:38:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Simple pagination system in your WordPress plugins</title>
		<link>http://tareq.wedevs.com/2011/07/simple-pagination-system-in-your-wordpress-plugins/</link>
		<comments>http://tareq.wedevs.com/2011/07/simple-pagination-system-in-your-wordpress-plugins/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 09:38:19 +0000</pubDate>
		<dc:creator>Tareq</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://tareq.wedevs.com/?p=1315</guid>
		<description><![CDATA[May be you are developing a plugin or a theme and it has something to do with handing some pagination of your custom tables data. Here&#8217;s how we can simply manage it, I am not going to build all the admin panel stuffs, but just showing you the process. Step 1: Lets get the page [...]]]></description>
			<content:encoded><![CDATA[<p>May be you are developing a plugin or a theme and it has something to do with handing some pagination of your custom tables data. Here&#8217;s how we can simply manage it, I am not going to build all the admin panel stuffs, but just showing you the process.</p>
<h3>Step 1:</h3>
<p>Lets get the page number from the url query string. If we don&#8217;t find anything, we&#8217;ll set the page number to 1.</p>
<pre class="brush: php; title: ; notranslate">
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1;
</pre>
<h3>Step 2:</h3>
<p>Now we need to set <code>per page entry limit</code> and the <code>page offset</code>. We will use the limit and offset to get data from our MySQL query. If you are confused about the offset, may be you&#8217;ve seen it on PHPMyAdmin like this: <code>"SELECT * FROM `table_name` LIMIT 0, 10"</code>. Here, we are getting the first 10 entries from our database. If we want get the next 10 entries, our limit will be <code>"LIMIT 10, 10"</code>. So the first digit for the limit is the offset. It tells us from where we&#8217;ll get our next entries.</p>
<pre class="brush: php; title: ; notranslate">
$limit = 10;
$offset = ( $pagenum - 1 ) * $limit;
</pre>
<p>So, by this two lines we are setting the limit and our offset dynamically.<span id="more-1315"></span></p>
<h3>Step 3:</h3>
<p>Now we need to get the entries from our database table with the help of our limit and offset variable and need to show them as you like, may be in a table.</p>
<pre class="brush: php; title: ; notranslate">
$entries = $wpdb-&gt;get_results( &quot;SELECT * FROM {$wpdb-&gt;prefix}table_name LIMIT $offset, $limit&quot; );
</pre>
<p>So, now if you change the url &#8220;pagenum&#8221; paramater from your browser, you can see that we are getting the entries by our page number. So it&#8217;s like we have completed our pagination system <img src='http://tareq.wedevs.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley colorbox-1315' /> </p>
<h3>Step 4:</h3>
<p>As we have completed the pagination system working, we just need to show the pagination links now and we&#8217;ll be done. WordPress gives us a nice function <code>"paginate_links"</code> to generate a cool pagination navigation link.<br />
At first, we need to get the count of <code>total number</code> of entries in our table and calculate how many pages will need to show the whole entries.</p>
<pre class="brush: php; title: ; notranslate">
$total = $wpdb-&gt;get_var( &quot;SELECT COUNT(`id`) FROM {$wpdb-&gt;prefix}table_name&quot; );
$num_of_pages = ceil( $total / $limit );
</pre>
<p>Now, we can use that nifty function <a href="http://codex.wordpress.org/Function_Reference/paginate_links" target="_blank">paginate_links</a> to generate our pagination links.</p>
<pre class="brush: php; title: ; notranslate">
$page_links = paginate_links( array(
	'base' =&gt; add_query_arg( 'pagenum', '%#%' ),
	'format' =&gt; '',
	'prev_text' =&gt; __( '&amp;laquo;', 'aag' ),
	'next_text' =&gt; __( '&amp;raquo;', 'aag' ),
	'total' =&gt; $total,
	'current' =&gt; $pagenum
) );

if ( $page_links ) {
	echo '&lt;div class=&quot;tablenav&quot;&gt;&lt;div class=&quot;tablenav-pages&quot; style=&quot;margin: 1em 0&quot;&gt;' . $page_links . '&lt;/div&gt;&lt;/div&gt;';
}
</pre>
<p>So, we are passing our <code>current page number</code> and <code>total number of pages</code> to that function and we are getting a nice and cool pagination system.</p>
<p>Here&#8217;s a sample code for generating a table with data from your posts table.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
global $wpdb;

$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1;
$limit = 5;
$offset = ( $pagenum - 1 ) * $limit;
$entries = $wpdb-&gt;get_results( &quot;SELECT * FROM {$wpdb-&gt;prefix}posts LIMIT $offset, $limit&quot; );

echo '&lt;div class=&quot;wrap&quot;&gt;';

?&gt;
&lt;table class=&quot;widefat&quot;&gt;
	&lt;thead&gt;
		&lt;tr&gt;
			&lt;th scope=&quot;col&quot; class=&quot;manage-column column-name&quot; style=&quot;&quot;&gt;Post Title&lt;/th&gt;
			&lt;th scope=&quot;col&quot; class=&quot;manage-column column-name&quot; style=&quot;&quot;&gt;Date&lt;/th&gt;
		&lt;/tr&gt;
	&lt;/thead&gt;

	&lt;tfoot&gt;
		&lt;tr&gt;
			&lt;th scope=&quot;col&quot; class=&quot;manage-column column-name&quot; style=&quot;&quot;&gt;Post Title&lt;/th&gt;
			&lt;th scope=&quot;col&quot; class=&quot;manage-column column-name&quot; style=&quot;&quot;&gt;Date&lt;/th&gt;
		&lt;/tr&gt;
	&lt;/tfoot&gt;

	&lt;tbody&gt;
		&lt;?php if( $entries ) { ?&gt;

			&lt;?php
			$count = 1;
			$class = '';
			foreach( $entries as $entry ) {
				$class = ( $count % 2 == 0 ) ? ' class=&quot;alternate&quot;' : '';
			?&gt;

			&lt;tr&lt;?php echo $class; ?&gt;&gt;
				&lt;td&gt;&lt;?php echo $entry-&gt;post_title; ?&gt;&lt;/td&gt;
				&lt;td&gt;&lt;?php echo $entry-&gt;post_date; ?&gt;&lt;/td&gt;
			&lt;/tr&gt;

			&lt;?php
				$count++;
			}
			?&gt;

		&lt;?php } else { ?&gt;
		&lt;tr&gt;
			&lt;td colspan=&quot;2&quot;&gt;No posts yet&lt;/td&gt;
		&lt;/tr&gt;
		&lt;?php } ?&gt;
	&lt;/tbody&gt;
&lt;/table&gt;

&lt;?

$total = $wpdb-&gt;get_var( &quot;SELECT COUNT(`id`) FROM {$wpdb-&gt;prefix}posts&quot; );
$num_of_pages = ceil( $total / $limit );
$page_links = paginate_links( array(
	'base' =&gt; add_query_arg( 'pagenum', '%#%' ),
	'format' =&gt; '',
	'prev_text' =&gt; __( '&amp;laquo;', 'aag' ),
	'next_text' =&gt; __( '&amp;raquo;', 'aag' ),
	'total' =&gt; $num_of_pages,
	'current' =&gt; $pagenum
) );

if ( $page_links ) {
	echo '&lt;div class=&quot;tablenav&quot;&gt;&lt;div class=&quot;tablenav-pages&quot; style=&quot;margin: 1em 0&quot;&gt;' . $page_links . '&lt;/div&gt;&lt;/div&gt;';
}

echo '&lt;/div&gt;';
</pre>
<h3>Output:</h3>
<p><a href="http://tareq.wedevs.com/wp-content/uploads/2011/07/wp_plugin_pagination.png"><img class="size-medium wp-image-1316 aligncenter colorbox-1315" title="Pagination in WordPress plugins" src="http://tareq.wedevs.com/wp-content/uploads/2011/07/wp_plugin_pagination-300x158.png" alt="Pagination in WordPress plugins" width="300" height="158" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://tareq.wedevs.com/2011/07/simple-pagination-system-in-your-wordpress-plugins/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Add your custom columns to WordPress admin panel tables</title>
		<link>http://tareq.wedevs.com/2011/07/add-your-custom-columns-to-wordpress-admin-panel-tables/</link>
		<comments>http://tareq.wedevs.com/2011/07/add-your-custom-columns-to-wordpress-admin-panel-tables/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 21:04:23 +0000</pubDate>
		<dc:creator>Tareq</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://tareq.wedevs.com/?p=1310</guid>
		<description><![CDATA[What? What did you said on the title? Well, I am not sure this is an appropriate title. But I am going to explain it to you. Lets say, you are making a theme or a WordPress plugin and you want to show something in the admin panel like this: We will see how can [...]]]></description>
			<content:encoded><![CDATA[<p>What? What did you said on the title? Well, I am not sure this is an appropriate title. But I am going to explain it to you.</p>
<p>Lets say, you are making a theme or a WordPress plugin and you want to show something in the admin panel like this:<a href="http://tareq.wedevs.com/wp-content/uploads/2011/07/post_custom_column_1.png"><img class="size-medium wp-image-1311 aligncenter colorbox-1310" title="post_custom_column_1" src="http://tareq.wedevs.com/wp-content/uploads/2011/07/post_custom_column_1-300x95.png" alt="Custom Post Column" width="300" height="95" /></a></p>
<p>We will see how can you add those columns to the admin panel tables and manipulate data on the table rows. Well, this is very easy to do, because WP has a really nice API to work with.</p>
<p>Now we will add those two columns to our admin panel&#8217;s post listing table. Here is the code:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
function test_modify_post_table( $column ) {
    $column['test_budget'] = 'Budget';
    $column['test_expires'] = 'Expires';

    return $column;
}
add_filter( 'manage_posts_columns', 'test_modify_post_table' );
</pre>
<p><span id="more-1310"></span>We are adding a filter on <code>"manage_posts_columns"</code>. It passes the column names of the post table as an array. We simple add our custom columns with a <code>key-value pair</code> in that array and return it. If you run this code, you can see how easy that was.</p>
<p>Now we have the columns, we need to fill those columns with actual data. We&#8217;ll use post custom fields to fill those space. Lets look at the code:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
function test_modify_post_table_row( $column_name, $post_id ) {

    $custom_fields = get_post_custom( $post_id );

    switch ($column_name) {
        case 'test_budget' :
			echo $custom_fields['cf_budget'][0] . ' USD';
            break;

        case 'test_expires' :
			echo $custom_fields['cf_expires'][0] . ' days';
            break;

        default:
    }
}

add_filter( 'manage_posts_custom_column', 'test_modify_post_table_row', 10, 2 );
</pre>
<p>We are adding another filter at <code>"manage_posts_custom_column"</code> with having two arguments. One is the column name and another is the post id. Then we are grabbing all the custom fields of the post and showing them according to the column name. The code is self explanatory. These columns will be visible to all of your <code>"Post Type"</code> listings.</p>
<h3>For Custom Post Type:</h3>
<p>If you have another <code>"Custom Post Type"</code>, lets say <code>"Tutorials"</code>, those columns will also be shown there. So, if you want to add those columns only to the Post&#8217;s table, not in other custom post types, you should add a checking option there. And if you only want to show those columns to a specific Custom Post Type, there is another hack. You need to change the first filter to something like this <code>"manage_edit-POST_TYPE_columns"</code>. Replace the <code>"POST_TYPE"</code> with your custom post type. e.g: &#8220;manage_edit-portfolio_columns&#8221; for &#8220;portfolio&#8221; type posts.</p>
<h3>For Pages:</h3>
<p>For pages, those filter will be <code>"manage_pages_columns"</code> and &#8220;<code>manage_pages_custom_column</code>&#8220;. Simple enough.</p>
<h3>User List table?</h3>
<p>What if you want to change the user list table? It&#8217;s the same process as previous. We can add our custom columns like we did before. But the first filter name will be changed to <code>codemanage_users_columnscode</code>. Here there is a slight change in the second filter. We passed two parameter for the posts, but here we will pass <code>THREE</code> paramater. Here is the sample code to add a column <code>"URL"</code> to show their website addresses:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
function test_modify_user_table( $column ) {
    $column['url'] = 'URL';

    return $column;
}

add_filter( 'manage_users_columns', 'test_modify_user_table' );

function test_modify_user_table_row( $val, $column_name, $user_id ) {
    $user = get_userdata( $user_id );

    switch ($column_name) {
        case 'url' :
            return $user-&gt;user_url;
            break;

        default:
    }

    return $return;
}

add_filter( 'manage_users_custom_column', 'test_modify_user_table_row', 10, 3 );
</pre>
<p><a href="http://tareq.wedevs.com/wp-content/uploads/2011/07/user_custom_column.png"><img class="size-medium wp-image-1312 aligncenter colorbox-1310" title="user_custom_column" src="http://tareq.wedevs.com/wp-content/uploads/2011/07/user_custom_column-300x140.png" alt="user custom column" width="300" height="140" /></a></p>
<p>Hope you enjoyed <img src='http://tareq.wedevs.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley colorbox-1310' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://tareq.wedevs.com/2011/07/add-your-custom-columns-to-wordpress-admin-panel-tables/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>New plugin: WordPress User Frontend</title>
		<link>http://tareq.wedevs.com/2011/01/new-plugin-wordpress-user-frontend/</link>
		<comments>http://tareq.wedevs.com/2011/01/new-plugin-wordpress-user-frontend/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 17:16:28 +0000</pubDate>
		<dc:creator>Tareq</dc:creator>
				<category><![CDATA[My Works]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[edit profile]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[posts]]></category>
		<category><![CDATA[profile]]></category>
		<category><![CDATA[restrict]]></category>

		<guid isPermaLink="false">http://tareq.wedevs.com/?p=1281</guid>
		<description><![CDATA[Today I am coming with a new wordpress plugin, named &#8220;WordPress User Frontend&#8220;. Some of us want something like that the subscriber/contributor will not be able to go in the wordpress backend and everything these user can control will be done from wordpress frontend. Features: So here is my plugin that solves your problem. This [...]]]></description>
			<content:encoded><![CDATA[<p>Today I am coming with a new wordpress plugin, named &#8220;<strong>WordPress User Frontend</strong>&#8220;. Some of us want something like that the subscriber/contributor will not be able to go in the wordpress backend and everything these user can control will be done from wordpress frontend.</p>
<h3>Features:</h3>
<p>So here is my plugin that solves your problem. This features of this plugin in it&#8217;s <strong>version 0.2</strong> are follows:</p>
<ul>
<li>User can create a new post and edit from frontend</li>
<li>They can view their page in the custom dashboard</li>
<li>Users can edit their profile</li>
<li>Administrator can restrict any user level to access the wordpress backend (/wp-admin)</li>
<li>New posts status, submitted by users are configurable via admin panel. i.e. Published, Draft, Pending</li>
<li>Admin can configure to receive notification mail when the users creates a new post.</li>
<li>Configurable options if the user can edit or delete their posts.</li>
<li>Users can upload attachments from the frontend</li>
<li>Admins can manage their users from frontend</li>
<li>Pay per post or subscription on posting is possible</li>
</ul>
<p><span id="more-1281"></span></p>
<h3>Usage:</h3>
<ul>
<li>Create a new Page &#8220;New Post&#8221; and insert shorcode <strong>[wpuf_addpost] </strong>or for custom post type<strong> [wpuf_addpost post_type="event"]<br />
</strong></li>
<li>Create a new Page &#8220;Edit&#8221; for editing posts and insert shorcode <strong>[wpuf_edit]</strong></li>
<li>Create a new Page &#8220;Profile&#8221; for editing profile and insert shorcode <strong>[wpuf_editprofile]</strong></li>
<li>Create a new Page &#8220;Dashboard&#8221; and insert shorcode <strong>[wpuf_dashboard] </strong>or for custom post types<strong> [wpuf_dashboard post_type="event"]<br />
</strong></li>
<li>Correct the permalink structure of your wordpress installation</li>
<li>To show the subscription info, insert the shortcdoe `[wpuf_sub_info]`</li>
<li>To show the subscription packs, insert the shortcode `[wpuf_sub_pack]`</li>
<li>For subscription payment page, create a new page and insert the page ID in WP User frontend&#8217;s &#8220;Paypal Payment Page&#8221; option.</li>
<li>Done <img src='http://tareq.wedevs.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley colorbox-1281' /> </li>
</ul>
<h3>Download:</h3>
<div class="download"><strong>Download:</strong> <a title="Download the plugin from wordpress plugin repository" href="http://wordpress.org/extend/plugins/wp-user-frontend/" target="_blank">WP User Frontend</a></div>
<h3>Update:</h3>
<p>Version 0.2 released. (13 Jan, 2012)</p>
<h3>Changelog:</h3>
<p>Version &#8211; 0.2:</p>
<ol>
<li>Admin settings page has been improved</li>
<li>Header already sent warning messages has been fixed</li>
<li>Now you can add custom post meta from the settings page</li>
<li>A new pay per post and subscription based posting options has been introduced (Only paypal is supported now)</li>
<li>You can upload attachment with post</li>
<li>WYSIWYG editor has been added</li>
<li>You can add and manage your users from frontend now (only having the capability to edit_users )</li>
<li>Some action and filters has been added for developers to add their custom form elements and validation</li>
<li>Pagination added in post dashboard</li>
<li>You can use the form to accept &#8220;custom post type&#8221; posts. e.g: [wpuf_addpost post_type="event"]. It also applies for showing post on dashboard like &#8220;[wpuf_dashboard post_type="event"]&#8220;</li>
<li>Changing the form labels of the add post form is now possible from admin panel.</li>
<li>The edit post page setting is changed from URL to page select dropdown.</li>
<li>You can lock certain users from posting from their edit profile page.</li>
</ol>
<h3>Screenshot:</h3>
<div id="attachment_1282" class="wp-caption aligncenter" style="width: 310px"><a href="http://tareq.wedevs.com/wp-content/uploads/2011/01/wp-user-frontend-admin-options.png"><img class="size-medium wp-image-1282 colorbox-1281" title="wp-user-frontend-admin-options" src="http://tareq.wedevs.com/wp-content/uploads/2011/01/wp-user-frontend-admin-options-300x130.png" alt="wp-user-frontend-admin-options" width="300" height="130" /></a><p class="wp-caption-text">Admin Options</p></div>
<div id="attachment_1285" class="wp-caption aligncenter" style="width: 310px"><a href="http://tareq.wedevs.com/wp-content/uploads/2011/01/wp-user-frontend-edit-profile.png"><img class="size-medium wp-image-1285 colorbox-1281" title="wp-user-frontend-edit-profile" src="http://tareq.wedevs.com/wp-content/uploads/2011/01/wp-user-frontend-edit-profile-300x296.png" alt="wp-user-frontend-edit-profile" width="300" height="296" /></a><p class="wp-caption-text">Edit Profile</p></div>
<div id="attachment_1283" class="wp-caption aligncenter" style="width: 310px"><a href="http://tareq.wedevs.com/wp-content/uploads/2011/01/wp-user-frontend-dashboard.png"><img class="size-medium wp-image-1283 colorbox-1281" title="wp-user-frontend-dashboard" src="http://tareq.wedevs.com/wp-content/uploads/2011/01/wp-user-frontend-dashboard-300x98.png" alt="wp-user-frontend-dashboard" width="300" height="98" /></a><p class="wp-caption-text">Dashboard</p></div>
<div id="attachment_1284" class="wp-caption aligncenter" style="width: 310px"><a href="http://tareq.wedevs.com/wp-content/uploads/2011/01/wp-user-frontend-edit-posts.png"><img class="size-medium wp-image-1284 colorbox-1281" title="wp-user-frontend-edit-posts" src="http://tareq.wedevs.com/wp-content/uploads/2011/01/wp-user-frontend-edit-posts-300x216.png" alt="wp-user-frontend-edit-posts" width="300" height="216" /></a><p class="wp-caption-text">Edit Posts</p></div>
<h3>Project is now in Github</h3>
<p>The WP User Frontend plugin is now hosted in <a title="View the github repository" href="https://github.com/tareq1988/WP-User-Frontend" target="_blank">Github repositor</a>y. You can always find the newest fix and updates from the Github page. You can also contribute to this project if have some cool idea and will be very helpful for me too.</p>
]]></content:encoded>
			<wfw:commentRss>http://tareq.wedevs.com/2011/01/new-plugin-wordpress-user-frontend/feed/</wfw:commentRss>
		<slash:comments>264</slash:comments>
		</item>
		<item>
		<title>Translate or convert wordpress date/time/comment number to Bangla digit</title>
		<link>http://tareq.wedevs.com/2010/09/translate-wordpress-date-time-comment-number-to-bangla-digit/</link>
		<comments>http://tareq.wedevs.com/2010/09/translate-wordpress-date-time-comment-number-to-bangla-digit/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 20:28:51 +0000</pubDate>
		<dc:creator>Tareq</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[digit]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[translate]]></category>
		<category><![CDATA[তারিখ]]></category>
		<category><![CDATA[বাংলা]]></category>
		<category><![CDATA[সময়]]></category>

		<guid isPermaLink="false">http://tareq.wedevs.com/?p=1260</guid>
		<description><![CDATA[Today I worked with a wordpress site Bangladesh Linux Users Alliance, which is a complete Bangla language based site. You can translate with the Bangla language pack, but you can&#8217;t convert the English digits to it&#8217;s corresponding Bangla digit. So I visited the wordpress codex and found some filters that can do that job very [...]]]></description>
			<content:encoded><![CDATA[<p>Today I worked with a wordpress site <a href="http://www.linux.org.bd" target="_blank">Bangladesh Linux Users Alliance</a>, which is a complete Bangla language based site. You can translate with the Bangla language pack, but you can&#8217;t convert the English digits to it&#8217;s corresponding Bangla digit. So I visited the <a href="http://codex.wordpress.org" target="_blank">wordpress codex</a> and found some <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference" target="_blank">filters</a> that can do that job very easily.</p>
<p>Here is your function that will convert the digit</p>
<pre class="brush: php; title: ; notranslate">
/**
 * This function converts all english number's to bangla number
 */
function make_bangla_number($str)
{
	$engNumber = array(1,2,3,4,5,6,7,8,9,0);
	$bangNumber = array('১','২','৩','৪','৫','৬','৭','৮','৯','০');
	$converted = str_replace($engNumber, $bangNumber, $str);

	return $converted;
}
</pre>
<p>Now we need to add some filters that will hook to this places and convert the digit&#8217;s to Bangla.</p>
<pre class="brush: php; title: ; notranslate">
add_filter( 'get_the_time', 'make_bangla_number' );
add_filter( 'the_date', 'make_bangla_number' );
add_filter( 'get_the_date', 'make_bangla_number' );
add_filter( 'comments_number', 'make_bangla_number' );
add_filter( 'get_comment_date', 'make_bangla_number' );
add_filter( 'get_comment_time', 'make_bangla_number' );
</pre>
<p><span id="more-1260"></span><br />
If it&#8217;s not enough for you, go to the <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference" target="_blank">filter&#8217;s</a> page of the codex, and apply this filters as you need.</p>
<p>So, here&#8217;s the complete code</p>
<pre class="brush: php; title: ; notranslate">
/**
 * This function converts all english number's to bangla number
 */
function make_bangla_number($str)
{
	$engNumber = array(1,2,3,4,5,6,7,8,9,0);
	$bangNumber = array('১','২','৩','৪','৫','৬','৭','৮','৯','০');
	$converted = str_replace($engNumber, $bangNumber, $str);

	return $converted;
}

add_filter( 'get_the_time', 'make_bangla_number' );
add_filter( 'the_date', 'make_bangla_number' );
add_filter( 'get_the_date', 'make_bangla_number' );
add_filter( 'comments_number', 'make_bangla_number' );
add_filter( 'get_comment_date', 'make_bangla_number' );
add_filter( 'get_comment_time', 'make_bangla_number' );
</pre>
<p>Save the code in the functions.php file in your theme folder. Hope that solves your problem with localization <img src='http://tareq.wedevs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley colorbox-1260' /> </p>
<div id="_mcePaste" class="mcePaste" style="position: absolute; left: -10000px; top: 399px; width: 1px; height: 1px; overflow: hidden;">
<pre>add_filter( 'the_date', 'make_bangla_number' );</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://tareq.wedevs.com/2010/09/translate-wordpress-date-time-comment-number-to-bangla-digit/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>WordPress Plugin: GAF affiliate widget</title>
		<link>http://tareq.wedevs.com/2010/05/wordpress-plugin-gaf-affiliate-widget/</link>
		<comments>http://tareq.wedevs.com/2010/05/wordpress-plugin-gaf-affiliate-widget/#comments</comments>
		<pubDate>Mon, 31 May 2010 14:40:11 +0000</pubDate>
		<dc:creator>Tareq</dc:creator>
				<category><![CDATA[My Works]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[affiliate]]></category>
		<category><![CDATA[freelancer.com]]></category>
		<category><![CDATA[gaf]]></category>

		<guid isPermaLink="false">http://tareq.wedevs.com/?p=1247</guid>
		<description><![CDATA[Hello there, another wp plugin from me . I was thinking to be a Freelancer.com affiliate (previous GetAFreelancer) and  looking for some wordpress widget as I want to show the links in my blog sidebar. I found a plugin built by Masnun bro, but it gets related projects from freelancer.com according to your post and [...]]]></description>
			<content:encoded><![CDATA[<p>Hello there, another wp plugin from me <img src='http://tareq.wedevs.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley colorbox-1247' />  . I was thinking to be a <a href="http://Freelancer.com" target="_blank">Freelancer.com</a> affiliate (previous <a href="http://GetAFreelancer.com" target="_blank">GetAFreelancer</a>) and  looking for some wordpress widget as I want to show the links in my blog sidebar. I found a plugin built by <a href="http://masnun.com/blog/2009/11/21/my-first-wordpress-plugin-gaf-text-link/" target="_blank">Masnun</a> bro, but it gets related projects from freelancer.com according to your post and shows below of your post . So i thought, why i don&#8217;t I built one before anyone creates before me? <img src='http://tareq.wedevs.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley colorbox-1247' />  . So here is the plugin screenshot:</p>
<div id="attachment_1248" class="wp-caption aligncenter" style="width: 310px"><a href="http://tareq.wedevs.com/wp-content/uploads/2010/05/gaf_widget.jpg"><img class="size-full wp-image-1248 colorbox-1247" title="gaf_widget" src="http://tareq.wedevs.com/wp-content/uploads/2010/05/gaf_widget.jpg" alt="gaf_widget" width="300" height="371" /></a><p class="wp-caption-text">Widget setting screenshot</p></div>
<p>So i don&#8217;t need to describe what to do after installing the plugin, right? It&#8217;ll show the selected links to your sidebar like this:</p>
<div id="attachment_1249" class="wp-caption aligncenter" style="width: 324px"><a href="http://tareq.wedevs.com/wp-content/uploads/2010/05/gaf_sidebar_display.jpg"><img class="size-full wp-image-1249 colorbox-1247" title="gaf_sidebar_display" src="http://tareq.wedevs.com/wp-content/uploads/2010/05/gaf_sidebar_display.jpg" alt="" width="314" height="274" /></a><p class="wp-caption-text">Displaying links from freelancer.com</p></div>
<div class="download"><b> Download:</b> <a href="http://tareq.wedevs.com/downloads/gaf-affiliate-widget.zip" title="Downloaded 259 times">GAF affiliate plugin for wordpress</a></div>
<p>So why don&#8217;t you add this plugin to your blog and make some money? <img src='http://tareq.wedevs.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley colorbox-1247' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://tareq.wedevs.com/2010/05/wordpress-plugin-gaf-affiliate-widget/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Transliteration plugin for WordPress &amp; punBB</title>
		<link>http://tareq.wedevs.com/2009/10/google-transliteration-plugin-for-wordpress-punbb/</link>
		<comments>http://tareq.wedevs.com/2009/10/google-transliteration-plugin-for-wordpress-punbb/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 09:35:39 +0000</pubDate>
		<dc:creator>Tareq</dc:creator>
				<category><![CDATA[My Works]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[punBB]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Bangla]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[transliteration]]></category>

		<guid isPermaLink="false">http://tareq.wedevs.com/?p=1156</guid>
		<description><![CDATA[What is Google Transliterate? Google offers an automatic transliteration option that converts Roman characters to the characters used in Arabic, Bengali, Gujarati, Hindi, Kannada, Malayalam, Marathi, Nepali, Punjabi, Tamil, Telugu and Urdu. This feature lets you type these languages phonetically in English letters, but they&#8217;ll appear in their correct alphabet. Keep in mind that transliteration [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What is Google Transliterate?</strong></p>
<blockquote><p>Google offers an automatic transliteration option that converts Roman characters to the characters used in Arabic, Bengali, Gujarati, Hindi, Kannada, Malayalam, Marathi, Nepali, Punjabi, Tamil, Telugu and Urdu. This feature lets you type these languages phonetically in English letters, but they&#8217;ll appear in their correct alphabet. Keep in mind that transliteration is different from translation; the sound of the words is converted from one alphabet to the other, not the meaning.</p></blockquote>
<p><strong>What I did?</strong><br />
I did a integration of Google Transliterate with WordPress &amp; punBB. My plugin allows you to write phonetically with the help of Google Transliteration in the WordPress post editor and also in punBB post box. <strong>This will not work in rich text editor mode in wordpress, you need to switch on HTML mode</strong>.</p>
<p><strong>How does it work?</strong><br />
The bellow images tells you everything</p>
<ul>
<li>You can select your desired language from the list</li>
<p style="text-align: center;"><img class="colorbox-1156"  title="transliterate" src="http://tareq.wedevs.com/wp-content/uploads/2009/10/transliterate.png" alt="transliterate" width="183" height="340" /></p>
<li>After Selecting the language, active the google transliteration option by clicking the text.</li>
<p style="text-align: center;"><img class="colorbox-1156"  title="transliterate1" src="http://tareq.wedevs.com/wp-content/uploads/2009/10/transliterate1.png" alt="transliterate1" width="183" height="90" /></p>
<li>Type the words phonetically. Once you type a space or a punctuation mark, the letters will be converted to corresponding language characters, like this:</li>
<p style="text-align: center;"><img class="colorbox-1156"  title="transliterate2" src="http://tareq.wedevs.com/wp-content/uploads/2009/10/transliterate2.png" alt="transliterate2" width="156" height="73" /><img class="colorbox-1156"  title="transliterate3" src="http://tareq.wedevs.com/wp-content/uploads/2009/10/transliterate3.png" alt="transliterate3" width="129" height="76" /></p>
<li> If you need to correct a transliterated word, click the word; you&#8217;ll see a menu of alternate spellings, in addition to an option to switch back to the Roman characters you typed. If you type the same word again, it will then be transliterated correctly based on your saved preference. <img class="colorbox-1156"  title="transliterate4" src="http://tareq.wedevs.com/wp-content/uploads/2009/10/transliterate4.png" alt="transliterate4" width="230" height="229" /></li>
</ul>
<p><a class="downloadlink" href="http://tareq.wedevs.com/downloads/google-transliterationwordpress.zip" title="Version1.0 downloaded 338 times" >Download Google Tranliteration for Wordpress (338)</a><br />
<a class="downloadlink" href="http://tareq.wedevs.com/downloads/google_transliterationpunbb.zip" title="Version1.0 downloaded 281 times" >Download Google Tranliteration for punBB (281)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tareq.wedevs.com/2009/10/google-transliteration-plugin-for-wordpress-punbb/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Custom Content Gallery – My first wordpress plugin</title>
		<link>http://tareq.wedevs.com/2009/10/custom-content-gallery-%e2%80%93-my-first-wordpress-plugin/</link>
		<comments>http://tareq.wedevs.com/2009/10/custom-content-gallery-%e2%80%93-my-first-wordpress-plugin/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 20:17:08 +0000</pubDate>
		<dc:creator>Tareq</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[latest post]]></category>

		<guid isPermaLink="false">http://tareq.wedevs.com/?p=1146</guid>
		<description><![CDATA[Recently I thought to make a wordpress plugin, but was not getting any idea about what to make? I asked Lenin vai for some idea and that was not a bad one I named it, sorry that name was also given by Lenin vai, ha ha ha. It’s name is “Custom Content Gallery”. It’s work [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I thought to make a wordpress plugin, but was not getting any idea about what to make? I asked <a href="http://twitter.com/nine_L" target="_blank">Lenin vai</a> for some idea and that was not a bad one <img src='http://tareq.wedevs.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley colorbox-1146' /> </p>
<p>I named it, sorry that name was also given by Lenin vai, ha ha ha. It’s name is “Custom Content Gallery”. It’s work is simple, it will just show some latest title and description from some chosen category. You just need to insert the shortcode/keyword</p>
<pre class="brush: php; title: ; notranslate">
[custom_gallery cat=&quot;1, 2, 3&quot;]
</pre>
<p>. Here <strong>“1, 2, 3”</strong> is the <strong>category ID</strong>. So that post/page will show the latest 5 posts from each category. That was a very simple plugin and yeah, it&#8217;s size is under 1024 bytes <img src='http://tareq.wedevs.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley colorbox-1146' /> </p>
<div id="attachment_1147" class="wp-caption aligncenter" style="width: 330px"><img class="size-full wp-image-1147 colorbox-1146" title="Wordpress Custom Content Gallery" src="http://tareq.wedevs.com/wp-content/uploads/2009/10/Custom-Content-Gallery.jpg" alt="Wordpress Custom Content Gallery" width="320" height="563" /><p class="wp-caption-text">Wordpress Custom Content Gallery</p></div>
<div class="download"><b> Download:</b> <a href="http://tareq.wedevs.com/downloads/bangla-132-_language-pack.zip" title="Downloaded 840 times">Download punBB 1.3.2 Bangla Language Pack</a></div>
]]></content:encoded>
			<wfw:commentRss>http://tareq.wedevs.com/2009/10/custom-content-gallery-%e2%80%93-my-first-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

