Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Had 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 the id 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 TABLE wp_rg_stripe ADD id 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.

    Thread Starter dan.imbrogno

    (@danimbrogno)

    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'));
    	}
    
    ?>

Viewing 3 replies - 1 through 3 (of 3 total)