<?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>Fredrik Malmgren</title>
	<atom:link href="http://fredrikmalmgren.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://fredrikmalmgren.com</link>
	<description>Entrepreneur, project manager and developer specialized in WordPress</description>
	<lastBuildDate>Fri, 23 Dec 2011 18:51:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Custom header on plugin page at WordPress.org</title>
		<link>http://fredrikmalmgren.com/custom-header-on-plugin-page-at-wordpress-org/</link>
		<comments>http://fredrikmalmgren.com/custom-header-on-plugin-page-at-wordpress-org/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 18:51:39 +0000</pubDate>
		<dc:creator>Fredrik Malmgren</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://fredrikmalmgren.com/?p=710</guid>
		<description><![CDATA[A few days ago Automattic added a very nice feature for all plugin pages on WordPress.org. Plugin developers are now able to control the header image on the plugin page. Matt describes this function on WordPress development updates. He also &#8230; <a href="http://fredrikmalmgren.com/custom-header-on-plugin-page-at-wordpress-org/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few days ago Automattic added a very nice feature for all plugin pages on WordPress.org. Plugin developers are now able to control the header image on the plugin page.</p>
<p><a title="Been giving a lot of thought to how to give plugin authors more control over their plugin pages" href="http://wpdevel.wordpress.com/2011/12/21/been-giving-a-lot-of-thought-to-how/" target="_blank">Matt describes this function</a> on <a title="WordPress Development Updates" href="http://wpdevel.wordpress.com/" target="_blank">WordPress development updates</a>. He also states that this function is an experiment and will likely be changed in the future.</p>
<p>To see a list of several plugins that already have added a custom header check out <a title="Plugin authors can now add custom header images to their WordPress.org listings" href="http://wpcandy.com/reports/plugin-authors-can-now-add-custom-header-images-on-dot-org" target="_blank">WP Candy&#8217;s post on this update</a>.</p>
<div id="attachment_711" class="wp-caption alignnone" style="width: 785px"><a href="http://fredrikmalmgren.com/wp-content/uploads/2011/12/custom-header-at-plugin-pag.png"><img class="size-full wp-image-711" title="Custom header on plugin pages at WordPress.org" src="http://fredrikmalmgren.com/wp-content/uploads/2011/12/custom-header-at-plugin-pag.png" alt="Custom header on plugin pages at WordPress.org" width="775" height="336" /></a><p class="wp-caption-text">Custom header on plugin pages at WordPress.org</p></div>
]]></content:encoded>
			<wfw:commentRss>http://fredrikmalmgren.com/custom-header-on-plugin-page-at-wordpress-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make sure that you are ready for WordPress 3.2</title>
		<link>http://fredrikmalmgren.com/make-sure-that-you-are-ready-for-wordpress-3-2/</link>
		<comments>http://fredrikmalmgren.com/make-sure-that-you-are-ready-for-wordpress-3-2/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 11:28:21 +0000</pubDate>
		<dc:creator>Fredrik Malmgren</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[requirements]]></category>

		<guid isPermaLink="false">http://fredrikmalmgren.com/?p=696</guid>
		<description><![CDATA[WordPress 3.2 will soon be released and at the same time the requirements for WordPress will be higher than for previous versions. The new requirements are: PHP version 5.2.4 or greater MySQL version 5.0 or greater How do I know &#8230; <a href="http://fredrikmalmgren.com/make-sure-that-you-are-ready-for-wordpress-3-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>WordPress 3.2 will soon be released and at the same time the <a title="WordPress Requirements" href="http://wordpress.org/about/requirements/" target="_blank">requirements for WordPress </a>will be higher than for previous versions.</p>
<p>The new requirements are:</p>
<ul>
<li><a title="PHP" href="http://php.net/" target="_blank">PHP</a> version 5.2.4 or greater</li>
<li><a title="MySQL" href="http://www.mysql.com/" target="_blank">MySQL</a> version 5.0 or greater</li>
</ul>
<h2>How do I know if I meet the requirements?</h2>
<p>Either you check directly with your host or you can use a WordPress plugin. In WordPress plugin directory there are two plugins that you can use.</p>
<ul>
<li><a title="Is Your Server Ready for WordPress 3.2" href="http://wordpress.org/extend/plugins/is-your-server-ready-for-wordpress-32/" target="_blank">Is Your Server Ready for WordPress 3.2</a></li>
<li><a title="WordPress Requirements Check" href="http://wordpress.org/extend/plugins/wordpress-requirements-check/" target="_blank">WordPress Requirements Check</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://fredrikmalmgren.com/make-sure-that-you-are-ready-for-wordpress-3-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Ultimate WordPress Cheatsheet [Infographic]</title>
		<link>http://fredrikmalmgren.com/the-ultimate-wordpress-cheatsheet-infographic/</link>
		<comments>http://fredrikmalmgren.com/the-ultimate-wordpress-cheatsheet-infographic/#comments</comments>
		<pubDate>Tue, 03 May 2011 20:12:15 +0000</pubDate>
		<dc:creator>Fredrik Malmgren</dc:creator>
				<category><![CDATA[Infographics]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Theme]]></category>

		<guid isPermaLink="false">http://fredrikmalmgren.com/?p=670</guid>
		<description><![CDATA[Tech king has put together a nice infographic that you can use if you work with WordPress themes. It covers the anatomy of WordPress theme, a template checklist, include tags, template tags and other useful information.]]></description>
			<content:encoded><![CDATA[<p><a title="The Ultimate WordPress Cheatsheet" href="http://www.testking.com/techking/infographics/the-ultimate-wordpress-cheatsheet-infographic/" target="_blank">Tech king</a> has put together a nice <a title="Infographics | Fredrik Malmgren" href="http://fredrikmalmgren.com/category/infographics/">infographic</a> that you can use if you work with <a title="WordPress | Fredrik Malmgren" href="http://fredrikmalmgren.com/wordpress/">WordPress</a> themes. It covers the anatomy of WordPress theme, a template checklist, include tags, template tags and other useful information.</p>
<p><a href="http://fredrikmalmgren.com/wp-content/uploads/2011/04/the-ultimate-wordpress-cheatsheet.jpg"><img class="alignnone size-full wp-image-676" title="the-ultimate-wordpress-cheatsheet" src="http://fredrikmalmgren.com/wp-content/uploads/2011/04/the-ultimate-wordpress-cheatsheet.jpg" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://fredrikmalmgren.com/the-ultimate-wordpress-cheatsheet-infographic/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Easy Excerpt is updated to version 0.3.0</title>
		<link>http://fredrikmalmgren.com/easy-excerpt-is-updated-to-version-0-3-0/</link>
		<comments>http://fredrikmalmgren.com/easy-excerpt-is-updated-to-version-0-3-0/#comments</comments>
		<pubDate>Mon, 02 May 2011 14:10:15 +0000</pubDate>
		<dc:creator>Fredrik Malmgren</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[easy excerpt]]></category>
		<category><![CDATA[excerpt]]></category>

		<guid isPermaLink="false">http://fredrikmalmgren.com/?p=682</guid>
		<description><![CDATA[My WordPress plugin Easy Excerpt which you can use to changed the appearance of your excerpts is now updated to version 0.3.0. New in this version: Added license information Made plugin ready for translation Added Swedish translation]]></description>
			<content:encoded><![CDATA[<p>My WordPress plugin <a title="Easy Excerpt" href="http://fredrikmalmgren.com/wordpress/plugins/easy-excerpt/">Easy Excerpt</a> which you can use to changed the appearance of your excerpts is now updated to version 0.3.0.</p>
<p>New in this version:</p>
<ul>
<li>Added license information</li>
<li>Made plugin ready for translation</li>
<li>Added Swedish translation</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://fredrikmalmgren.com/easy-excerpt-is-updated-to-version-0-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to redirect to current page after login</title>
		<link>http://fredrikmalmgren.com/how-to-redirect-to-current-page-after-login/</link>
		<comments>http://fredrikmalmgren.com/how-to-redirect-to-current-page-after-login/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 13:06:19 +0000</pubDate>
		<dc:creator>Fredrik Malmgren</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[wp_login_url]]></category>

		<guid isPermaLink="false">http://fredrikmalmgren.com/?p=633</guid>
		<description><![CDATA[WordPress have a very handy function, wp_login_url(),  that let you add a link to your login page. However, the really nice thing with this function is that it accepts a URL as a parameter to redirect the user after successful &#8230; <a href="http://fredrikmalmgren.com/how-to-redirect-to-current-page-after-login/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>WordPress have a very handy function, <a title="Function Reference/wp login url « WordPress Codex" href="http://codex.wordpress.org/Function_Reference/wp_login_url" target="_blank">wp_login_url()</a>,  that let you add a link to your login page. However, the really nice thing with this function is that it accepts a URL as a parameter to redirect the user after successful login.</p>
<p>Add this code to you theme template where you want the login link to be displayed.</p>
<pre class="brush: php; title: ; notranslate">
&lt;a href=&quot;&lt;?php echo wp_login_url( get_permalink() ); ?&gt;&quot; title=&quot;Login&quot;&gt;Login&lt;/a&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://fredrikmalmgren.com/how-to-redirect-to-current-page-after-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add a custom default avatar to your WordPress site</title>
		<link>http://fredrikmalmgren.com/add-a-custom-default-avatar-to-your-wordpress-site/</link>
		<comments>http://fredrikmalmgren.com/add-a-custom-default-avatar-to-your-wordpress-site/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 12:04:11 +0000</pubDate>
		<dc:creator>Fredrik Malmgren</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[add_filter]]></category>
		<category><![CDATA[avatar]]></category>
		<category><![CDATA[avatar_defaults]]></category>
		<category><![CDATA[gravatar]]></category>

		<guid isPermaLink="false">http://fredrikmalmgren.com/?p=642</guid>
		<description><![CDATA[WordPress have a built in support for gravatars which means that WordPress will automatically fetch the avatar associated with the commenting users email address. If the email address is not associated with an avatar WordPress will display a default avatar. &#8230; <a href="http://fredrikmalmgren.com/add-a-custom-default-avatar-to-your-wordpress-site/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>WordPress have a built in support for <a title="Gravatar - Globally Recognized Avatars" href="http://gravatar.com/" target="_blank">gravatars</a> which means that WordPress will automatically fetch the avatar associated with the commenting users email address. If the email address is not associated with an avatar WordPress will display a default avatar. You as a site owner can choose between a set of default avatars but you can also add your own custom avatar. Choose default avatar from the discussion page under the settings menu.</p>
<div id="attachment_645" class="wp-caption alignnone" style="width: 483px"><a href="http://fredrikmalmgren.com/wp-content/uploads/2011/03/wordpress-default-avatars.png"><img class="size-full wp-image-645" title="WordPress Default Avatars" src="http://fredrikmalmgren.com/wp-content/uploads/2011/03/wordpress-default-avatars.png" alt="WordPress Default Avatars" width="473" height="326" /></a><p class="wp-caption-text">WordPress Default Avatars</p></div>
<h2>How to add a default custom avatar</h2>
<p>To add a custom avatar, place the following code in your <a title="Functions.php | Fredrik Malmgren" href="http://fredrikmalmgren.com/tag/functions-php/" target="_blank">functions.php</a> located in your theme folder.</p>
<pre class="brush: php; title: ; notranslate">
add_filter( 'avatar_defaults', 'new_avatar' );
function new_avatar($avatar_defaults) {
	$new_avatar = get_stylesheet_directory_uri() . '/images/custom-default-avatar.png';
	$avatar_defaults[$new_avatar] = &quot;Site name&quot;;
	return $avatar_defaults;
}
</pre>
<p>&#8220;Site name&#8221; is the text to the right of the avatar in the image above. Change it to something appropriate. Also, don&#8217;t forget to add the image to the images directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://fredrikmalmgren.com/add-a-custom-default-avatar-to-your-wordpress-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Only include Contact Form 7 javascript and CSS when needed</title>
		<link>http://fredrikmalmgren.com/only-include-contact-form-7-javascript-and-css-when-needed/</link>
		<comments>http://fredrikmalmgren.com/only-include-contact-form-7-javascript-and-css-when-needed/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 23:10:14 +0000</pubDate>
		<dc:creator>Fredrik Malmgren</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[add_action]]></category>
		<category><![CDATA[Contact Form 7]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[wp_deregister_script]]></category>
		<category><![CDATA[wp_deregister_style]]></category>
		<category><![CDATA[wp_print_scripts]]></category>
		<category><![CDATA[wp_print_styles]]></category>

		<guid isPermaLink="false">http://fredrikmalmgren.com/?p=614</guid>
		<description><![CDATA[The Contact Form 7 is a great WordPress plugin for adding contact forms to your site. The plugin is very easy to use and make nice contact forms with. The bad news is that the plugin includes javascript and CSS &#8230; <a href="http://fredrikmalmgren.com/only-include-contact-form-7-javascript-and-css-when-needed/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The <a title="Contact Form 7 « WordPress Plugins" href="http://wordpress.org/extend/plugins/contact-form-7/" target="_blank">Contact Form 7</a> is a great WordPress plugin for adding contact forms to your site. The plugin is very easy to use and make nice contact forms with.</p>
<p>The bad news is that the plugin includes javascript and CSS on every page which makes your site load slower than necessary. The good news is that there is an easy fix for it.</p>
<p>By adding the two following code snippets to your themes <a title="Functions.php | Fredrik Malmgren" href="http://fredrikmalmgren.com/tag/functions-php/" target="_blank">functions.php</a> you can remove the javascript and CSS from all pages that don&#8217;t use it which makes your site load faster.</p>
<h2>Remove Contact Form 7 javascript</h2>
<pre class="brush: php; title: ; notranslate">
add_action( 'wp_print_scripts', 'deregister_cf7_javascript', 100 );
function deregister_cf7_javascript() {
	if ( !is_page(100) ) {
		wp_deregister_script( 'contact-form-7' );
	}
}
</pre>
<h2>Remove Contact Form 7 CSS</h2>
<pre class="brush: php; title: ; notranslate">
add_action( 'wp_print_styles', 'deregister_cf7_styles', 100 );
function deregister_cf7_styles() {
	if ( !is_page(100) ) {
		wp_deregister_style( 'contact-form-7' );
	}
}
</pre>
<p>In both code snippets, change the number <em>100</em> to the id of the page where you have added the contact form or use the page slug instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://fredrikmalmgren.com/only-include-contact-form-7-javascript-and-css-when-needed/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>WordPress plugins &#8211; Types and statuses</title>
		<link>http://fredrikmalmgren.com/wordpress-plugins-types-and-statuses/</link>
		<comments>http://fredrikmalmgren.com/wordpress-plugins-types-and-statuses/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 12:51:42 +0000</pubDate>
		<dc:creator>Fredrik Malmgren</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[advanced-cache.php]]></category>
		<category><![CDATA[blog-deleted.php]]></category>
		<category><![CDATA[blog-inactive.php]]></category>
		<category><![CDATA[blog-suspended.php]]></category>
		<category><![CDATA[db-error.php]]></category>
		<category><![CDATA[db.php]]></category>
		<category><![CDATA[drop-ins]]></category>
		<category><![CDATA[install.php]]></category>
		<category><![CDATA[maintenance.php]]></category>
		<category><![CDATA[must-use]]></category>
		<category><![CDATA[object-cache.php]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[sunrise.php]]></category>

		<guid isPermaLink="false">http://fredrikmalmgren.com/?p=590</guid>
		<description><![CDATA[WordPress plugins is what gives WordPress the extra power and enables you to extend the functionality of WordPress so that you can do more or less anything you like. At the time of writing this post almost 14 thousand plugins &#8230; <a href="http://fredrikmalmgren.com/wordpress-plugins-types-and-statuses/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="WordPress plugins" href="http://fredrikmalmgren.com/wordpress/plugins/">WordPress plugins</a> is what gives WordPress the extra power and enables you to extend the functionality of WordPress so that you can do more or less anything you like. At the time of writing this post almost 14 thousand plugins exists in WordPress <a title="WordPress › WordPress Plugins" href="http://wordpress.org/extend/plugins/" target="_blank">plugin directory</a>.</p>
<p>Most users of WordPress think that there is only one type of plugin. However, there is actually three types of plugins that you can use.</p>
<div id="attachment_594" class="wp-caption alignnone" style="width: 557px"><a href="http://fredrikmalmgren.com/wp-content/uploads/2011/03/wordpress-plugin-types-and-statuses.png"><img class="size-full wp-image-594" title="WordPress Plugin - Types and Statuses" src="http://fredrikmalmgren.com/wp-content/uploads/2011/03/wordpress-plugin-types-and-statuses.png" alt="WordPress Plugin - Types and Statuses" width="547" height="109" /></a><p class="wp-caption-text">WordPress Plugin - Types and Statuses</p></div>
<h2>Normal plugins</h2>
<p>This is the plugins that you normally download from the plugin directory at WordPress.org. These plugins are located in the <em>wp-content/plugins</em> directory.</p>
<p><strong>These plugins can have the following statuses.</strong></p>
<ul>
<li><em>Active</em> &#8211; The plugin is active and plugin code will be executed</li>
<li><em>Inactive</em>- The plugin is installed but inactive and no code is executed</li>
<li><em>Upgrade Available</em> &#8211; A new version of the plugin is available</li>
</ul>
<h2>Must-use plugins</h2>
<p>The must-use plugins are very similar to normal plugins. The main difference is that they are placed in the <em>wp-content/mu-plugins</em> directory and can not be located in a subfolder.</p>
<p>The mu-plugins directory is created by default if you install <a title="Create A Network « WordPress Codex" href="http://codex.wordpress.org/Create_A_Network" target="_blank">WordPress Multisite </a>(WordPress MS) but you can use it in the normal installation of WordPress if you manually create the mu-plugins directory.</p>
<p>These plugins are activated by default and the only way to deactivate them is to remove them from the mu-plugins directory. Must-use plugins are listed under &#8220;Must-use&#8221; in the plugins page.</p>
<h2>Drop-ins plugins</h2>
<p>Drop-ins are plugins that can replace core functionality of WordPress. These kind of plugins are placed in the <em>wp-content</em> directory and must be named in a certain way for WordPress to be able to auto-load them. Drop-ins plugins are listed under &#8220;Drop-ins&#8221; in the plugins page and is activated by default. Remove them from this directory if you want to deactivate them.</p>
<p><strong>Drop-ins available in WordPress and WordPress MS</strong></p>
<ul>
<li><em>advanced-cache.php</em> &#8211; Advanced caching plugin</li>
<li><em>db.php</em> &#8211; Custom database class</li>
<li><em>db-error.php</em> &#8211; Custom database error message</li>
<li><em>install.php</em> &#8211; Custom installation script</li>
<li><em>maintenance.php</em> &#8211; Custom maintenance message</li>
<li><em>object-cache.php</em> &#8211; External object cache</li>
</ul>
<p><strong>WordPress Multisite specific drop-ins</strong></p>
<ul>
<li><em>sunrise.php</em> &#8211; Advanced domain mapping</li>
<li><em>blog-deleted.php</em> &#8211; Custom blog deleted message</li>
<li><em>blog-inactive.php</em> &#8211; Custom blog inactive message</li>
<li><em>blog-suspended.php</em> &#8211; Custom blog suspended message</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://fredrikmalmgren.com/wordpress-plugins-types-and-statuses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cache data with WordPress Transient API</title>
		<link>http://fredrikmalmgren.com/cache-data-with-wordpress-transient-api/</link>
		<comments>http://fredrikmalmgren.com/cache-data-with-wordpress-transient-api/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 11:41:29 +0000</pubDate>
		<dc:creator>Fredrik Malmgren</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[add_action]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[delete_transient]]></category>
		<category><![CDATA[get_transient]]></category>
		<category><![CDATA[publish_post]]></category>
		<category><![CDATA[set_transient]]></category>
		<category><![CDATA[transient]]></category>

		<guid isPermaLink="false">http://fredrikmalmgren.com/?p=561</guid>
		<description><![CDATA[With WordPress transient API you can cache data in the database by giving it a unique identifier and an optional expire time after it will be deleted. There are basically three functions in this API. $transient &#8211; a unique identifier &#8230; <a href="http://fredrikmalmgren.com/cache-data-with-wordpress-transient-api/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>With <a title="Transients API « WordPress Codex" href="http://codex.wordpress.org/Transients_API" target="_blank">WordPress transient API</a> you can cache data in the database by giving it a unique identifier and an optional expire time after it will be deleted.</p>
<p>There are basically three functions in this API.</p>
<pre class="brush: php; title: ; notranslate">
// Save data
set_transient($transient, $data, $expiration);

// Fetch data
get_transient($transient);

// Remove data
delete_transient($transient);
</pre>
<ul>
<li><strong>$transient</strong> &#8211; a unique identifier</li>
<li><strong>$data</strong> &#8211; the data to cache in the database</li>
<li><strong>$expiration</strong> (optional) &#8211; seconds until the data should expire</li>
</ul>
<p>The get_transient function will return <em>false</em> if the data has expired.</p>
<h2>An example of how to use WordPress transient API</h2>
<p>Lets make up a very basic example. Say that you have a widget that query the database for the 5 latest posts. To minimize the load on the database you can cache the results for a period of time. In this example we set the expiration time to 1 hour.</p>
<p>The php function can look something this.</p>
<pre class="brush: php; title: ; notranslate">
// Get cached data, if any
if (false === ( $my_widget_query_results = get_transient('my_widget_query_results') ) ) {
    // If no data in cache, regenerate the data and save it
     $my_widget_query_results = new WP_Query('order=desc&amp;post_count=5');
     set_transient('my_widget_query_results', $my_widget_query_results, 60*60*1);
}

// Then use the data as normal
</pre>
<p>Alternatively, you can skip the expiration parameter and use action hooks instead to delete the cached data. By doing it this way you will only regenerate the data when you actually need to. In our example, when a new post is published.</p>
<pre class="brush: php; title: ; notranslate">
add_action('publish_post', 'remove_my_widget_query_results);

function remove_my_widget_query_results() {
	delete_transient('my_widget_query_results');
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://fredrikmalmgren.com/cache-data-with-wordpress-transient-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to modify WordPress favorite actions menu</title>
		<link>http://fredrikmalmgren.com/how-to-modify-wordpress-favorite-actions-menu/</link>
		<comments>http://fredrikmalmgren.com/how-to-modify-wordpress-favorite-actions-menu/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 13:12:50 +0000</pubDate>
		<dc:creator>Fredrik Malmgren</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[add_filter]]></category>
		<category><![CDATA[favorite_actions]]></category>
		<category><![CDATA[functions.php]]></category>

		<guid isPermaLink="false">http://fredrikmalmgren.com/?p=538</guid>
		<description><![CDATA[Since WordPess 2.7 there is a drop-down menu in admin that displays links to common actions. I don&#8217;t know the official name for it so I will just call it favorite actions menu. The problem with this menu is that &#8230; <a href="http://fredrikmalmgren.com/how-to-modify-wordpress-favorite-actions-menu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Since WordPess 2.7 there is a drop-down menu in admin that displays links to common actions. I don&#8217;t know the official name for it so I will just call it favorite actions menu.</p>
<div id="attachment_542" class="wp-caption alignnone" style="width: 405px"><a href="http://fredrikmalmgren.com/wp-content/uploads/2011/03/wordpress-favorite-action-menu.png"><img class="size-full wp-image-542" title="WordPress Favorite Action Menu" src="http://fredrikmalmgren.com/wp-content/uploads/2011/03/wordpress-favorite-action-menu.png" alt="WordPress Favorite Action Menu" width="395" height="136" /></a><p class="wp-caption-text">WordPress Favorite Action Menu</p></div>
<p>The problem with this menu is that there are no options in WordPress to change the content of this menu (sure, there are of course plugins that can change this for you).</p>
<p>However, in this tutorial I will show you how to change this menu by adding some code to your themes <a title="Functions.php | Fredrik Malmgren" href="http://fredrikmalmgren.com/tag/functions-php/" target="_blank">functions.php</a>.</p>
<p>This first example will show you <strong>how to remove the favorite actions menu</strong> completely. This is really simple. Just return an empty array.</p>
<pre class="brush: php; title: ; notranslate">
function my_favorite_actions_menu($actions) {
	$actions = array();
	 return $actions;
}
add_filter('favorite_actions', 'my_favorite_actions_menu');
</pre>
<p>In the next example I will show you <strong>how to remove a menu item.</strong> To remove a menu item just unset that item. To find out which file to use in the unset function, just hover the mouse over the menu item and see what file it links to.</p>
<pre class="brush: php; title: ; notranslate">
function my_favorite_actions_menu($actions) {
	unset($actions['media-new.php']);
	return $actions;
}
add_filter('favorite_actions', 'my_favorite_actions_menu');
</pre>
<p>The last example will show you <strong>how to add a menu item </strong>to the plugins page. Worth mentioning is that the second parameter of the array is the capability. By using the <a title="Roles and Capabilities « WordPress Codex" href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">capabilities</a> we can choose which menu items each user role will see.</p>
<pre class="brush: php; title: ; notranslate">
function my_favorite_actions_menu($actions) {
	$actions['plugins.php'] = array('Plugins', 'activate_plugins');
	return $actions;
}
add_filter('favorite_actions', 'my_favorite_actions_menu');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://fredrikmalmgren.com/how-to-modify-wordpress-favorite-actions-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

