public static function initAdmin() { global $wp_version, $post; // add plugin menus // setup js, css assets CRED_Admin_Helper::setupAdmin(); CRED_CRED::media(); CRED_CRED::setFormsAndButtons(); //TODO: removing before release this new cred embedded version //http://wp.localhost:8080/wp-admin/admin.php?page=cred-embedded&cred_id=601 @add_action('admin_menu', array(CRED_CRED, 'admin_menu'), 20); //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); add_action('add_meta_boxes_' . CRED_USER_FORMS_CUSTOM_POST_NAME, array(__CLASS__, 'addMetaBoxes2'), 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')); // Remove the Distraction Free Writing button from CRED editors add_filter('wp_editor_expand', array(__CLASS__, 'disable_wp_editor_expand_for_cred_forms'), 99, 2); }