dan.imbrogno
Forum Replies Created
-
Forum: Plugins
In reply to: [Gravity Forms + Stripe] Trouble creating Strip feedHad the same issue, it seems like the table upgrade function isn’t updating a field. My best guess is that the dbdelta function isn’t able to swap primary keys. My
wp_rg_stripe
table was missing theid
field as specified in the database definition on line 23 of class-gfp-stripe-data.php.My fix for this was to go to the table wp_rg_stripe and remove the primary key on the form_id field. Then I added a new mediumint(8) field called
id
and made that autoincrement and set it as a primary key.Here are the commands I ran. Note you may have to change the wp_ portion if you have a different table prefix set.
ALTER TABLE
wp_rg_stripe
DROP PRIMARY KEY;
ALTER TABLEwp_rg_stripe
ADDid
MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY;Then you should be able to see any subscriptions you had previously set up. I then had to resave each one before my feeds would start working again.
Forum: Fixing WordPress
In reply to: oEmbed Filter?One thing I’d recommend trying is wrapping your content in stripslashes(), or maybe increase the number that the filter gets applied, i.e.
apply_filters('the_content', $videos, 99);
Just blind guesses. Seeing a var_dump of your $videos variable may help though.
Forum: Plugins
In reply to: Developing Plugin: Call to undefined function add_menu_page()Go figure, I try for 4 hours, then solve the problem 5 minutes after I post on the forum.
The issue seems to be that you cannot call add_menu_page or any of those functions from outside the class. You need to call add_action(‘admin_menu’,array(class,function_to_setup_menu));
Then in function_to_setup_menu, use add_menu_page().
Here is a code sample:<?php //Set Up Class if (!class_exists("B2BannerRotator")) { class B2BannerRotator { function B2BannerRotator() { //constructor } function Main() { return 0; } function ConfigureMenu() { add_menu_page("Test", "tesT", 6, 'b2_bannerrotator', array('B2BannerRotator','Main')); } } } //Create new instance of class if (class_exists("B2BannerRotator")) { $b2_banner_rotator = new B2BannerRotator(); } //Actions and Filters if(isset($b2_banner_rotator)){ // Administration Actions add_action('admin_menu', array($b2_banner_rotator,'ConfigureMenu')); } ?>