Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Difference in custom content output v1.5.4 versus v1.6.2

+1 vote
asked Oct 14, 2013 in Plugins by q2apro
Just realized by transferring some plugins to the latest q2a version 1.6.2 that the custom output is handled differently now.

Before we had to define:

$c = 2;
$qa_content['custom'.++$c]='<p>my output</p>";
$qa_content['custom'.++$c]='<p>my output II</p>";

which gave a clean output in 1.5.4:

<p>my output</p> <p>my output II</p>

Now in v1.6.2 I get this instead:

<div class="qa-part-custom3">
   <p>my output</p>

<div class="qa-part-custom4">
   <p>my output II</p>

Why was that changed? That could corrupt a lot of plugins I assume.
Q2A version: 1.6.2
commented Oct 14, 2013 by q2apro
*** How can we output now the content without these extra classes??

2 Answers

+1 vote
answered Oct 14, 2013 by jatin.soni

Yes you are right.. I had problem with lot of custom plugin I have done for clients.

Only simple different is you can do is just concatenate the previous $content variable using .=

So the code witll be in this way

$qa_content['custom']  = 'your first line'; //usually very first string or empty

$qa_content['custom'].='<p>my output</p>";

$qa_content['custom'].='<p>my output II</p>";

commented Oct 16, 2013 by jatin.soni
Thanks Kai you found the reason.. I

In fact I have already requested here to remove wrapper for custom content. I found it is useless since developer most of the time adds own wrapper.
commented Oct 16, 2013 by q2apro
absolutely right, nice that we think the same here :)
0 votes
answered Oct 15, 2013 by q2apro

I am sad to say that but I did a core hack to solve this problem, it is a one liner (I know I could override function main_part() but I don't see the point in adding 50 lines to my theme file when I can remove 1 line in the core...

qa-theme-base.php remove line 733: (strpos($key, 'custom')===0) ||

Now my plugins work again!