get_results('SELECT id, title FROM '. $wpdb->vimeography_gallery); if ( empty( $galleries ) ) { return; } $values = array(); foreach( $galleries as $gallery ) { $values[$gallery->title] = $gallery->id; } vc_map( array( 'name' => __('Vimeography Gallery', 'vimeography'), 'description' => __('Add a Vimeography Gallery to this page.', 'vimeography'), 'base' => 'vimeography', 'icon' => VIMEOGRAPHY_URL . 'lib/admin/assets/img/vimeography-logo-512px-transparent.png', 'category' => 'Content', 'params' => array( array( 'type' => 'dropdown', 'heading' => __('Choose your Gallery', 'vimeography'), 'param_name' => 'id', 'description' => __('To create a new gallery, visit the Vimeography Gallery Editor.', 'vimeography'), 'value' => $values, 'std' => $galleries[0]->title, 'admin_label' => true, ), ) ) ); } /** * Check the wordpress version is compatible, and disable plugin if not. * * @access public * @return void */ public function vimeography_requires_wordpress_version() { global $wp_version; if ( version_compare($wp_version, "3.3", "<" ) ) { if ( is_plugin_active( VIMEOGRAPHY_BASENAME ) ) { deactivate_plugins( VIMEOGRAPHY_BASENAME ); wp_die( sprintf( __('Vimeography requires WordPress 3.3 or higher. Please upgrade WordPress and try again. Back to WordPress admin', 'vimeography'), admin_url() ) ); } } } /** * Adds a notice if the user needs to remove and reenter their license keys * @return void */ public function vimeography_maybe_add_activation_key_reset_nag() { if ( get_site_option('vimeography_corrupt_keys_found') ) { if ( isset( $_GET['vimeography-cancel-activation-message'] ) OR get_site_option('vimeography_activation_keys') ) { delete_site_option('vimeography_corrupt_keys_found'); return; } if ( ! isset( $_POST['vimeography-activate-key'] ) ) { add_action('admin_notices', array($this, 'vimeography_corrupt_keys_notice') ); } } } /** * Outputs a notice if the user needs to remove and reenter their license keys * @return void */ public function vimeography_corrupt_keys_notice() { printf( '
%1$s | %3$s