<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									wpForoMember::profile_url() is called too early in class-members.php:1175 - Bug Reports - wpForo 2.0				            </title>
            <link>https://wpforo.com/community/general-forums-bug-reports/wpforomemberprofile_url-is-called-too-early-in-class-members-php1175/</link>
            <description>Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Thu, 08 Oct 2026 07:33:25 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: wpForoMember::profile_url() is called too early in class-members.php:1175</title>
                        <link>https://wpforo.com/community/general-forums-bug-reports/wpforomemberprofile_url-is-called-too-early-in-class-members-php1175/#post-46643</link>
                        <pubDate>Thu, 08 Oct 2020 09:16:43 +0000</pubDate>
                        <description><![CDATA[@mrwhisk,
We will check it and if it possible we will try to implement it.]]></description>
                        <content:encoded><![CDATA[<p>@mrwhisk,</p>
<p>We will check it and if it <span>possible we will try to implement it.</span></p>]]></content:encoded>
						                            <category domain="https://wpforo.com/community/general-forums-bug-reports/">Bug Reports - wpForo 2.0</category>                        <dc:creator>Alvina</dc:creator>
                        <guid isPermaLink="true">https://wpforo.com/community/general-forums-bug-reports/wpforomemberprofile_url-is-called-too-early-in-class-members-php1175/#post-46643</guid>
                    </item>
				                    <item>
                        <title>RE: wpForoMember::profile_url() is called too early in class-members.php:1175</title>
                        <link>https://wpforo.com/community/general-forums-bug-reports/wpforomemberprofile_url-is-called-too-early-in-class-members-php1175/#post-46545</link>
                        <pubDate>Mon, 05 Oct 2020 16:49:07 +0000</pubDate>
                        <description><![CDATA[Hi There,Thankyou for the reply. Absolutely, I agree that initializing the wpForoMember object on the set_current_user hook is indeed the correct behavior.
To be clear, the issue here is th...]]></description>
                        <content:encoded><![CDATA[<p>Hi There,<br /><br />Thankyou for the reply. Absolutely, I agree that initializing the <span><span style="color: #800080"><strong>wpForoMember</strong> </span>object on the <span style="color: #008000"><strong>set_current_user</strong> </span>hook is indeed the correct behavior.</span></p>
<p>To be clear, the issue here is that <span><span style="color: #800080"><strong>wpForoMember</strong> </span>fetches a value for <span style="color: #800080"><strong>$member</strong></span> on initialization. Wouldn't it make much more sense to defer setting this value until (at least) wordpress has finished loading?</span></p>
<p>Whilst we can indeed avoid the critical errors with <span style="color: #008000"><strong>functions_exist()</strong></span> calls etc, we then run the risk of <span><span style="color: #800080"><strong>$member</strong></span> containing an erroneous value. FYI, our goal here is to have total control of <span style="color: #800080"><strong>$member </strong></span>using the hook <span style="color: #800080"><strong>wpforo_member_profile_url</strong></span>.</span></p>
<p>Does that make sense?</p>
<p>Thanks again :)</p>]]></content:encoded>
						                            <category domain="https://wpforo.com/community/general-forums-bug-reports/">Bug Reports - wpForo 2.0</category>                        <dc:creator>mrwhisk</dc:creator>
                        <guid isPermaLink="true">https://wpforo.com/community/general-forums-bug-reports/wpforomemberprofile_url-is-called-too-early-in-class-members-php1175/#post-46545</guid>
                    </item>
				                    <item>
                        <title>RE: wpForoMember::profile_url() is called too early in class-members.php:1175</title>
                        <link>https://wpforo.com/community/general-forums-bug-reports/wpforomemberprofile_url-is-called-too-early-in-class-members-php1175/#post-46523</link>
                        <pubDate>Mon, 05 Oct 2020 10:19:11 +0000</pubDate>
                        <description><![CDATA[Hi @mrwhisk,
Please note the wpForo connects to the correct hook set_current_user. And each time when in the new user set in WordPress, we change the current user values we have with the ne...]]></description>
                        <content:encoded><![CDATA[<p>Hi <span>@mrwhisk,</span></p>
<p>Please note the wpForo connects to the correct hook set_current_user. And each time when in the new user set in WordPress, we change the current user values we have with the new user's values. This is the right way and to refuse it is wrong. </p>
<blockquote>
<p><span>The issue here is that the 'set_current_user' action fires </span><strong>before </strong><span>'init'. As a result, using core wp functions when filtering with 'wpforo_member_profile_url' causes critical exceptions. For example, calling get_author_posts_url yields:</span></p>
</blockquote>
<p>The problem is in that most of WordPress plugins and themes can call the <span><strong>set_current_user</strong> hook, before the init hook is called, and there is no way to avoid that. You just need to check if the <strong>set_current_user</strong> hook exis using the following functions, to avoid the fatal errors:</span></p>
<p><span>function_exists()</span></p>
<p><span>is_null()</span></p>
<p><span>method exists()</span></p>]]></content:encoded>
						                            <category domain="https://wpforo.com/community/general-forums-bug-reports/">Bug Reports - wpForo 2.0</category>                        <dc:creator>Alvina</dc:creator>
                        <guid isPermaLink="true">https://wpforo.com/community/general-forums-bug-reports/wpforomemberprofile_url-is-called-too-early-in-class-members-php1175/#post-46523</guid>
                    </item>
				                    <item>
                        <title>RE: wpForoMember::profile_url() is called too early in class-members.php:1175</title>
                        <link>https://wpforo.com/community/general-forums-bug-reports/wpforomemberprofile_url-is-called-too-early-in-class-members-php1175/#post-46480</link>
                        <pubDate>Sat, 03 Oct 2020 12:13:14 +0000</pubDate>
                        <description><![CDATA[Hi @mrwhisk,
I&#039;ve just asked our developers about it and currently, I&#039;m waiting for the response from them. I&#039;ll update the topic one I get some response from them.]]></description>
                        <content:encoded><![CDATA[<p>Hi <span>@mrwhisk,</span></p>
<p><span style="font-weight: 400">I've just asked our developers about it and currently, I'm waiting for the response from them. I'll update the topic one I get some response from them.</span></p>]]></content:encoded>
						                            <category domain="https://wpforo.com/community/general-forums-bug-reports/">Bug Reports - wpForo 2.0</category>                        <dc:creator>Alvina</dc:creator>
                        <guid isPermaLink="true">https://wpforo.com/community/general-forums-bug-reports/wpforomemberprofile_url-is-called-too-early-in-class-members-php1175/#post-46480</guid>
                    </item>
				                    <item>
                        <title>wpForoMember::profile_url() is called too early in class-members.php:1175</title>
                        <link>https://wpforo.com/community/general-forums-bug-reports/wpforomemberprofile_url-is-called-too-early-in-class-members-php1175/#post-46470</link>
                        <pubDate>Fri, 02 Oct 2020 23:36:02 +0000</pubDate>
                        <description><![CDATA[Hello,
It is not possible to use the filter &#039;wpforo_member_profile_url&#039; correctly due to the way that wpForoMember is written. Trace:
(71) wpForoMember::__construct() calls init_current_us...]]></description>
                        <content:encoded><![CDATA[<p>Hello,</p>
<p>It is not possible to use the filter 'wpforo_member_profile_url' correctly due to the way that wpForoMember is written. Trace:</p>
<pre>(71) wpForoMember::__construct() calls init_current_user on action 'set_current_user'. <br /><br />(1900) wpForoMember::init_current_user() calls wpForoMember::get_member() <br /><br />(1175) wpForoMember::get_member() calls wpForoMember::profile_url()</pre>
<p>The issue here is that the 'set_current_user' action fires <strong>before </strong>'init'. As a result, using core wp functions when filtering with 'wpforo_member_profile_url' causes critical exceptions. For example, calling get_author_posts_url yields:</p>
<pre>PHP Fatal error: Uncaught Error: Call to a member function get_author_permastruct() on null</pre>
<p>---</p>
<p>A simple fix would be to defer getting an actual value for $member until at the <strong>earliest </strong>'init'.</p>
<p>Fixing this issue would be most appreciated to avoid me having to fork wpforo.</p>
<p>With thanks,<br /><br />Dr Teapot.</p>]]></content:encoded>
						                            <category domain="https://wpforo.com/community/general-forums-bug-reports/">Bug Reports - wpForo 2.0</category>                        <dc:creator>mrwhisk</dc:creator>
                        <guid isPermaLink="true">https://wpforo.com/community/general-forums-bug-reports/wpforomemberprofile_url-is-called-too-early-in-class-members-php1175/#post-46470</guid>
                    </item>
							        </channel>
        </rss>
		