<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Fun with WordPress - Latest Comments in Using Objects for Wordpress plugins</title><link>http://funwithwordpress.disqus.com/</link><description></description><language>en</language><lastBuildDate>Wed, 14 Nov 2007 01:17:42 -0000</lastBuildDate><item><title>Re: Using Objects for Wordpress plugins</title><link>http://www.wp-fun.co.uk/2007/11/08/using-objects-for-wordpress-plugins/#comment-3024491</link><description>Nice article. I myself also use a objects for my WP plugins. The only difference is that I kickstart them in a more spartan way - just calling something like this:&lt;br&gt;&lt;br&gt;&lt;br&gt;Class wp_something {&lt;br&gt;...&lt;br&gt;}&lt;br&gt;new wp_something;&lt;br&gt;&lt;br&gt;&lt;br&gt;because, actually, I only need to run the constructor of the class - I do not need a variable storing the created object ;)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kaloyan K. Tsvetkov</dc:creator><pubDate>Wed, 14 Nov 2007 01:17:42 -0000</pubDate></item><item><title>Re: Using Objects for Wordpress plugins</title><link>http://www.wp-fun.co.uk/2007/11/08/using-objects-for-wordpress-plugins/#comment-3024490</link><description>Oops, in all the time I've been using WordPress I hadn't noticed. Thanks John.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">arickmann</dc:creator><pubDate>Sat, 10 Nov 2007 03:10:38 -0000</pubDate></item><item><title>Re: Using Objects for Wordpress plugins</title><link>http://www.wp-fun.co.uk/2007/11/08/using-objects-for-wordpress-plugins/#comment-3024489</link><description>Andrew, I know I should be worrying about more pressing issues, but you know it's WordPress (with a capital P) and not Wordpress don't you?&lt;br&gt;&lt;br&gt;That caveat aside, this is a nice little site you've got here. I'll subscribe once you change the title ;-)&lt;br&gt;&lt;br&gt;Keep up the good work.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">johnbillion</dc:creator><pubDate>Fri, 09 Nov 2007 21:41:45 -0000</pubDate></item><item><title>Re: Using Objects for Wordpress plugins</title><link>http://www.wp-fun.co.uk/2007/11/08/using-objects-for-wordpress-plugins/#comment-3024488</link><description>Fullo, I did know about the PHP 5 fallback which is why I felt secure in using it; however, it is something that needs to be considered as PHP 6 won't have it any more.&lt;br&gt;&lt;br&gt;I guess it really is a case of deciding how long the plugin is likely to be around, and whether you want to support it later in its life to upgrade to PHP 6. &lt;br&gt;&lt;br&gt;Having said that many hosts are only now getting up to PHP 5. If PHP 6 won't be backward compatible then I guess you need to wonder how long it will really be until PHP 6 is offered. We could be facing up to 5 years before it becomes well supported.&lt;br&gt;&lt;br&gt;That's a long time for a plugin.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">arickmann</dc:creator><pubDate>Fri, 09 Nov 2007 14:55:46 -0000</pubDate></item><item><title>Re: Using Objects for Wordpress plugins</title><link>http://www.wp-fun.co.uk/2007/11/08/using-objects-for-wordpress-plugins/#comment-3024487</link><description>as I know call_user_function_array can be used to call statically  an object method. &lt;br&gt;&lt;br&gt;But I don't know if there are some valid reasons to not use __contruct($args) { $this-&amp;gt;myClass($args) ); as you suggest.&lt;br&gt;&lt;br&gt;Btw, I've studied a little more and I've discovered that &lt;blockquote&gt;"To ease the transition from PHP 4, if PHP 5 cannot find a method names __construct() within your object hierarchy, it revers to the PHP 4 constructor naming scheme and searches accordingly" (from "Upgrading to PHP5" Adam&lt;br&gt;Trachtenberg (O'Reilly))&lt;/blockquote&gt;&lt;br&gt;&lt;br&gt;however, IMHO, this should not be used. Especially if you work with object that extends other object. Because it should be very easy to break your code simply changing the name of the parent class [parent::MyParent ==&amp;gt; parent::NewParentName ].</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">fullo</dc:creator><pubDate>Fri, 09 Nov 2007 10:58:04 -0000</pubDate></item><item><title>Re: Using Objects for Wordpress plugins</title><link>http://www.wp-fun.co.uk/2007/11/08/using-objects-for-wordpress-plugins/#comment-3024486</link><description>Thanks Fullo. I did consider doing something like this but my desire to simplify often gets the better of me.&lt;br&gt;&lt;br&gt;Is there a benefit to using call_user_function over simply calling myClass from within the __construct method?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">arickmann</dc:creator><pubDate>Fri, 09 Nov 2007 04:14:20 -0000</pubDate></item><item><title>Re: Using Objects for Wordpress plugins</title><link>http://www.wp-fun.co.uk/2007/11/08/using-objects-for-wordpress-plugins/#comment-3024485</link><description>nice tutorial, but instead of use a php4-only object you should create a php5, or crosscompatible, object.&lt;br&gt;&lt;br&gt;ie.&lt;br&gt;class myClass(){&lt;br&gt; &lt;br&gt;    function __construct(){&lt;br&gt;        // do something&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    function myClass($args){&lt;br&gt;        //php 4 compliant fake constructor&lt;br&gt;        $args = func_get_args();&lt;br&gt;        call_user_func_array(array(&amp;amp;$this, '__construct'), $args);&lt;br&gt; &lt;br&gt;    }</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">fullo</dc:creator><pubDate>Fri, 09 Nov 2007 03:47:42 -0000</pubDate></item></channel></rss>