<?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>cedmax.net &#187; plugin</title>
	<atom:link href="http://cedmax.net/tag/plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://cedmax.net</link>
	<description>my little journey through myself</description>
	<lastBuildDate>Wed, 18 Jan 2012 22:19:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Add author nicename to post_class()</title>
		<link>http://cedmax.net/development/coding/add-author-nicename-to-post_class.html</link>
		<comments>http://cedmax.net/development/coding/add-author-nicename-to-post_class.html#comments</comments>
		<pubDate>Thu, 10 Dec 2009 17:18:22 +0000</pubDate>
		<dc:creator>cedmax</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://cedmax.net/?p=159</guid>
		<description><![CDATA[<p>So you want to style a post depending on its author?</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p159code1'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1591"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p159code1"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&#60;?php</span>
<span style="color: #666666; font-style: italic;">/*
Plugin Name: Add Author Class
Plugin URI: </span></pre></td></tr></table>&#8230;</div>]]></description>
			<content:encoded><![CDATA[
<p>So you want to style a post depending on its author?</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p159code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1592"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p159code2"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Plugin Name: Add Author Class
Plugin URI: http://cedmax.net
Description: extends post_class() to add author class
Version: 1
Author: cedmax
Author URI: http://cedmax.net
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> add_author_class<span style="color: #009900;">&#40;</span><span style="color: #000088;">$class</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<a href="http://www.php.net/array_push"><span style="color: #990000;">array_push</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$class</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'author-'</span><span style="color: #339933;">.</span>get_the_author_meta<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user_nicename'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$class</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;post_class&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;add_author_class&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>you’re welcome</p>
]]></content:encoded>
			<wfw:commentRss>http://cedmax.net/development/coding/add-author-nicename-to-post_class.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to remove hardcoded text from wordpress themes</title>
		<link>http://cedmax.net/development/coding/how-to-remove-hardcoded-text-from-wordpress-themes.html</link>
		<comments>http://cedmax.net/development/coding/how-to-remove-hardcoded-text-from-wordpress-themes.html#comments</comments>
		<pubDate>Fri, 13 Mar 2009 15:04:45 +0000</pubDate>
		<dc:creator>cedmax</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://cedmax.net/?p=98</guid>
		<description><![CDATA[<p>One of the most awful things I found out in a lot of wordpress themes is the hardcoded text.</p>
<p>I found out that with <a href="http://cdmx.it/w1rwYK">Simple Shortcodes</a> it is possible to centralize in the admin part text content without editing themes.&#8230;</p>]]></description>
			<content:encoded><![CDATA[
<p>One of the most awful things I found out in a lot of wordpress themes is the hardcoded text.</p>
<p>I found out that with <a href="http://cdmx.it/w1rwYK">Simple Shortcodes</a> it is possible to centralize in the admin part text content without editing themes.<br>
download, install and activate it. </p>
<p>Go to the plugin admin page and you can add the content you need to use in your theme <small>(in this case I’m also using qTranslate, that’s why I use &lt;!–:it–&gt; and &lt;!–:en–&gt;)</small></p>
<div class="center"><a href="http://cdmx.it/tD1QGe"><img src="http://dl.dropbox.com/u/1054308/cedmax.net/uploads/2009/03/simpleshortcode-300x120.jpg" alt="simpleshortcode" title="simpleshortcode" width="300" height="120" class="alignnone size-medium wp-image-99"></a></div>
<p>Then in your theme you can write the content of your shortcode simply calling a function named like the shortcode + ‘_shortcode’ for example</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p98code6'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p986"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p98code6"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'collaboration_title_shorcode'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	_e<span style="color: #009900;">&#40;</span>collaboration_title_shorcode<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>This could be surely useful in order to let someone manage site content without giving him permission on theme editor.</p>
<p><strong>EDIT</strong><br>
a step forward:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p98code7'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p987"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code" id="p98code7"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Plugin Name: Labelize Simple Shortcodes
Plugin URI: http://cedmax.net
Description: use simple shortcodes plugin to delete hardcoded text in themes
Version: 1
Author: cedmax
Author URI: http://cedmax.net
*/</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> get_label<span style="color: #009900;">&#40;</span><span style="color: #000088;">$shorcode</span><span style="color: #339933;">,</span> <span style="color: #000088;">$echo</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #000088;">$before</span><span style="color: #339933;">,</span> <span style="color: #000088;">$after</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$myfunc</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$shorcode</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'_shortcode'</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$myfunc</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$myfunc</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$before</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$before</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$after</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$output</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$after</span><span style="color: #339933;">;</span>		
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$echo</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			_e<span style="color: #009900;">&#40;</span><span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">return</span> __<span style="color: #009900;">&#40;</span><span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>a simple plugin, quick and dirty, to be used like this:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p98code8'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p988"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p98code8"><pre class="php" style="font-family:monospace;">get_label<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'collaboration_title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><em>optional parameters</em>:<br><strong>$echo</strong>: use it as boolean (true or false) to have the label printed or returned as php string (default = true)<br><strong>$before</strong>: if you want something before your label (markup for example)<br><strong>$after</strong>: as before, but after the label</p>
<p>hope it could be useful</p>
]]></content:encoded>
			<wfw:commentRss>http://cedmax.net/development/coding/how-to-remove-hardcoded-text-from-wordpress-themes.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

