• Resolved Jacob Dubail

    (@jacobdubail)


    Hey,

    Thanks for this plugin. Super handy.

    I’m running:
    WP 4.2.2
    GF 1.9.12.1
    Date Picker in List Fields 1.2

    The check for is_gravityforms_installed in the constructor isn’t passing for some reason, even though GF is definitely installed and active. If I comment out the if statement, everything runs fine. What’s strange is that swapping that if statement for if ( class_exists( ‘GFAPI’ ) ) { also fails, but works fine if I run that check on the front end like so:

    if ( class_exists('GFAPI') ) {
    	echo "<h1>I EXIST</h1>";
    }

    Is this plugin loading before GF?

    Thanks,
    Jacob

    https://wordpress.org/plugins/gravity-forms-list-field-date-picker/

Viewing 1 replies (of 1 total)
  • Plugin Author ovann86

    (@ovann86)

    Hey Jacob,

    Thanks for reporting and the detailed testing.

    It does sound like the plugin has loaded before Gravity Forms, and I’m wondering if it’s started because I changed the display name.

    I dont know how WP chooses the load order, but maybe it loads alphabetically by display name?

    Any how, I’ve made a change in Version 1.2.1 which registers the functions through the ‘plugins_loaded’ action instead of just in the constructor.

    I’ve never done it this way before, so I’m curious to see how well it works. May make a good standard for the rest of my GF plugins.

    Here’s what I did, let me know how you go or what your thoughts are.

    Adrian

    public function __construct()
            {
    			// register plugin functions through 'plugins_loaded' -
    			// this delays the registration until all plugins have been loaded, ensuring it does not run before Gravity Forms is available.
                add_action( 'plugins_loaded', array(&$this,'register_actions') );
    		}
    
    		/*
             * Register plugin functions
             */
    		function register_actions() {
                if ((self::is_gravityforms_installed())) {
    				// start the plugin
    				add_filter('gform_column_input_content', array(&$this,'change_column_content'), 10, 6);
    				add_action('gform_enqueue_scripts', array(&$this,'datepicker_js'), 90, 2);
    				add_action('gform_editor_js', array(&$this,'editor_js'));
    			}
    		}
Viewing 1 replies (of 1 total)
  • The topic ‘is_gravityforms_installed is failing’ is closed to new replies.