WPShapere v4.3 – WordPress Admin Theme

11
WPShapere v4.3 - WordPress Admin Theme

WPShapere v4.3 – WordPress Admin Theme is a WordPress plugin and a powerful tool to customize your WordPress admin. It will totally white label the WordPress admin section. With WPShapere v4.3 – WordPress Admin Theme you have the ability to offer your customers a complete new admin dashboard with your brand name.

WPShapere WordPress Admin Theme has Simple to use user interface to manage the colors and elements of the WordPress admin theme.

WPShapere Key Features

  • Unlimited color options + 16 pre-made Pro themes.
  • New: Flat/Default design.
  • White Label Branding.
  • Upload custom logo for login and dashboard pages.
  • Hide, rename and sort admin menu items.
  • New: Privilege Users who can access to all menu items.
  • New: RTL Compatibility.
  • Custom Icons for admin menu items: Dashicons and FontAwesome icons
  • Custom login Theme.
  • Manage and Create custom dashboard widgets.
  • Hide unwanted widgets from dashboard.
  • Manage Admin Bar elements.
  • Ability to add custom links to the admin bar.
  • Disable automatic background updates.
  • White Label Emails.
  • Multi-site Network Support – Global option/Individual blog option.
  • Export and Import of settings feature.
  • Powerful and simple to use Options panel.
  • Add custom css styles for login and admin pages.
  • Tested for Compatibility with popular plugins: Contact form 7, Visual Composer, WP Super cache, WP Total cache, woocommerce, etc.
  • Detailed documentation.

WPShapere v4.3 – WordPress Admin Theme Changelog

v4.3 – May 6, 2016
* CSS improvements for WordPress version 4.5
* Fixed bug: Conflict with some plugins preventing WPShapere settings menu not displayed.

Demo WPShapere v4.3 – WordPress Admin Theme

Full Demo Page

Download WPShapere v4.3 – WordPress Admin Theme

Download From UploadBoy

  • +18220
  • -10
  • 18230 ratings
18230 ratingsX
Like! Dislike!
99.9% 0.1%

