0
votes

I have spent several hours with my wordpress Theme. It is not compatible with WP version 3.4/ 3.51. When DEBUG is set to TRUE / available: Many Notifications appear. As for now I have completed all notifications, only one is left. I can´t find any solutions. I hope someone can help me. I have only basic knowleadge in PHP.

Notice: Undefined index: type in

<?php foreach ($options as $value) { 
switch ( $value['type'] ){
case "section": $i++;  ?>   

This is what notification is for: switch ( $value['type'] ){


Here is part of page. Itś a Theme Option page for my Theme.

    <form method="post" enctype="multipart/form-data" >         
    <div class="info top-info"> 
     <div class="settingsaved">
        <?php
// Form results if ( isset( $_REQUEST['saved'] ) ) echo '<div id="message" class="updated2 fade"><p><strong>Settings Saved</strong></p></div>';
if ( isset( $_REQUEST['reset'] ) ) echo '<div id="message" class="updated2 fade"><p><strong>Settings Reset</strong></p></div>';
?></div>        
<div style="float: right;"><input type="submit" name="save" class="button-primary  save-options" value="Save Changes"></div><div style="clear: both;"></div></div><div id="content" class="clearfix"><div id="options_tabs" class="ui-tabs">
<ul class="options_tabs ui-tabs-nav">
<?php foreach ($options as $value) { 
switch ( $value['type'] ){case "section": $i++;                 
?><li class="ui-state-default ui-corner-top">
<a href="#option_<?php echo $value['id']; ?>">
<?php if ($value['icon']){ ?>
<img src="<?php echo $theme_directory ?>mm/files/images/icons/<?php echo $value['icon'] ?>"/>   
<?php } ?>
div style=" display: inline-block; margin-left: 6px; margin-top: -1px;position: absolute;"><?php echo $value['name']; ?></div><span></span></a></li>
<?php break;
}}?>
</ul><?php foreach ($options as $value) {
switch ( $value['type'] ) {
// --> open the option section
case "open": ?><?php break;// --> create a subheadline
case "subhead": ?>
<div class="mmtheme-sub-header"> <h2> <?php echo $value['name']; ?>  
<div style="float: right;"><a href="#" class="info-icon">Description</a><div class="description"><div class="inner"><?php echo htmlspecialchars_decode( $value['desc'] ); ?></div></div></div> </h2></div>
<?php break;    
// --> close the option section
case "subhead2": ?>

Here is code for mm.php

LINK TO FULL PHP FILE ( mm-includes.php )

Looking forward to get a solution, Thanks in advance!


&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Thanks to tJerry! You solved my problems!

I have one notice left, appear now - below is notice and suorce. Nice if I get it off my eye, anyone?

This is Notice in Theme option.

Notice: Use of undefined constant update_notifier - assumed 'update_notifier' in \wp-content \themes\bardot\includes\update_notifier.php on line 17

*line 17 *

    add_dashboard_page( $theme_data['Name'] . 'Theme Updates ', '&nbsp;<span class="update-plugins 

count-2"><span class="update-count">New Theme Update</span></span>', 'administrator','m3-

updates', update_notifier);
1
What's the output of print_r($options)? - JJJ
I hate developers that write code without WP_DEBUG enabled... - brasofilo

1 Answers

1
votes

If you insert this before the switch statement, your notice will disappear, as the switch block will be skipped if the value isn't set.

if(!isset($value['type']))
    continue;