Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Warning: call_user_func_array() [function.call-user-func-array]
- This topic has 10 replies, 2 voices, and was last updated 13 years, 6 months ago by scotman.
-
AuthorPosts
-
May 14, 2011 at 9:25 am #3408scotmanMember
I thought I had this fixed but for some reason I am getting this error. Here is what I have done so far…
1. I’m trying to create a html sales-page via the directions found here http://www.tipsandtricks-hq.com/how-to-create-and-use-custom-page-template-in-wordpress-to-create-a-sales-page-2095
2. I followed the directions and used the php code found within the tutorial. But it gives me an error at the header and footer area of
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘Array’ was given in /home/nicheweb/public_html/webcontentcourse.com/member/wp-includes/plugin.php on line 395
3. I removed the header and footer, plus content php in the sale-page template. It produces no errors but it doesn’t lock out users when I use the domain level lock feature.
4. I then added the code <?php echo print_eStore_buy_now_button(5); ?> which my product Im trying to sell is id 5. Everything works fine except the domain lock.
5. That had me wondering if other features of wp-estore would not be available after the user bought the product. So I re-added the header and footer code and I’m back where I began Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘Array’ was given in /home/nicheweb/public_html/webcontentcourse.com/member/wp-includes/plugin.php on line 395
My question is the sales page works without the header, content and footer php code in the sale-page.php template and calls correctly when I assign it as a template on the wp-admin page settings. The buy now button even works and redirects me to Paypal but will the rest of the wp-estore functions work after the user makes the purchase without the header, content and footer code removed?
Here is the page with errors… http://webcontentcourse.com/member/seo-revealed/
p.s. I have downloaded the latest releases of wp-estore, affilaite platform and e-member and I’m still getting this error.
May 15, 2011 at 12:22 am #32499amin007ParticipantThe plugins will work on any WordPress post or page that has a valid structure and is part of WordPress. The header call needs to be there for some WordPress plugins that will insert data into the header. So what we need to identify is what causes the error to show up.
Can you please tell me the function calls that you have placed on this custom template file including the header call?
When I go to the page that you mentioned I don’t see any error. I see the eMember login prompt.
May 15, 2011 at 9:21 am #32500scotmanMemberWhat I did was I added in the header and footer code as per your instructions.
‘<?php
error_reporting(0);
/*
Template Name: Sales Page
*/
wp_head();
?>’
‘<?php echo print_eStore_buy_now_button(5); ?>’
‘<?php
/*
Template Name: Sales Page
*/
wp_footer();
?>’
May 15, 2011 at 9:23 am #32501scotmanMemberI forgot to add I added in the error reporting code to silence the error in the meantime.
But that is the code I have added to the php file. And it throws ‘Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘Array’ was given in /home/nicheweb/public_html/webcontentcourse.com/member/wp-includes/plugin.php on line 395′
May 15, 2011 at 9:32 am #32502scotmanMemberAlright I unlocked the domain so we can work on this. Plus I removed the error reporting code.
May 15, 2011 at 11:28 pm #32503amin007ParticipantUnfortunately the warning actually does not tell us which plugin might be causing this so we will need to go the long way to find out which plugin is causing it. Can you please do this test mentioned here to see if you can identify which plugin make the warning go away?
I also noticed you have the following block of code twice in the template. Why is that?
/*
Template Name: Sales Page
*/Also, before you do the test mentioned above get a fresh build of the plugins that you are using from here:
https://support.tipsandtricks-hq.com/update-request
If there is a case of a file getting corrupt then this will take care of it.
May 16, 2011 at 6:07 pm #32504scotmanMemberAlright here is what I did I removed that extra line of duplicate code.
I then deactivated all my plugins and still the same problem.
I then activated the default wordpress theme and the error went away.
The theme I have installed is call Platform Pro by Pagelines that uses a child theme to make changes to the theme. It makes it a cinch to upgrade the theme without over writing your changes.
So this is defiantly theme related. How do I get this to work seeings how I am using a child theme in WordPress?
May 17, 2011 at 1:15 am #32505amin007ParticipantI don’t have a solution for this theme… we can only fix things if the issue is in our plugin’s code. You will have to contact your theme developer for that.
May 17, 2011 at 10:51 pm #32506scotmanMemberThanks amin007 I contacted Pagelines about this.
You know I was thinking, I know it is not a good idea to silence warnings! But in this case the php code to purchase the product works and sends the visitor to paypal to purchase. I know you wouldn’t probably recommend it but do you think I will be just fine with silencing this and moving on. Will the rest of the wp e-store plugin features work like notifying wordpress their was a purchase and sending them the download link? Or will I have to test it and see?
May 18, 2011 at 12:13 am #32507amin007ParticipantYeah you can silence warning as long as the buttons are working on this page. What happens after the payment cannot be affected by this page so it is safe.
May 18, 2011 at 6:31 am #32508scotmanMemberThanks amin007 really appreciate all your help..this topic is resolved!
-
AuthorPosts
- You must be logged in to reply to this topic.