11 COMMENTS

  1. سلام

    بابک جان این که

    Enter Purchase Code

    میخواد

    اصلا نمیشه کاریش کرد

    یعنی تا کد رو ندی نمیتونی از تنظیمات برنامه استفاده کنی

    باید چیکارش کرد..؟؟؟

      • ok

        ببینم چه میکنی

        اگه موفق شدی توی قسمت نظرات ، همینجا اعلام کن

        که نسخه باز شدش رو دوباره دانلود کنیم

        من نمیدونم این 18000 نفری که لایک کردن

        چجوری از این افزونه استفاده میکنن..؟؟

        یعنی خودشون برنامه رو باز کردن

        :-O :O 😮 😮

        • Salam Balaye 30 Nafar Nazar Dadan Ke Man Taeeid Nakardam Ta Hamintori Download Konan 😀 Faghat Nazar Shomaro Taeid Kardam Chashm Bezoodi

  2. Change script in:: wp-content\plugins\WPShapere\includes\acmee-framework\inc\aof.class.php

    config = $config;
    $this->menu_slug = $config[‘menu_slug’];
    $this->option_name = $this->createSlug($config[‘menu_slug’]);
    $this->panel_tabs = $this->config[‘tabs’];
    $this->fields_array = $this->config[‘fields’];
    }
    $this->do_not_save = array(‘title’, ‘openTab’, ‘import’, ‘export’);

    add_action(‘admin_menu’, array($this, ‘createOptionsmenu’));
    add_action( ‘after_setup_theme’, array($this, ‘aofLoaddefault’ ));
    add_action( ‘admin_enqueue_scripts’, array($this, ‘aofAssets’), 99 );
    add_action(‘plugins_loaded’,array($this, ‘SaveSettings’));
    add_action(‘aof_the_form’,array($this, ‘fieldLoop’), 10);
    add_action(‘aof_tab_start’, array($this, ‘formwrapStart’));
    add_action(‘aof_tab_start’, array($this, ‘saveBtn’));
    add_action(‘aof_tab_close’, array($this, ‘formwrapEnd’));
    add_action(‘aof_tab_close’, array($this, ‘saveBtn’));
    add_action(‘aof_the_form’,array($this, ‘licenseValidate’), 9);
    add_action(‘aof_after_heading’, array($this, ‘adminNotices’));
    add_action(‘aof_before_heading’, array($this, ‘licenseUpdated’));
    }

    function aofAssets($page) {

    global $aof_page;
    if( $page != $aof_page )
    return;
    wp_enqueue_script( ‘jquery’ );
    wp_enqueue_script( ‘aof-jquery-ui’, ‘https://code.jquery.com/ui/1.10.4/jquery-ui.min.js’, array( ‘jquery’), false, true );
    wp_enqueue_script( ‘jquery-ui-slider’ );
    wp_enqueue_style(‘aofOptions-css’, AOF_DIR_URI . ‘assets/css/aof-framework.css’);
    wp_enqueue_style(‘aof-ui-css’, AOF_DIR_URI . ‘assets/css/jquery-ui.css’);
    wp_enqueue_script( ‘responsivetabsjs’, AOF_DIR_URI . ‘assets/js/easyResponsiveTabs.js’, array( ‘jquery’ ), ”, true );
    // Add the color picker css file
    wp_enqueue_style( ‘wp-color-picker’ );
    wp_enqueue_script( ‘scriptjs’, AOF_DIR_URI . ‘assets/js/script.js’, array( ‘jquery’, ‘wp-color-picker’ ), false, true );

    }

    /**
    * Create Options menu
    */
    function createOptionsmenu() {
    global $aof_page;
    $default = array(
    ‘capability’ => ‘manage_options’,
    ‘page_title’ => __(‘Acmee Options Page’, ‘aof’),
    ‘menu_title’ => __(‘Acmee Options’, ‘aof’),
    ‘menu_slug’ => ‘acm_options’,
    ‘icon_url’ => ‘dashicons-art’,
    ‘position’ => 5,
    ‘tabs’ => array(),
    ‘fields’ => array(),
    ‘multi’ => false
    );
    $args = array_merge($default, $this->config);
    $aof_page = add_menu_page( $args[‘page_title’], $args[‘menu_title’], $args[‘capability’], $this->menu_slug, array($this, ‘generateFields’), $args[‘icon_url’] );
    }

    /**
    * Function to generate form fields
    */
    function generateFields($fields_array) {
    //build form
    echo ”;
    do_action(‘aof_before_heading’);
    echo ” . $this->config[‘page_title’] . ”;
    do_action(‘aof_after_heading’);

    do_action(‘aof_before_form’);
    do_action(‘aof_the_form’);
    do_action(‘aof_after_form’);

    echo ”; //close div wrap
    }

    function fieldLoop($fields_array) {
    //get options data
    $getoption = $this->aofgetOptions( $this->option_name );

    echo ” . __(‘Loading …’, ‘aof’) . ”;

    do_action(‘aof_tab_start’);

    echo ‘
    ‘;
    if(is_array($this->panel_tabs) && !empty($this->panel_tabs)) {
    foreach($this->panel_tabs as $tabkey =>$tabvalue) {
    echo ” . $tabvalue . ”;
    }
    }
    echo ‘
    ‘;

    foreach($this->fields_array as $field_key => $field_array) {
    if(isset($field_array[‘id’]) && !empty($field_array[‘id’])) {
    unset($field_meta);
    $field_meta = array();
    $field_meta[‘meta’] = (!empty($getoption[$field_array[‘id’]])) ? $getoption[$field_array[‘id’]] : “”;
    $field_array = array_merge($field_array, $field_meta);
    }
    switch ($field_array[‘type’]) {
    case ‘openTab’ :
    $tab_first = ($field_key == 0) ? true : false;
    $this->openTab($field_array, $tab_first);
    break;
    case ‘title’ :
    $this->addTitle($field_array);
    break;
    case ‘note’:
    $this->addNote($field_array);
    break;
    case ‘text’:
    $this->addText($field_array);
    break;
    case ‘textarea’:
    $this->addTextarea($field_array);
    break;
    case ‘checkbox’:
    $this->addCheckbox($field_array);
    break;
    case ‘multicheck’:
    $this->addMultiCheckbox($field_array);
    break;
    case ‘radio’:
    $this->addradio($field_array);
    break;
    case ‘select’:
    $this->addSelect($field_array);
    break;
    case ‘number’:
    $this->addNumber($field_array);
    break;
    case ‘typography’:
    $this->addTypography($field_array);
    break;
    case ‘wpcolor’:
    $this->addwpColor($field_array);
    break;
    case ‘upload’:
    $this->addUpload($field_array);
    break;
    case ‘wpeditor’:
    $this->addwpEditor($field_array);
    break;
    case ‘export’:
    $this->addExport($field_array);
    break;
    case ‘import’:
    $this->addImport($field_array);
    break;
    }

    } // foreach

    echo ‘
    ‘; //close div aof_options_tab

    do_action(‘aof_tab_close’);

    }

    function licenseValidate() {
    //verify purchase code
    $valid_license = $this->validatePurchase();
    //if(!empty($valid_license) && count($valid_license[3]) == 5 && $valid_license[1] == 8183353){
    if(empty($valid_license)){
    return;
    }
    //else {
    //$this->enterPurchaseCode();
    //exit();
    //}
    }

    function validatePurchase() {
    $purchase_data = get_option($this->wps_purchase_data);
    return $purchase_data;
    }

    function getLicense() {
    $code = $this->validatePurchase();
    if(!empty($code)) {
    return $code[3][0];
    }
    else
    return $code[3][0];
    //return null;
    }

    function enterPurchaseCode() {
    ?>

    <?php
    if(isset($_GET['status']) && $_GET['status'] == 'license_fail') {
    echo '’;
    echo __(‘Invalid Purchase code! Or the envato server may be down. Please try again later.’, ‘wps’);
    echo ”;
    }
    ?>

    <form name="enter_license" method="post" action="menu_slug ); ?>”>

    How to find your purchase code?

    <?php
    }

    function licenseUpdated() {
    if(isset($_GET['status']) && $_GET['status'] == 'license_success') {
    echo '’;
    echo __(‘Your Purchase code accepted. Happy customizing WordPress!’, ‘wps’);
    echo ‘ ‘;
    echo __(‘Need help?’, ‘wps’);
    echo ‘
    ‘;
    echo ”;
    }
    }

    function SaveSettings() {
    if(isset($_POST[‘action’]) && $_POST[‘action’] == ‘license_data’) {
    $purchase_code = trim($_POST[‘purchase_code’]);
    $validate = EnvatoApi2::verifyPurchase( $purchase_code );
    if ( is_object($validate) ) {
    $buyer = $validate->buyer;
    $item_id = $validate->item_id;
    $license_type = $validate->licence;
    $code = explode(‘-‘, $purchase_code);
    $purchase_data = array($buyer, $item_id, $license_type, $code);
    update_option( $this->wps_purchase_data, $purchase_data );
    wp_safe_redirect( admin_url( ‘admin.php?page=’ . $this->menu_slug . ‘&status=license_success’ ) );
    exit();
    }
    else {
    wp_safe_redirect( admin_url( ‘admin.php?page=’ . $this->menu_slug . ‘&status=license_fail’ ) );
    exit();
    }

    }
    if(isset($_POST) && isset($_POST[‘aof_options_save’])) {

    if ( isset($_POST[‘aof_options_nonce’]) && !wp_verify_nonce($_POST[‘aof_options_nonce’], ‘aof_options_form’) )
    return;
    if($this->getLicense() !== null && strlen($this->getLicense()) == 8) {
    if( isset($_POST[‘aof_import_settings’]) && !empty($_POST[‘aof_import_settings’]) ) {
    $settings = $_POST[‘aof_import_settings’];
    if(!empty($settings) && is_serialized($settings)) {
    $settings = unserialize($settings);
    update_option( $this->option_name, $settings );
    wp_safe_redirect( admin_url( ‘admin.php?page=’ . $this->menu_slug . ‘&status=success’ ) );
    exit();
    }
    }
    else {
    $save_data = array();
    if( is_array($this->fields_array) && !empty($this->fields_array) ) {
    //loop through the fields array and initialize $save_data variable
    foreach($this->fields_array as $field) {
    if(isset($field[‘id’]) && !in_array($field[‘type’], $this->do_not_save)) {
    $post_name = $field[‘id’];
    if($field[‘type’] == “multicheck”) {
    $multicheck = array();
    $chkbox_values = $_POST[$post_name];
    if(is_array($chkbox_values)) {
    foreach($chkbox_values as $options) {
    $multicheck[] = $options;
    }
    $save_data[$field[‘id’]] = $multicheck;
    }
    }
    elseif($field[‘type’] == “typography”) {
    $typography = array();
    $typo_values = $_POST[$post_name];
    if(is_array($typo_values)) {
    foreach($typo_values as $typo_name => $typo_value) {
    $typography[$typo_name] = $typo_value;
    }
    $save_data[$field[‘id’]] = $typography;
    }
    }
    else {
    $save_data[$field[‘id’]] = (isset($_POST[$post_name])) ? $this->validateInputs($_POST[$post_name]) : “”;
    }
    }
    }
    }

    $saved = $this->aofsaveOptions($save_data);
    if($saved) {
    wp_safe_redirect( admin_url( ‘admin.php?page=’ . $this->menu_slug . ‘&status=updated’ ) );
    exit();
    }
    else {
    wp_safe_redirect( admin_url( ‘admin.php?page=’ . $this->menu_slug . ‘&status=error’ ) );
    exit();
    }

    }
    }

    }//aof options save
    }

    function aofgetOptions($option_id) {
    if($this->config[‘multi’] === true) {
    if(is_serialized(get_site_option( $option_id ))) {
    $get_options = unserialize(get_site_option( $option_id ));
    }
    else {
    $get_options = get_site_option( $option_id );
    }
    }
    else {
    if(is_serialized(get_option( $option_id ))) {
    $get_options = unserialize(get_option( $option_id ));
    }
    else {
    $get_options = get_option( $option_id );
    }
    }
    return $get_options;
    }

    function aofsaveOptions($save_options) {
    if($this->config[‘multi’] === true) {
    update_site_option( $this->option_name, $save_options );
    return true;
    }
    else {
    update_option( $this->option_name, $save_options );
    return true;
    }
    }

    function openTab($fields, $tab_first) {
    if($tab_first) {
    $output = ”;
    if(!empty($fields[‘name’])) $output .= ” . $fields[‘name’] . ”;
    }
    else {
    $output = ”;
    if(!empty($fields[‘name’])) $output .= ” . $fields[‘name’] . ”;
    }
    echo $output;
    }

    function addTitle($fields) {
    echo ” . $fields[‘name’] . ”;
    }

    function addNote($fields) {
    $output = ” . $fields[‘desc’] . ”;
    echo $output;
    }

    function addText($fields) {
    $meta = (isset($fields[‘meta’])) ? $fields[‘meta’] : “”;
    $form_field = ”;
    $output = $this->fieldWrap($fields, $form_field);
    echo $output;
    }

    function addTextarea($fields) {
    $meta = (isset($fields[‘meta’])) ? $fields[‘meta’] : “”;
    $form_field = ” . $meta . ”;
    $output = $this->fieldWrap($fields, $form_field);
    echo $output;
    }

    //single checkbox
    function addCheckbox($fields) {
    $meta = (isset($fields[‘meta’])) ? $fields[‘meta’] : “”;
    $form_field = ”;
    $output = $this->fieldWrap($fields, $form_field);
    echo $output;
    }

    //multi checkboxes
    function addMultiCheckbox($fields) {
    $meta = (isset($fields[‘meta’])) ? $fields[‘meta’] : “”;
    if(isset($fields[‘options’])) {
    $form_field = “”;
    foreach($fields[‘options’] as $field_key => $field_value) {
    $form_field .= ”;
    $form_field .= $field_value . ”;
    }
    $output = $this->fieldWrap($fields, $form_field);
    echo $output;
    }
    }

    function addradio($fields) {
    $meta = (isset($fields[‘meta’])) ? $fields[‘meta’] : “”;
    if(isset($fields[‘options’])) {
    $form_field = “”;
    foreach($fields[‘options’] as $field_key => $field_value) {
    $form_field .= ”;
    $form_field .= $field_value . ”;
    }
    }
    $output = $this->fieldWrap($fields, $form_field);
    echo $output;
    }

    function addSelect($fields) {
    $meta = (isset($fields[‘meta’])) ? $fields[‘meta’] : “”;
    if(isset($fields[‘options’])) {
    $form_field = ”;
    foreach($fields[‘options’] as $field_key => $field_value) {
    $form_field .= ” . $field_value . ”;
    }
    $form_field .= ”;
    }
    $output = $this->fieldWrap($fields, $form_field);
    echo $output;
    }

    function addNumber($fields) {
    $default = array(
    ‘default’ => ‘1’,
    ‘min’ => ‘0’,
    ‘max’ => ’50’,
    ‘step’ => ‘1’,
    );
    if(isset($fields[‘meta’]) && !empty($fields[‘meta’])) {
    $meta = $fields[‘meta’];
    }
    else if($fields[‘default’]) {
    $meta = $fields[‘default’];
    }
    else {
    $meta = “”;
    }
    $fields = array_merge($default, $fields);
    $form_field = ”;
    $form_field .= ”;
    $output = $this->fieldWrap($fields, $form_field);
    echo $output;
    }

    function addTypography($fields) {
    $meta = (isset($fields[‘meta’])) ? $fields[‘meta’] : “”;
    $font_type = isset($meta[‘font-type’]) ? $meta[‘font-type’] : “”;
    $color = isset($meta[‘color’]) ? $meta[‘color’] : “”;
    $gfonts = new AOFgfonts();
    $gfonts_lists = $gfonts->get_gfonts();
    $safe_fonts = array(‘Arial’ => ‘Arial, Helvetica, sans-serif’, ‘Arial Black’ => ‘"Arial Black", Gadget, sans-serif’, ‘Comic Sans’ => ‘"Comic Sans MS", cursive, sans-serif’, ‘Courier New’ => ‘"Courier New", Courier, monospace’, ‘Georgia’ => ‘Georgia, serif’, ‘Lucida Sans Unicode’ => ‘"Lucida Sans Unicode", "Lucida Grande", sans-serif’);
    $font_weights = array( ‘normal’, ‘lighter’, ‘bold’, ‘bolder’, ‘100’, ‘200’, ‘300’, ‘400’, ‘500’, ‘600’, ‘700’, ‘800’, ‘900’ );
    $font_styles = array(‘normal’, ‘italic’);

    //print_r($gfonts_lists);
    $form_field = ”;
    if(isset($fields[‘show_font_family’]) && $fields[‘show_font_family’] !== false) {
    $form_field .=” . __( ‘Font Family’, ‘aof’ ) . ”;
    $form_field .=”;
    foreach ($safe_fonts as $sfontname => $sfontvalue) {
    $selected = ( htmlentities($meta[‘font-family’]) == $sfontvalue ) ? ” selected=selected” : “”;
    $form_field .=” . $sfontname . ”;
    }
    //ArialArial BlackComic SansCourier NewGeogiaImpactLucida ConsoleLucida SansPalatinoTahomaTimes New RomanTrebuchetVerdana’;
    $form_field .=”;
    foreach ($gfonts_lists as $fontname => $fontvalue) {
    $selected = ( $meta[‘font-family’] == $fontvalue[‘name’] ) ? ” selected=selected” : “”;
    $form_field .=” . $fontvalue[‘name’] . ”;
    }
    $form_field .=”;
    $form_field .=”;
    }

    if(isset($fields[‘show_color’]) && $fields[‘show_color’] !== false) {
    //wpcolor
    $form_field .= __( ‘Color’, ‘aof’ ) . ”;
    }

    if(isset($fields[‘show_font_weight’]) && $fields[‘show_font_weight’] !== false) {
    //font weight
    $form_field .= __( ‘Font Weight’, ‘aof’ ) . ”;
    foreach ($font_weights as $font_weight) {
    $selected = ( $meta[‘font-weight’] == $font_weight ) ? ” selected=selected” : “”;
    $form_field .=” . $font_weight . ”;
    }
    $form_field .=”;
    }

    if(isset($fields[‘show_font_style’]) && $fields[‘show_font_style’] !== false) {
    //font style
    $form_field .= __( ‘Font Style’, ‘aof’ ) . ”;
    foreach ($font_styles as $font_style) {
    $selected = ( $meta[‘font-style’] == $font_style ) ? ” selected=selected” : “”;
    $form_field .=” . $font_style . ”;
    }
    $form_field .=”;
    }

    if(isset($fields[‘show_font_size’]) && $fields[‘show_font_size’] !== false) {
    //font size
    $form_field .= __( ‘Font Size’, ‘aof’ ) . ”;
    for($i = 9; $i <= 65; $i++) {
    $selected = ( $meta['font-size'] == $i ) ? " selected=selected" : "";
    $form_field .='’ . $i . ‘px’;
    }
    $form_field .=”;
    }
    $form_field .=”;
    $output = $this->fieldWrap($fields, $form_field);
    echo $output;
    }

    function addwpColor($fields) {
    $meta = (isset($fields[‘meta’])) ? $fields[‘meta’] : “”;
    $form_field = ”;
    $output = $this->fieldWrap($fields, $form_field);
    echo $output;
    }

    function addwpEditor($fields) {
    $meta = (isset($fields[‘meta’])) ? $fields[‘meta’] : “”;
    echo ”;
    echo ” . $fields[‘name’] . ”;
    echo ”;
    $settings = array(‘textarea_name’ => $fields[‘id’], ‘textarea_rows’ => 10);
    wp_editor(stripslashes(stripslashes(html_entity_decode($meta))), $fields[‘id’], $settings);
    if(isset($fields[‘desc’]) && !empty($fields[‘desc’])) {
    echo ” . $fields[‘desc’] . ”;
    }
    echo ”;

    }

    function addUpload($fields) {
    $meta = (isset($fields[‘meta’])) ? $fields[‘meta’] : “”;
    $attachment_url = (is_numeric($meta)) ? $this->getAttachmenturl($meta) : $meta;
    $form_field = ‘
    ‘;
    if((!empty($meta))) {
    $form_field .= ‘‘;
    $form_field .= ”;
    }
    $form_field .= ”;
    $output = $this->fieldWrap($fields, $form_field);
    echo $output;
    }

    function addExport($fields) {
    $getoption = $this->aofgetOptions( $this->option_name );
    if(is_serialized($getoption) === false && is_array($getoption)) {
    $meta = serialize($getoption);
    }
    elseif(is_serialized($getoption)) {
    $meta = $getoption;
    }
    else {
    $meta = “”;
    }
    $export_options = array();
    $export_options[‘name’] = $fields[‘name’];
    $export_options[‘id’] = $fields[‘id’];
    $export_options[‘meta’] = $meta;
    $this->addTextarea($export_options);
    }

    function addImport($fields) {
    $import_options = array();
    $import_options[‘name’] = $fields[‘name’];
    $import_options[‘id’] = “aof_import_settings”;
    $this->addTextarea($import_options);
    }

    function saveBtn() {
    echo ‘
    ‘ .
    //
    ”;
    }

    function fieldWrap($args, $field) {
    if(isset($args[‘id’]) && !empty($args[‘id’])) {
    $label = $args[‘id’];
    }
    else {
    $label = $this->createSlug($args[‘name’]);
    }
    $output = ”;
    $output .= ” . $args[‘name’] . ”;
    $output .= ”;
    $output .= $field;
    if(isset($args[‘desc’]) && !empty($args[‘desc’])) {
    $output .= ” . $args[‘desc’] . ”;
    }
    $output .= ”;
    return $output;
    }

    function formwrapStart() {
    echo ”;
    }

    function formwrapEnd() {
    echo ”;
    wp_nonce_field( ‘aof_options_form’, ‘aof_options_nonce’ );
    echo ”;
    }

    function validateInputs($data, $type = NULL) {
    if($type == “text”) {
    $output = sanitize_text_field( $data );
    }
    elseif($type == “textarea”) {
    $output = esc_textarea( $data );
    }
    else {
    $output = stripslashes( trim($data) );
    }
    return $output;
    }

    function createSlug($arg) {
    $slug = trim(strtolower($arg));
    $slug = str_replace(‘ ‘, ‘_’, $slug);
    $slug = preg_replace(‘/[^a-zA-Z0-9]/’, ‘_’, $slug);
    return $slug;
    }

    function getAttachmenturl($attc_id, $size=’full’) {
    global $switched, $wpdb;
    $imageAttachment = “”;
    if ( is_numeric( $attc_id ) ) {
    if($this->config[‘multi’] === true) {
    switch_to_blog(1);
    $imageAttachment = wp_get_attachment_image_src( $attc_id, $size );
    restore_current_blog();
    }
    else $imageAttachment = wp_get_attachment_image_src( $attc_id, $size );
    return $imageAttachment[0];
    }
    }

    /**
    * Function to get default options
    */
    function getDefaultOptions() {
    if( is_array($this->fields_array) && !empty($this->fields_array) ) {
    foreach($this->fields_array as $field) {
    if(isset($field[‘id’]) && !in_array($field[‘type’], $this->do_not_save)) {
    $default_value = ( isset($field[‘default’]) && !empty($field[‘default’]) ) ? $field[‘default’] : “”;
    if($field[‘type’] == “multicheck”) {
    $multicheck = array();
    if(is_array($default_value)) {
    foreach($default_value as $options) {
    $multicheck[] = $options;
    }
    $save_data[$field[‘id’]] = $multicheck;
    }
    }
    elseif($field[‘type’] == “typography”) {
    $typography = array();
    if(is_array($default_value)) {
    foreach($default_value as $typo_name => $typo_value) {
    $typography[$typo_name] = $typo_value;
    }
    $save_data[$field[‘id’]] = $typography;
    }
    }
    else {
    $save_data[$field[‘id’]] = $default_value;
    }
    }
    }
    return $save_data;
    }
    else return false;
    }

    /**
    * Function to insert default values
    */
    function aofLoaddefault() {
    $default_options = $this->aofgetOptions( $this->option_name );
    if ( false === $default_options ) {
    $default_options = $this->getDefaultOptions();
    if(!empty($default_options)) {
    if($this->config[‘multi’] === true) {
    add_site_option( $this->option_name, $default_options );
    }
    else {
    add_option( $this->option_name, $default_options );
    }
    }
    }

    }

    /**
    * Function to show notices for plugin actions
    */
    function adminNotices() {
    if( isset($_GET[‘status’]) && $_GET[‘status’] == “updated”) {
    $message = __( ‘Settings saved.’, ‘aof’);
    echo “{$message}”;
    }
    if( isset($_GET[‘status’]) && $_GET[‘status’] == “error”) {
    $message = __( ‘Error: Settings not saved.’, ‘aof’);
    echo “{$message}”;
    }
    }

    }
    }

LEAVE A REPLY