<?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>WP Engineer &#187; wp2.8</title>
	<atom:link href="http://wpengineer.com/tag/wp28/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpengineer.com</link>
	<description>WordPress News, Hacks, Tips, Tutorials, Plugins and Themes</description>
	<lastBuildDate>Mon, 21 May 2012 22:48:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Themes and automatic_feed_links</title>
		<link>http://wpengineer.com/1655/themes-and-automatic_feed_links/</link>
		<comments>http://wpengineer.com/1655/themes-and-automatic_feed_links/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 11:56:13 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp2.8]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=1655</guid>
		<description><![CDATA[Since WordPress 2.8, there is the function automatic_feed_links() in the function.php. Which writes the link elements for the RSS protocols in the header of the document. The advantage of this feature is, you do not need to worry about whether a change comes in the Feed-protocoll in a new version of WordPress, removed or a [...]]]></description>
			<content:encoded><![CDATA[<p>Since WordPress 2.8, there is the function <strong>automatic_feed_links()</strong> in the function.php. Which writes the link elements for the RSS protocols in the header of the document. The advantage of this feature is, you do not need to worry about whether a change comes in the Feed-protocoll in a new version of WordPress, removed or a new one is added.</p>
<p><! - more -><br />
If we develop a theme for the general public, you have 2 options. You use automatic_feed_links() and the theme does not work with WordPress prior to version 2.8, or you do not use this function and write the links as before, in your header.php.</p>
<p>I also have a 3rd alternative <img src='http://wpengineer.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<pre lang="php">
if (function_exists(&#039;automatic_feed_links&#039;)) {
    automatic_feed_links();
} else {
    add_action(&#039;wp_head&#039;, &#039;wpe_feed_links&#039;, 2);
}

function wpe_feed_links() {
    echo &#039;&lt;link rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;&#039;. get_bloginfo(&#039;name&#039;).&#039; RSS Feed&quot; href=&quot;&#039;. get_bloginfo(&#039;rss2_url&#039;).&#039;&quot; /&gt;&#039;;
    echo &#039;&lt;link rel=&quot;alternate&quot; type=&quot;application/atom+xml&quot; title=&quot;&#039;. get_bloginfo(&#039;name&#039;).&#039; Atom Feed&quot; href=&quot;&#039;. get_bloginfo(&#039;atom_url&#039;).&#039;&quot; /&gt;&#039;;
    echo &#039;&lt;link rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;&#039;. get_bloginfo(&#039;name&#039;).&#039; &#039;. __(&#039;The latest comments to all posts in RSS&#039;).&#039;&quot; href=&quot;&#039;. get_bloginfo(&#039;comments_rss2_url&#039;).&#039;&quot; /&gt;&#039;;
}
</pre>
<p>First we look if the function automatic_feed_links() exists. If not (prior to WP 2.8), we use the hook wp_head and write the links in the header of the page. Thus we don't need to adjust the header.php anymore.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/1655/themes-and-automatic_feed_links/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress 2.8 Single Post Navigation Widget</title>
		<link>http://wpengineer.com/1551/wordpress-2-8-single-post-navigation-widget/</link>
		<comments>http://wpengineer.com/1551/wordpress-2-8-single-post-navigation-widget/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 13:38:57 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[Widget API]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp2.8]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=1551</guid>
		<description><![CDATA[Since WordPress 2.8, there is a new Widget API. In our post Build A WordPress 2.8 Widget With The New Widget API, I have used a simple example to describe how to build a Widget. This time Heiko and I've created something more complex. It is a Post Navigation Widget, which lists in the single [...]]]></description>
			<content:encoded><![CDATA[<p>Since WordPress 2.8, there is a new <strong>Widget API</strong>. In our post <a title="WordPress 2.8 Widget API" href="http://wpengineer.com/wordpress-built-a-widget/">Build A WordPress 2.8 Widget With The New Widget API</a>, I have used a simple example to describe how to build a <strong>Widget</strong>. This time Heiko and I've created something more complex.</p>
<p><span id="more-1551"></span><br />
It is a Post Navigation Widget, which lists in the single post view (single.php) a specific number of posts which were published before this post and a certain number of posts which were published after this post. I think this is a nice way to show older posts in the sidebar. Here's a screenshot, left of the backend, right of the sidebar:</p>
<p><img src="http://wpengineer.com/wp-content/uploads/post-navigation-widget.png" alt="WordPress Single Post Navigation Widget" title="WordPress Single Post Navigation Widget" width="505" height="386" class="aligncenter size-full wp-image-1553" /></p>
<p>I created a query to check if the class <strong>WP_Widget</strong> even exists, so the user won't get any error messages in WordPress versions prior to 2.8.</p>
<pre lang="php">
&lt;?php
if (class_exists(&#039;WP_Widget&#039;)) {
    class WPE_Widget_Post_Navigation extends WP_Widget {

        function WPE_Widget_Post_Navigation() {
            $widget_ops = array(&#039;classname&#039; =&gt; &#039;wpe_widget_post_navi&#039;, &#039;description&#039; =&gt; __( &quot;Some posts before and after the current post&quot;) );
            $this-&gt;WP_Widget(&#039;wpe-post-navi&#039;, __(&#039;WPE Single Post Navigation&#039;), $widget_ops);
        }

        function widget($args, $instance) {
            if(is_single()) {
                global $post, $wpdb;
                extract($args);

                if ( !$number = (int) $instance&#091;&#039;number&#039;&#093; )
                    $number = 5;
                elseif( $number &lt; 1 )
                    $number = 1;
                elseif( $number &gt; 10 )
                    $number = 10;

                $title_before 		= apply_filters(&#039;widget_title&#039;, empty($instance&#091;&#039;title_before&#039;&#093;) ? &#039;Posts before&#039; : $instance&#091;&#039;title_before&#039;&#093;);
                $title_after	 	= apply_filters(&#039;widget_title&#039;, empty($instance&#091;&#039;title_after&#039;&#093;) ? &#039;Posts after&#039; : $instance&#091;&#039;title_after&#039;&#093;);
                $before_widget_2	= preg_replace(&quot;/(wpe\-post\-navi-\d+)/&quot;, &quot;$1-1&quot;, $before_widget);

                $querystr = &quot;
                    SELECT *
                    FROM $wpdb-&gt;posts wposts
                    WHERE wposts.ID != $post-&gt;ID
                    AND wposts.post_type = &#039;post&#039;
                    AND wposts.post_status = &#039;publish&#039;
                    AND wposts.post_date %s &#039;$post-&gt;post_date&#039;
                    ORDER BY wposts.post_date %s
                    LIMIT $number
                 &quot;;

                $leading_posts = $wpdb-&gt;get_results(sprintf($querystr, &#039;&lt;&#039;, &#039;DESC&#039;), OBJECT);
                $trailing_posts = $wpdb-&gt;get_results(sprintf($querystr, &#039;&gt;&#039;, &#039;ASC&#039;), OBJECT);

                if ($trailing_posts &amp;&amp; count($trailing_posts)) {
                    echo $before_widget_2 . $before_title . $title_before . $after_title . &quot;&lt;ul&gt;&quot;;
                    $trailing_posts = array_reverse($trailing_posts);
                    foreach ($trailing_posts as $post) {
                        setup_postdata($post);
                        ?&gt; &lt;li&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; title=&quot;&lt;?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?&gt;&quot;&gt;&lt;?php if ( get_the_title() ) the_title(); else the_ID(); ?&gt; &lt;/a&gt;&lt;/li&gt;&lt;?php
                    }
                    echo &quot;&lt;/ul&gt;&quot; . $after_widget;
                }

                if ($leading_posts &amp;&amp; count($leading_posts)) {
                    echo $before_widget . $before_title . $title_after . $after_title . &quot;&lt;ul&gt;&quot;;
                    foreach ($leading_posts as $post) {
                        setup_postdata($post);
                        ?&gt; &lt;li&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; title=&quot;&lt;?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?&gt;&quot;&gt;&lt;?php if ( get_the_title() ) the_title(); else the_ID(); ?&gt; &lt;/a&gt;&lt;/li&gt;&lt;?php
                    }
                    echo &quot;&lt;/ul&gt;&quot; . $after_widget;
                }
                wp_reset_query();
            }
        }

        function update( $new_instance, $old_instance ) {
            $instance = $old_instance;
            $instance&#091;&#039;title_before&#039;&#093; = strip_tags($new_instance&#091;&#039;title_before&#039;&#093;);
            $instance&#091;&#039;number&#039;&#093; = (int) $new_instance&#091;&#039;number&#039;&#093;;
            $instance&#091;&#039;title_after&#039;&#093; = strip_tags($new_instance&#091;&#039;title_after&#039;&#093;);

            return $instance;
        }
        function form( $instance ) {
            $title_before = ($instance&#091;&#039;title_before&#039;&#093; == &#039;&#039;) ? &#039;Posts before&#039; : esc_attr($instance&#091;&#039;title_before&#039;&#093;);
            $title_after = ($instance&#091;&#039;title_after&#039;&#093; == &#039;&#039;) ? &#039;Posts after&#039; : esc_attr($instance&#091;&#039;title_after&#039;&#093;);
            if ( !$number = (int) $instance&#091;&#039;number&#039;&#093; )
                $number = 5;
            elseif ( $number &lt; 1 )
                $number = 1;
            elseif ( $number &gt; 10 )
                $number = 10;
    ?&gt;
            &lt;p&gt;&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id(&#039;title_before&#039;); ?&gt;&quot;&gt;Title before:&lt;/label&gt;
            &lt;input class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id(&#039;title_before&#039;); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name(&#039;title_before&#039;); ?&gt;&quot; type=&quot;text&quot; value=&quot;&lt;?php echo $title_before; ?&gt;&quot; /&gt;&lt;/p&gt;
            &lt;p&gt;&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id(&#039;title_after&#039;); ?&gt;&quot;&gt;Title after:&lt;/label&gt;
            &lt;input class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id(&#039;title_after&#039;); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name(&#039;title_after&#039;); ?&gt;&quot; type=&quot;text&quot; value=&quot;&lt;?php echo $title_after; ?&gt;&quot; /&gt;&lt;/p&gt;
            &lt;p&gt;&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id(&#039;number&#039;); ?&gt;&quot;&gt;Number of posts to show before and after current post:&lt;/label&gt;
            &lt;input id=&quot;&lt;?php echo $this-&gt;get_field_id(&#039;number&#039;); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name(&#039;number&#039;); ?&gt;&quot; type=&quot;text&quot; value=&quot;&lt;?php echo $number; ?&gt;&quot; size=&quot;3&quot; /&gt;&lt;br /&gt;
            &lt;small&gt;(at most 10)&lt;/small&gt;&lt;/p&gt;
    &lt;?php
        }
    }
    register_widget(&#039;WPE_Widget_Post_Navigation&#039;);
}
?&gt;
</pre>
<p>Most of this should be self-explanatory. Now to the function <strong>widget () </strong>, which does the actual work. Here we had to do a little trick, because the widget actually creates 2 widgets, and they would get the same ID. That wouldn't be valid, so the code adds a -1 to one of the widget elements:</p>
<pre lang="php">
$before_widget_2 = preg_replace(&quot;/(wpe\-post\-navi-\d+)/&quot;, &quot;$1-1&quot;, $before_widget);
</pre>
<p>2 queries are getting executed. One for the posts before this post and one for the posts after this post. if posts are available they will show up on the sidebar.</p>
<p><a title="Download Widget" href="http://wpengineer.com/?download=Single%20Post%20Navigation%20Widget">Download Widget</a>.<br />
Then unpack and copy the code into <strong>functions.php</strong>. Please note, the widget is for <strong>WordPress 2.8</strong>.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/1551/wordpress-2-8-single-post-navigation-widget/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Cleanup WordPress Header</title>
		<link>http://wpengineer.com/1438/wordpress-header/</link>
		<comments>http://wpengineer.com/1438/wordpress-header/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 13:24:03 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress 2.8]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[wp2.8]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=1438</guid>
		<description><![CDATA[WordPress implements new standard features in the head of the theme since version 2.5, that are always on the hook wp_head. Even in WordPress 2.8 new functions were added. If you don't need them you can easily disable them by using the function remove_action. Function remove_action remove_action( $tag, $function_to_add, $priority, $accepted_args ); This function removes [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress implements new standard features in the head of the theme since version 2.5, that are always on the hook <code>wp_head</code>. Even in WordPress 2.8 new functions were added. If you don't need them you can easily disable them by using the function <a title="Doc in Codex" href="http://codex.wordpress.org/Function_Reference/remove_action"><code>remove_action</code></a>.<br />
<span id="more-1438"></span></p>
<h3>Function <code>remove_action</code></h3>
<p><code>remove_action( $tag, $function_to_add, $priority, $accepted_args );</code></p>
<blockquote><p>This function removes a function attached to a specified action hook. This method can be used to remove default functions attached to a specific action hook and possibly replace them with a substitute.</p>
<p><strong>Important:</strong> To remove a hook, the <code>$function_to_remove</code> and <code>$priority</code> arguments must match when the hook was added. This goes for both filters and actions. No warning will be given on removal failure.<br />
<cite>via: <a href="http://codex.wordpress.org/Function_Reference/remove_action">WP Codexy</a></cite></p></blockquote>
<p>The following syntax shows an excerpt, only a part of the output you can have in your theme. They result from the standard functions, which are loaded in the head of the theme. Visible, if you search in the file <code>wp-includes/default-filters.php</code> for the Hook <code>wp_head</code>. Not all filters should be deactivated, because in most cases they are useful. But WordPress is not only as classical blog in use and therefore some functions are not necessary.</p>
<pre lang="php">
&lt;link rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;WP Engineer RSS Feed&quot; href=&quot;http://wpengineer.com/feed/&quot; /&gt;
&lt;link rel=&quot;alternate&quot; type=&quot;application/atom+xml&quot; title=&quot;WP Engineer Atom Feed&quot; href=&quot;http://wpengineer.com/feed/atom/&quot; /&gt;
&lt;link rel=&quot;pingback&quot; href=&quot;http://wpengineer.com/blog/xmlrpc.php&quot; /&gt;
&lt;link rel=&quot;EditURI&quot; type=&quot;application/rsd+xml&quot; title=&quot;RSD&quot; href=&quot;http://wpengineer.com/xmlrpc.php?rsd&quot; /&gt;
&lt;link rel=&#039;index&#039; title=&#039;WP Engineer&#039; href=&#039;http://wpengineer.com&#039; /&gt;
&lt;link rel=&#039;start&#039; title=&#039;Use WordPress 2.7 Offline&#039; href=&#039;http://wpengineer.com/use-wordpress-27-offline/&#039; /&gt;
&lt;link rel=&#039;prev&#039; title=&#039;Recents Drafts All Authors&#039; href=&#039;http://wpengineer.com/recents-drafts-all-authors/&#039; /&gt;
</pre>
<p>This is an example, not a recommendation where some functions are deactivated. Check your header and turn off what you don't need. Less markup and better loading time.</p>
<pre lang="php">
remove_action( &#039;wp_head&#039;, &#039;feed_links_extra&#039;, 3 ); // Display the links to the extra feeds such as category feeds
remove_action( &#039;wp_head&#039;, &#039;feed_links&#039;, 2 ); // Display the links to the general feeds: Post and Comment Feed
remove_action( &#039;wp_head&#039;, &#039;rsd_link&#039; ); // Display the link to the Really Simple Discovery service endpoint, EditURI link
remove_action( &#039;wp_head&#039;, &#039;wlwmanifest_link&#039; ); // Display the link to the Windows Live Writer manifest file.
remove_action( &#039;wp_head&#039;, &#039;index_rel_link&#039; ); // index link
remove_action( &#039;wp_head&#039;, &#039;parent_post_rel_link&#039;, 10, 0 ); // prev link
remove_action( &#039;wp_head&#039;, &#039;start_post_rel_link&#039;, 10, 0 ); // start link
remove_action( &#039;wp_head&#039;, &#039;adjacent_posts_rel_link&#039;, 10, 0 ); // Display relational links for the posts adjacent to the current post.
remove_action( &#039;wp_head&#039;, &#039;wp_generator&#039; ); // Display the XHTML generator that is generated on the wp_head hook, WP version
</pre>
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/1438/wordpress-header/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>More Memory For WordPress &#8211; More Information About WordPress</title>
		<link>http://wpengineer.com/1324/more-memory-for-wordpress-more-information-about-wordpress/</link>
		<comments>http://wpengineer.com/1324/more-memory-for-wordpress-more-information-about-wordpress/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 07:49:26 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress 2.8]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[wp2.8]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=1324</guid>
		<description><![CDATA[WordPress is growing and growing, with the growing of WordPress the demand of memory is also growing. The standard use is WordPress 32MByte (see settings.php ), which is not even provided by every hoster today. This is a problem - therefore: Lovely Hoster, give users more memory! But also to use the memory, it requires [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://wpengineer.com/wp-content/uploads/wp-system-health.png" alt="wp-system-health" title="wp-system-health" width="300" height="200" class="alignright size-full wp-image-1387" /><br />
WordPress is growing and growing, with the growing of WordPress the demand of memory is also growing. The standard use is WordPress 32MByte (see <code> settings.php </code>), which is not even provided by every hoster today. This is a problem - therefore: Lovely Hoster, give users more memory!</p>
<p>But also to use the memory, it requires a small syntax extension in the configuration of WordPress.<br />
<span id="more-1324"></span><br />
To have a quick overview about the demand: Use the Plugin for WordPress <em><a href="http://alexrabe.boelinger.com/2009/06/14/dear-hoster-we-need-more-memory/">WP-Memory-Usage</a></em> by Alex Rabe ...</p>
<p><img src="http://wpengineer.com/wp-content/uploads/memory-overview.png" alt="memory-overview" title="memory-overview" width="417" height="247" class="aligncenter size-full wp-image-1325" /></p>
<p>...  or the more extensive version of an analysis with the Plugin <a href="http://www.code-styling.de/deutsch/wp-system-health-wie-gehts-meinem-wordpress">WordPress System Health</a> by Heiko Rabe.</p>
<h3>More Information</h3>
<p>Thus, it provides the analysis of blogs and a quick way to see the problems at a customers blog or project of your own. This WordPress Plugin <a href="http://www.code-styling.de/deutsch/wp-system-health-wie-gehts-meinem-wordpress">Health System</a> will not only provide information on the status of WordPress, but will also provide information on important configuration settings, supply information on the state of the database and also the tables and information about PHP. In each mode you can add various details, which provide a lot of information to the WordPress experts about the system without the need to investigate the individual Settings, the PHP and the database information.</p>
<h3>More Memory</h3>
<p>It is recommended when working with WordPress to increase memory, as long the <!--<a href="http://www.webhostingsearch.com/">host</a>--> host permits. This requires the expansion of <code>wp-config.php</code>; the best way is to do it in steps in order to check the possibilities of the host.</p>
<pre lang="php">
// more memory
define(&#039;WP_MEMORY_LIMIT&#039;, &#039;64M&#039;);
// even more memory
define(&#039;WP_MEMORY_LIMIT&#039;, &#039;96M&#039;);
// a good deal more memory <img src='http://wpengineer.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />
define(&#039;WP_MEMORY_LIMIT&#039;, &#039;128M&#039;);
</pre>
<p>Will you get a white page as return, then it was too much and it goes back down to 32 MByte. Good luck.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/1324/more-memory-for-wordpress-more-information-about-wordpress/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Set Meta Links For WordPress Plugins</title>
		<link>http://wpengineer.com/1295/meta-links-for-wordpress-plugins/</link>
		<comments>http://wpengineer.com/1295/meta-links-for-wordpress-plugins/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 13:46:01 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress 2.8]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[wp2.8]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=1295</guid>
		<description><![CDATA[In the past I explained in the article &#8222;How To Improve WordPress Plugins&#8220; , how you can expand Plugins with useful functions and therefore optimize their usage. One of the suggestions was a simple link to the options page of your Plugin. With WordPress 2.8 the Plugin page will be a little bit different and [...]]]></description>
			<content:encoded><![CDATA[<p>In the past I explained in the article &#8222;<a href="http://wpengineer.com/how-to-improve-wordpress-plugins/">How To Improve WordPress Plugins</a>&#8220; , how you can expand Plugins with useful functions and therefore optimize their usage. One of the suggestions was a simple link to the options page of your Plugin.<br />
With WordPress 2.8 the Plugin page will be a little bit different and now there will be a hook, which you can use to enter a link, which is even more convenient.<br />
<span id="more-1295"></span><br />
This tutorial works only in Version 2.8 or higher. For 2.7 you have to use the tutorial of &#8222;<a href="http://wpengineer.com/how-to-improve-wordpress-plugins/">How To Improve WordPress Plugins</a>&#8220; or without further explanation this short snippet.</p>
<pre lang="php">
/**
 * @version WP 2.7
 * Add action link(s) to plugins page
 */
function set_plugin_meta27($links) {

	$plugin = plugin_basename(__FILE__);

	$settings_link = sprintf( &#039;&lt;a href=&quot;options-general.php?page=%s&quot;&gt;%s&lt;/a&gt;&#039;, $plugin, __(&#039;Settings&#039;) );
	array_unshift( $links, $settings_link );

	return $links;
}

add_filter( &#039;plugin_action_links_&#039; . $plugin, &#039;set_plugin_meta27&#039; );
</pre>
<p>Since version 2.8 the backend is a little bit different, also the meta links to Plugins are displayed differently from now on, which you can use as you can see on this screenshot.</p>
<p><a href="http://wpengineer.com/wp-content/uploads/28_plugin_meta_link.png"><img src="http://wpengineer.com/wp-content/uploads/28_plugin_meta_link-299x221.png" alt="28_plugin_meta_link" title="28_plugin_meta_link" width="299" height="221" class="aligncenter size-medium wp-image-1296" /></a></p>
<p>You can use following code to set the link to your options page. You can use the term &#8222;Settings&#8220; , so you don't have to take care about other languages, since it is already in the respective language package included. The word will be adjust automatically to the according language.</p>
<pre lang="php">
function set_plugin_meta($links, $file) {

	$plugin = plugin_basename(__FILE__);

	// create link
	if ($file == $plugin) {
		return array_merge(
			$links,
			array( sprintf( &#039;&lt;a href=&quot;options-general.php?page=%s&quot;&gt;%s&lt;/a&gt;&#039;, $plugin, __(&#039;Settings&#039;) ) )
		);
	}

	return $links;
}

add_filter( &#039;plugin_row_meta&#039;, &#039;set_plugin_meta&#039;, 10, 2 );
</pre>
<p>Alternativ you can use the follow functions to link before other links on the plugin page.</p>
<pre lang="php">
// plugin definitions
define( &#039;FB_BASENAME&#039;, plugin_basename( __FILE__ ) );
define( &#039;FB_BASEFOLDER&#039;, plugin_basename( dirname( __FILE__ ) ) );
define( &#039;FB_FILENAME&#039;, str_replace( FB_BASEFOLDER.&#039;/&#039;, &#039;&#039;, plugin_basename(__FILE__) ) );

function filter_plugin_meta($links, $file) {

	/* create link */
	if ( $file == FB_BASENAME ) {
		array_unshift(
			$links,
			sprintf( &#039;&lt;a href=&quot;options-general.php?page=%s&quot;&gt;%s&lt;/a&gt;&#039;, FB_FILENAME, __(&#039;Settings&#039;) )
		);
	}

	return $links;
}

global $wp_version;
if ( version_compare( $wp_version, &#039;2.8alpha&#039;, &#039;&gt;&#039; ) )
	add_filter( &#039;plugin_row_meta&#039;, &#039;filter_plugin_meta&#039;, 10, 2 ); // only 2.8 and higher
add_filter( &#039;plugin_action_links&#039;, &#039;filter_plugin_meta&#039;, 10, 2 );
</pre>
<p>This little hack is easy to do but has a significant value for the user, since it's easy to get to the options page. It's just sad, that the developer of WordPress always changing the hook, so you have to adjust it after every new version. Hope that won't happen again in the near future.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/1295/meta-links-for-wordpress-plugins/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WordPress Proxysupport</title>
		<link>http://wpengineer.com/1227/wordpress-proxysupport/</link>
		<comments>http://wpengineer.com/1227/wordpress-proxysupport/#comments</comments>
		<pubDate>Fri, 15 May 2009 10:58:13 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[Constants]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress 2.8]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[wp2.8]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=1227</guid>
		<description><![CDATA[Who is using WordPress in an intranet environment, will quickly realize, that despite internet connection, no feed content gets loaded in the backend. In general, it's because of the proxy of the company. So far WordPress wasn't particularly flexible in this case. As of WordPress 2.8 that will change and new constants make ensure that [...]]]></description>
			<content:encoded><![CDATA[<p>Who is using WordPress in an intranet environment, will quickly realize, that despite internet connection, no feed content gets loaded in the backend. In general, it's because of the proxy of the company. So far WordPress wasn't particularly flexible in this case. As of WordPress 2.8 that will change and new constants make ensure that you now can enter the proxy directly to <code>wp-config.php</code>.<br />
<span id="more-1227"></span></p>
<h3>Until WordPress 2.7</h3>
<p>Up to this version of WordPress it works only with an adjustment in the core, in <code>wp-includes/class-snoopy.php</code>. Here you have to change the settings of <code>$proxy_host</code>, <code>$proxy_port</code> and <code>$_isproxy</code>. The value of var <code>$_isproxy = false;</code> will of course have <code>TRUE</code> as value.</p>
<pre lang="php">
var $host       = &quot;www.php.net&quot;; // host name we are connecting to
var $port       = 8080; // port we are connecting to
var $proxy_host = &quot;&quot;; // proxy host to use
var $proxy_port = &quot;&quot;; // proxy port to use
var $proxy_user = &quot;&quot;; // proxy user to use
var $proxy_pass = &quot;&quot;; // proxy password to use
var $_isproxy   = true; // set if using a proxy server
</pre>
<h3>WordPress 2.8</h3>
<p>With the new version it is much easier, because no more intrusion into the core files is necessary and the possibility to define the values in the configuration file <code>wp-config.php</code>.</p>
<pre lang="php">
define(&#039;WP_PROXY_HOST&#039;, &#039;192.168.84.101&#039;);
define(&#039;WP_PROXY_PORT&#039;, &#039;8080&#039;);
define(&#039;WP_PROXY_USERNAME&#039;, &#039;my_user_name&#039;);
define(&#039;WP_PROXY_PASSWORD&#039;, &#039;my_password&#039;);
define(&#039;WP_PROXY_BYPASS_HOSTS&#039;, &#039;localhost, www.example.com&#039;);
</pre>
<p>Various references are also in<a href="http://core.trac.wordpress.org/ticket/4011">Ticket 4011</a>.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/1227/wordpress-proxysupport/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>WordPress 2.8 Feature Password</title>
		<link>http://wpengineer.com/1211/wordpress-28-feature-password/</link>
		<comments>http://wpengineer.com/1211/wordpress-28-feature-password/#comments</comments>
		<pubDate>Tue, 05 May 2009 21:14:16 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress News]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress 2.8]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[wp2.8]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=1211</guid>
		<description><![CDATA[WordPress 2.8 is going to be published soon, even though they do not have a date yet. Nevertheless, another small insight into a new feature. After a new installation of WordPress, you get informed that you are logged in with the default password and this can be a security risk. It is therefore strongly recommended [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress 2.8 is going to be published soon, even though they do not have a date yet. Nevertheless, another small insight into a new feature. After a new installation of WordPress, you get informed that you are logged in with the default password and this can be a <a href="http://perishablepress.com/press/2009/05/05/important-security-fix-for-wordpress/">security risk</a>. It is therefore strongly recommended to change the password. The necessary internal links to set a new password are included in this notice.</p>
<p><a href="http://wpengineer.com/wp-content/uploads/wp28_passwort.png"><img src="http://wpengineer.com/wp-content/uploads/wp28_passwort-300x47.png" alt="wp28_passwort" title="wp28_passwort" width="300" height="47" class="aligncenter size-medium wp-image-1210" /></a><br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/1211/wordpress-28-feature-password/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bye Bye my-hacks.php?</title>
		<link>http://wpengineer.com/1164/my-hacksphp/</link>
		<comments>http://wpengineer.com/1164/my-hacksphp/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 10:44:00 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[wp2.8]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=1164</guid>
		<description><![CDATA[Soon the new 2.8 version of WordPress will be released, but the hype is not as much as it was some years ago, when version 2.0 was released for example. But the new version brings many new things, fixes a large number of problems and WordPress is in my view, more open than in the [...]]]></description>
			<content:encoded><![CDATA[<p>Soon the new 2.8 version of WordPress will be released, but the hype is not as much as it was some years ago, when version 2.0 was released for example.</p>
<p>But the new<a href="http://codex.wordpress.org/Version_2.8">  version brings many new things</a>, fixes a large number of problems and WordPress is in my view, more open than in the prior versions. One of the points that users should be aware of is the fact that the option for the support of the <code>my-hacks.php </code> removed. <a href="http://wordpress.org/development/2003/12/new-feature-my-hacksphp/"> 2003 </a> this file was announced as a feature, and now it's going to be removed silently. WordPress has a sophisticated interface system, you can start at various points and bring in new functionality, so that the developer team decided that there is no longer need to support this solution. Alternatives and possibilities of further usage will briefly shown here.</p>
<p><span id="more-1164"></span></p>
<h3>Further usage of my-hacks.php</h3>
<p>The file with its own extensions can still be used in 2.8, it only can't be enabled via option in the backend anymore. If you want to do this, you have to set the entry <code> hack_file </code> in the table <em> options </em> on <em>1</em>.<br />
This is done either directly in the database, for example through phpMyAdmin, or via code:</p>
<pre lang="php">
update_option( &#039;hack_file&#039;, 1 );
</pre>
<p>Alternatively you can get the option via a Plugin back into the backend, see <a href="http://schnurpsel.de/das-ende-der-wordpress-hacker-145/">Post and Plugin download </a> at Schurpsel.</p>
<p>The query of the file remains in the core and should remain so, also the query of the fields in the database should remain.</p>
<pre lang="php">
// Check for hacks file if the option is enabled
if ( get_option(&#039;hack_file&#039;) ) {
	if ( file_exists(ABSPATH . &#039;my-hacks.php&#039;) )
		require(ABSPATH . &#039;my-hacks.php&#039;);
}
</pre>
<p>To keep everything as it was, store the file in the root (<code>ABSPATH</code>) of the installation.</p>
<p>The idea to no longer support is obviously connected with considerations and because WordPress offers excellent interfaces. In addition, the file got pulled early and was therefore not always a clean solution as you know of other interfaces. A test for intolerance and problems is not possible and the file can also slow down the system.</p>
<h3>Via Plugin</h3>
<p>One of the interfaces is the Plugin interface, and therefore lends itself to that, to create a Plugin, to do small hacks. Either you learn how to do this, for example in my small tutorial how to write a Plugin or you use this template.</p>
<p>Just create a PHP file and insert the following syntax, then create your own hacks and copy the file in the Plugin directory. You only have to activate it in your backend.</p>
<pre lang="php">
&lt;?php
/*
Plugin Name: my-hacks.php
Plugin URI: http://
Description: my-hacks.php - replacement since WordPress 2.8
Author: DU
Version: 0.1
Author URI: http://
*/

/**
 * put your hacks here
 */

?&gt;
</pre>
<h3>Theme functions</h3>
<p>The active theme can always bring their own functions, therefore it uses the file <code> functions.php </code> which can be added to each theme. The idea is to explicitly provide new functions for each theme. Therefore, you can store there your hacks, just write it in your <code> functions.php </code> of your theme, upload to the theme folder and you're done.</p>
<h3>Alternative language folder</h3>
<p>A third possibility to carry out their own functions is the language folder, the default is the <code> /wp-content/languages/ </code>; <code> wp-content </code> can be moved and renamed since version 2.5. If a language key is set in the <code> wp-config.php </code>, for example, en_US, then WordPress looks for a language file <code>.mo </code> - and a <code>.php</code> file and if exist, it will be used.</p>
<pre lang="php">
define (&#039;WPLANG&#039;, &#039;de_DE&#039;);
</pre>
<pre lang="php">
/**
 * The locale of the blog
 * @since 1.5.0
 */
$locale = get_locale();
$locale_file = WP_LANG_DIR . &quot;/$locale.php&quot;;
if ( is_readable($locale_file) )
	require_once($locale_file);

/**
 * Loads the theme&#039;s translated strings.
 *
 * If the current locale exists as a .mo file in the theme&#039;s root directory, it
 * will be included in the translated strings by the $domain.
 *
 * The .mo files must be named based on the locale exactly.
 *
 * @since 1.5.0
 *
 * @param string $domain Unique identifier for retrieving translated strings
 */
function load_theme_textdomain($domain, $path = false) {
	$locale = get_locale();

	$path = ( empty( $path ) ) ? get_template_directory() : $path;

	$mofile = &quot;$path/$locale.mo&quot;;
	load_textdomain($domain, $mofile);
}
</pre>
<p>This should of course only be used for hacks and features, which has something to do with the language of the blog. Basically, you can also put functions there. This possibility is especially well suited to create language typical functions, such for a clean use of URLs in Permalinks (instead of u for ue ü etc.).<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/1164/my-hacksphp/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WordPress Plugin-Path</title>
		<link>http://wpengineer.com/1134/wordpress-plugin-path/</link>
		<comments>http://wpengineer.com/1134/wordpress-plugin-path/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 13:26:26 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress 2.8]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[wp2.7]]></category>
		<category><![CDATA[wp2.8]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=1134</guid>
		<description><![CDATA[When working on a Plugin I noticed that the path to its files is not always complete, which depends on the WordPress version. With WordPress Version 2.8 the function plugins_url() extends and it can be incorporate in a much cleaner way, no maintenance of the folder required, where the Plugin is put. An example will [...]]]></description>
			<content:encoded><![CDATA[<p>When working on a Plugin I noticed that the path to its files is not always complete, which depends on the WordPress version.<br />
With WordPress <strong>Version 2.8</strong> the function <code>plugins_url()</code> extends and it can be incorporate in a much cleaner way, no maintenance of the folder required, where the Plugin is put. An example will illustrate it and possibly will help the one or other author at his work.<br />
<span id="more-1134"></span><br />
In the articles &#8222;<a href="http://wpengineer.com/use-javascript-libraries-in-and-of-wordpress/">Use JavaScript Libraries In And Of WordPress</a>&#8220;, &#8222;<a href="http://wpengineer.com/top-level-menu-in-wordpress-27/">Top Level Menu In WordPress 2.7</a>&#8220; and &#8222;<a href="http://wpengineer.com/wordpress-return-url/">WordPress - Return URL</a>&#8220; I often have the function <code>plugins_url()</code>, because it delivers very nice the path.</p>
<p>As of WordPress version 2.8 the function can take two parameters:</p>
<pre lang="php">
/**
 * @param string $path Optional. Path relative to the plugins url.
 * @param string $plugin Optional. The plugin file that you want to be relative to - i.e. pass in __FILE__
 * @return string Plugins url link with optional path appended.
*/
function plugins_url($path = &#039;&#039;, $plugin = &#039;&#039;)
</pre>
<p>So far only the $ path parameter could be passed, so that required a proper definition of the folder.</p>
<pre lang="php">
$style = plugins_url( &#039;my_plugin_folder/css/style-frontend.css&#039; );
</pre>
<p>With the extension in version 2.8 of WordPress it can be done like:</p>
<pre lang="php">
$style = plugins_url( &#039;css/style-frontend.css&#039;, __FILE__ );
</pre>
<p>The use should make it simpler and clearer. But the question will come up, how do I do backwards compatibility of the plugin? You can either use the version query:</p>
<pre lang="php">
if ( version_compare( $wp_version, &#039;2.8dev&#039;, &#039;&gt;&#039; ) )
</pre>
<p>and then supplement or write a custom function for the replacement:</p>
<pre lang="php">
// function for WP &lt; 2.8
function plugins_url($path = &#039;&#039;, $plugin = &#039;&#039;) {
  if ( function_exists(&#039;is_ssl&#039;) )
    $scheme = ( is_ssl() ? &#039;https&#039; : &#039;http&#039; );
  else
    $scheme = &#039;http&#039;;
  $url = WP_PLUGIN_URL;
  if ( 0 === strpos($url, &#039;http&#039;) ) {
    if ( function_exists(&#039;is_ssl&#039;) &amp;&amp; is_ssl() )
      $url = str_replace( &#039;http://&#039;, &quot;{$scheme}://&quot;, $url );
  }

  if ( !empty($plugin) &amp;&amp; is_string($plugin) )
  {
    $folder = dirname(plugin_basename($plugin));
    if (&#039;.&#039; != $folder)
      $url .= &#039;/&#039; . ltrim($folder, &#039;/&#039;);
  }

  if ( !empty($path) &amp;&amp; is_string($path) &amp;&amp; strpos($path, &#039;..&#039;) === false )
    $url .= &#039;/&#039; . ltrim($path, &#039;/&#039;);

  return apply_filters(&#039;plugins_url&#039;, $url, $path, $plugin);
}
</pre>
<p>This is only an alternative, the possibilities are endless - maybe one or the other has a beautiful idea and solution?<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/1134/wordpress-plugin-path/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Change Admin Pagination on Posts, Pages and Comments</title>
		<link>http://wpengineer.com/1030/change-admin-pagination-on-posts-pages-and-comments/</link>
		<comments>http://wpengineer.com/1030/change-admin-pagination-on-posts-pages-and-comments/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 10:53:39 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[Admin]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[wp2.8]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=1030</guid>
		<description><![CDATA[One or the other users in the backend of WordPress find it quite disturbing that not more than 20 articles, pages and comments per page gets listed. Especially if you work with many tables and you have a fast connection, then an increased number of listed articles, pages, comments is useful. How to adapt and [...]]]></description>
			<content:encoded><![CDATA[<p>One or the other users in the backend of WordPress find it quite disturbing that not more than 20 articles, pages and comments per page gets listed. Especially if you work with many tables and you have a fast connection, then an increased number of listed articles, pages, comments is useful. How to adapt and with a little CSS getting the best presentation I will show now, here are some tips.<br />
<span id="more-1030"></span></p>
<h3>As of WordPress version 2.8</h3>
<p>With WordPress 2.8 comes a new value in the user's options for each page in the backend. This allows each user to extend the number of listed pages, articles and comments per page. If you like to solve it also in advance of WordPress 2.8, then the following syntax helps.</p>
<p><img src="http://wpengineer.com/wp-content/uploads/posts_per_page.png" alt="posts_per_page" title="posts_per_page" width="371" height="186" class="aligncenter size-full wp-image-1031" /></p>
<h3>Alternative Plugin</h3>
<p>You should embed the syntax in a Plugin.<br />
I am purposely not providing a Plugin, because the support of my existing solutions is already overwhelming. So it is rather as a basis for people who want to start here and as a memory for me when I need it again.</p>
<p>Some comments I have directly written down in the source code, so it is understandable. Also I do upload a CSS file, the content can be found at the end, which changes the design a little bit and create a better overview of the large number of entries.</p>
<p><img src="http://wpengineer.com/wp-content/uploads/posts_per_page2.png" alt="posts_per_page2" title="posts_per_page2" width="406" height="258" class="aligncenter size-full wp-image-1032" /></p>
<pre lang="php">
// value for posts
define( &#039;FB_CAP_PER_POST&#039;, 100 );
// value for pages
define( &#039;FB_CAP_PER_PAGE&#039;, 100 );
// value for comments
define( &#039;FB_CAP_PER_COMMENT&#039;, 100 );

// only in admin area
if ( is_admin() ) {
	global $pagenow;

	if ( $pagenow == &#039;edit-pages.php&#039; ) {
		add_filter( &#039;manage_pages_query&#039;, &#039;page_ChangeAdminPagination&#039; );
		add_action( &#039;admin_print_styles&#039;, &#039;AddMyStylesheet&#039; );
	}
	if ( $pagenow == &#039;edit.php&#039; ) {
		add_action( &#039;admin_head&#039;, &#039;post_ChangeAdminPagination&#039; );
		add_action( &#039;admin_print_styles&#039;, &#039;AddMyStylesheet&#039; );
	}
	if ( $pagenow == &#039;edit-comments.php&#039; )
		add_filter( &#039;comments_per_page&#039;, &#039;comment_ChangeAdminPagination&#039; );
}

function post_ChangeAdminPagination() {
	global $wp_query;

	if ( $wp_query-&gt;query_vars&#091;s&#093; == &#039;&#039; ) {
		$per_post = (int) FB_CAP_PER_POST;
		$wp_query-&gt;query( &#039;showposts=&#039; . $per_post );
	}
}

function page_ChangeAdminPagination($query) {
	global $per_page;

	$per_page = (int) FB_CAP_PER_PAGE;
	//$query&#091;&#039;posts_per_page&#039;&#093; = $per_page;
	$query&#091;&#039;posts_per_archive_page&#039;&#093; = $per_page;

	return $query;
}

function comment_ChangeAdminPagination($count) {

	$per_comment = (int) FB_CAP_PER_COMMENT;

	return $per_comment;
}

function AddMyStylesheet() {

		$myStyleFile = WP_PLUGIN_URL . &#039;/change_admin_pagination/css/style.css&#039;;
		wp_register_style( &#039;change_admin_pagination&#039;, $myStyleFile );
		wp_enqueue_style( &#039;change_admin_pagination&#039;);
}
</pre>
<p>The following content is intended only to that area for editing the page or next to the entry contribution is shown. Thus, the line is smaller and has more entries available to view.</p>
<pre lang="css">
/**
 * style for smaller tables in admin of WordPress
 * @author Frank Bültge
 * @date 01.04.2009 20:51:59
 */
.post-title strong {
	float: left;
}

.row-actions {
	float: left;
	margin-left: 1% !important;
}

.check-column, tr td {
	padding-bottom: 0 !important;
}

.column-date {
	width: 15% !important;
}

td.date {
	font-size: .6em;
}

td.date abbr {
	float: right;
}
</pre>
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/1030/change-admin-pagination-on-posts-pages-and-comments/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

