• Resolved Craig

    (@catholicservant)


    Hello,
    We use ManageWP to manage our WP sites and it has a ‘code snippets’ feature. But, not nearly as flexible as this plugin.

    When the Code Snippets plugin is enabled, I cannot sync with ManageWP and get the following error…
    Fatal Error (E_ERROR): Class 'PodsInit' not found occurred in wp-content/plugins/code-snippets/php/snippet-ops.php(427) : eval()'d code on line 4 please make sure that your website is accessible

    Any suggestions on how to make these work together?

    Thanks!
    Craig

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    This looks like an error from one of your snippets. Are you using a snippet (in this plugin) that uses a PodsInit class?

    Thread Starter Craig

    (@catholicservant)

    Hi Shea,
    Here’s the snippet…

    add_action( 'admin_init', 'remove_pods_shortcode_button', 14 );
    
    function remove_pods_shortcode_button () {
        remove_action( 'media_buttons', array( PodsInit::$admin, 'media_button' ), 12 );
    }

    Code has been working fine. It removes a button from the editor.

    No errors in php log nor console.

    I’ll deactivate it and see if the plugin still conflicts with ManageWP.

    Thx!

    Thread Starter Craig

    (@catholicservant)

    OK…deactivating the snippet and the plugin no longer conflicts with ManageWP

    Not sure why though.

    Plugin Author Shea Bunge

    (@bungeshea)

    I’m unsure how ManageWP operate and I haven’t tested this myself as I haven’t used the service for a fairly long time, though perhaps they aren’t loading the Pods plugin when syncronisning for some reason which is causing the class to not exist.

    Perhaps, as a work-around, you could wrap your snippet in a check to make sure the plugin class has been loaded:

    if ( class_exists( 'PodsInit' ) ) {
    
    	add_action( 'admin_init', 'remove_pods_shortcode_button', 14 );
    
    	function remove_pods_shortcode_button () {
    		remove_action( 'media_buttons', array( PodsInit::$admin, 'media_button' ), 12 );
    	}	
    }

    Let me know if this gets things to work!

    Thread Starter Craig

    (@catholicservant)

    You’re the man Shea. It worked! Thanks!

    Plugin Author Shea Bunge

    (@bungeshea)

    Fantastic! Thanks for confirming!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Conflict with ManageWP?’ is closed to new replies.