[theme-reviewers] THEME: Suffusion - 3.5.4
Simon Prosser
pross at pross.org.uk
Sun Jul 4 01:12:50 UTC 2010
On 04/07/2010 01:09, Sayontan Sinha wrote:
> Pick the very first one for example, which says that there is no index
> called "#horizontal-outer-widgets-1 a:hover/color" in
> theme-definitions.php. That is incorrect information and you really need
> to see the code to see how it works. This particular index has been
> defined multiple times, and there is an inheritance array defined, so if
> the variable is not defined in one place it picks it from the parent etc.
first few examples:
if ($style_settings[$mapped_style] != null) {
$style_settings[$mapped_style] is not defined so you get the Notice.
if ( isset($style_settings[$mapped_style]) ) {
does the same thing with no errors.
else {
$parent = $style_settings["parent"];
$style_settings["parent"] is empty and causing the Notice, so again we
check:
else {
if ( isset( $style_settings["parent"] ) ) { $parent =
$style_settings["parent"]; }
Most of the admin section errors come from this section:
foreach ($options as $value) {
if (!isset($suffusion_options[$value['id']])) {
$$value['id'] = $value['std'];
}
else {
$$value['id'] = $suffusion_options[$value['id']];
}
}
which can be written as:
foreach ($options as $value) {
if ( isset( $value['id'] ) ) {
if (!isset($suffusion_options[$value['id']])) {
if ( isset( $value['std'] ) ) {
$$value['id'] = $value['std'];
}
}
else {
$$value['id'] = $suffusion_options[$value['id']];
}
}
}
The snippet above is used in numerous files to get the theme options and
is responsible for 99% of the notices displayed.
--
MyBlog : http://www.pross.org.uk/
Plugins : http://www.pross.org.uk/plugins/
Themes: http://wordpress.org/extend/themes/profile/pross
More information about the theme-reviewers
mailing list