init(); // Instantiate the options page. $options_framework_admin = new Options_Framework_Admin; $options_framework_admin->init(); // Instantiate the media uploader class $options_framework_media_uploader = new Options_Framework_Media_Uploader; $options_framework_media_uploader->init(); // get the the role object + add $cap capability to this role object // $editor = get_role('editor'); // $editor->add_cap('edit_theme_options'); // $author = get_role('author'); // $author->add_cap('edit_theme_options'); // $contributor = get_role('contributor'); // $contributor->add_cap('edit_theme_options'); } add_action( 'init', 'optionsframework_init', 20 ); // Just for demo online version // block user DEMO/DEMO contributor // remove menu element // add_action( 'admin_init', 'posts_for_current_contributor' ); // function posts_for_current_contributor() { // if ( current_user_can( 'contributor' ) ) { // //remove_menu_page('edit.php'); // Posts // remove_menu_page('upload.php'); // Media // remove_menu_page('link-manager.php'); // Links // //remove_menu_page('edit-comments.php'); // Comments // remove_menu_page('edit.php?post_type=page'); // Pages // remove_menu_page('plugins.php'); // Plugins // remove_menu_page('themes.php'); // Appearance // remove_menu_page('users.php'); // Users // remove_menu_page('profile.php'); // Users // remove_menu_page('tools.php'); // Tools // remove_menu_page('options-general.php'); // Settings // } // } /** * Helper function to return the theme option value. * If no value has been saved, it returns $default. * Needed because options are saved as serialized strings. * * Not in a class to support backwards compatibility in themes. */ if ( ! function_exists( 'of_get_option' ) ) : function of_get_option( $name, $default = false ) { $config = get_option( 'optionsframework' ); if ( ! isset( $config['id'] ) ) { return $default; } $options = get_option( $config['id'] ); if ( isset( $options[$name] ) ) { return $options[$name]; } return $default; } endif; // /********** start export ************/ // /** * Register the plugin menu Position */ function pwsix_register_settings() { register_setting( 'pwsix_settings_group', 'settings' ); } add_action( 'admin_init', 'pwsix_register_settings' ); /** * Register the settings page */ function pwsix_settings_menu() { //add_theme_page( __( 'Import/Export' ), __( 'Import/Export' ), 'edit_theme_options', 'settings', 'pwsix_settings_page' ); add_menu_page('AdminRocket', 'AdminRocket', 'manage_options', 'options-framework','optionsframework_page', 'dashicons-art'); add_submenu_page( 'options-framework', 'Import/Export', 'Import/Export', 'manage_options', 'settings', 'pwsix_settings_page'); } add_action( 'admin_menu', 'pwsix_settings_menu' ); /** * Render the settings page */ function pwsix_settings_page() { $themenametp = get_option( 'stylesheet' ); $themenametp = preg_replace("/\W/", "_", strtolower($themenametp) ); $options = get_option( $themenametp ); ?>

Import & Export AdminRocket Themes

ID, '_last_login', time() ); } add_action( 'wp_login', 'user_last_login', 10, 2 ); // login screen function my_loginlogo() { if(of_get_option( 'opt_body_logoupload' )){ echo ''; } if(of_get_option( 'opt_body_bgupload' )){ echo ''; } if(of_get_option( 'opt_body_bgc' )){ echo ''; } if(of_get_option( 'opt_body_bguploadpattern' )){ echo ''; } } add_action('login_head', 'my_loginlogo'); // // end login screen // // // start backend security // add_action( 'init', 'fb_wp_hide_version' ); function fb_wp_hide_version(){ if(of_get_option( 'opt_login_hide_wpversion' )){ remove_action('wp_head','wp_generator'); } } add_action( 'init', 'fb_wp_hide_errormessage' ); function fb_wp_hide_errormessage(){ if(of_get_option( 'opt_login_hide_messages' )){ add_filter('login_errors',create_function('$a', "return null;")); } } add_action( 'init', 'fb_wp_hide_wpupdate' ); function fb_wp_hide_wpupdate(){ if(of_get_option( 'opt_login_hide_wpupdate' )){ add_filter('pre_site_transient_update_core', create_function('$a', "return null;")); } } add_action( 'init', 'fb_wp_hide_theme_update' ); function fb_wp_hide_theme_update(){ if(of_get_option( 'opt_login_hide_wpupdate_theme' )){ remove_action('load-update-core.php', 'wp_update_themes'); add_filter('pre_site_transient_update_themes', create_function('$a', "return null;")); } } add_action( 'init', 'fb_wp_hide_plugin_update' ); function fb_wp_hide_plugin_update(){ if(of_get_option( 'opt_login_hide_wpupdate_plugin' )){ remove_action('load-update-core.php', 'wp_update_plugins'); add_filter('pre_site_transient_update_plugins', create_function('$a', "return null;")); } } add_action( 'admin_init', 'wp_hide_update_wpmenu' ); function wp_hide_update_wpmenu() { if(of_get_option( 'opt_wpmenu_hide_updates' )){ remove_submenu_page( 'index.php', 'update-core.php' ); } } // // end backend security // // // fix background position with adminbar // add_action( 'admin_head', 'fb_wp_adminbar_bgbody' ); function fb_wp_adminbar_bgbody(){ if(of_get_option( 'opt_wpadminbar_bottom' )){ echo ''; } }