public static function initAdmin() { global $wp_version, $post; // add plugin menus // setup js, css assets CRED_Helper::setupAdmin(); add_action('admin_menu', array(__CLASS__, 'admin_menu'), 20); // add media buttons for cred forms at editor // if (version_compare($wp_version, '3.1.4', '>')) { // add_action('media_buttons', array(__CLASS__, 'addFormsButton'), 20, 2); // } else { // add_action('media_buttons_context', array(__CLASS__, 'addFormsButton'), 20, 2); // } // integrate with Views add_filter('wpv_meta_html_add_form_button', array(__CLASS__, 'addCREDButton'), 20, 2); //WATCHOUT: remove custom meta boxes from cred forms (to avoid any problems) // add custom meta boxes for cred forms //add_action('add_meta_boxes_' . CRED_FORMS_CUSTOM_POST_NAME, array(__CLASS__, 'addMetaBoxes'), 20, 1); // save custom fields of cred forms //add_action('save_post', array(__CLASS__, 'saveFormCustomFields'), 10, 2); // IMPORTANT: drafts should now be left with post_status=draft, maybe show up because of previous versions //add_filter('wp_insert_post_data', array(__CLASS__, 'forcePrivateforForms')); }