Plugin Directory

Changeset 1985016


Ignore:
Timestamp:
12/04/2018 09:57:25 AM (7 years ago)
Author:
p4wparamjeet
Message:

Bug Fixed issue #how to display sidebar

Location:
register-sidebar-by-admin/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • register-sidebar-by-admin/trunk/register-sidebar-by-admin.php

    r1984854 r1985016  
    8282                if(!$is_nonce_valid) return array('status'=>false,'msg'=>"Error occurred! Form not secure.");
    8383                $_new_sidebars = array();
    84                 $key = 'dyn-sidebar-' . sanitize_key( $data['_dyn_sidebar_name'] );
     84                $key = 'register-sidebar-by-admin-' . sanitize_key( $data['_dyn_sidebar_name'] );
    8585                $_new_sidebars[$key] = array('id'=>$key,'name'=>$data['_dyn_sidebar_name'],'description'=>$data['_dyn_sidebar_description']);
    8686                if($_old_sidebars = get_option('_dynamic_register_sidebars')){
     
    129129    public function register_sidebars_by_admin_view_callback(){
    130130        echo '<div class="wrap"><div id="icon-tools" class="icon32"></div>';
    131         echo '<h2>Dynamically Register Sidebars</h2>';
     131        echo '<h2>Register Sidebars By Admin</h2>';
    132132        $response = null;
    133133        if(isset($_REQUEST['frm-action']) && !empty($_REQUEST['frm-action'])){ /*Apply Form Action*/
     
    149149        <?php } ?>
    150150        <ul class="dynamic_sidebar_list">
    151         <?php foreach ($_register_siderbar_arr as $sidebar ) { ?>
     151        <?php
     152        $count_sidebar = 1;
     153        foreach ($_register_siderbar_arr as $sidebar ) { ?>
    152154            <li>
    153155                <div class="item" data-sidebar-id="<?php echo $sidebar['id'];?>">
    154156                    <span><?php echo ucwords( $sidebar['name'] );?></span>
     157                    <?php if ( $count_sidebar != 1 ): echo '<span>Sidebar Key - '.'register-sidebar-by-admin-' . sanitize_key( $sidebar['name'] ).'</span>'; endif; $count_sidebar = $count_sidebar + 1?>
    155158                    <?php if($_register_siderbar && array_key_exists($sidebar['id'],$_register_siderbar)){ ?>
    156159                        <a class="actions edit-sidebar" title="Edit Sidebar" href="javascript:"><span class="dashicons dashicons-edit"></span></a>
Note: See TracChangeset for help on using the changeset viewer.