Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 19 Jul 2016, 01:23
talhatc talhatc is offline
 
Join Date: Jul 2016
Vb Api Extension returns data and shows always after <body>

I am creating a Api Extension with the help of Wordpress Header & Footer Integation

I am almost done and everything seems to be in order except, whenever I return a data, it always goes on the top of the browser, after the <body> tag, example given below:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

header-forums.php file simply contains an echo statement. VB displays it, but shows it on the top, even above the main-navbar-wrapper. However, the weird part is, if I do the following, it shows where the hook is supposed to show it


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Any help would be highly appreciated.
Reply With Quote
  #2  
Old 19 Jul 2016, 02:11
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
The echo statement is the problem. VB wants to display the returned data. Assign your data to a variable and return the variable.

$data = '<h1>My Custom Footer</h1>';
return $data;
__________________
VB5 mods - RepliClock VB4 mods - Member Online Status
Reply With Quote
  #3  
Old 19 Jul 2016, 11:12
talhatc talhatc is offline
 
Join Date: Jul 2016
Originally Posted by Replicant View Post
The echo statement is the problem. VB wants to display the returned data. Assign your data to a variable and return the variable.

$data = '<h1>My Custom Footer</h1>';
return $data;
Well the issue isn't with the second piece of code from my post, outputting the following is causing the issue


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #4  
Old 19 Jul 2016, 14:03
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
Using an echo will show at the top of the page like a debug marker. You need to remove the echo.

in your snippet, you're doing "return;"

You need to put the data in a variable and "return $data;"
__________________
VB5 mods - RepliClock VB4 mods - Member Online Status
Reply With Quote
Reply


Tags
api extension, footer, header, vb5, wordpress


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 23:46.

Layout Options | Width: Wide Color: