Changeset 8989 for trunk/wp-admin/themes.php
- Timestamp:
- 09/26/2008 06:43:53 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/themes.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/themes.php
r8656 r8989 59 59 60 60 $themes = array_slice( $themes, $start, $per_page ); 61 62 function theme_update_available( $theme ) { 63 static $themes_update; 64 if ( !isset($themes_update) ) 65 $themes_update = get_option('update_themes'); 66 67 if ( isset($theme->stylesheet) ) 68 $stylesheet = $theme->stylesheet; 69 elseif ( isset($theme['Stylesheet']) ) 70 $stylesheet = $theme['Stylesheet']; 71 else 72 return false; //No valid info passed. 73 74 if ( isset($themes_update->response[ $stylesheet ]) ) { 75 $update = $themes_update->response[ $stylesheet ]; 76 $details_url = add_query_arg(array('TB_iframe' => 'true', 'width' => 1024, 'height' => 800), $update['url']); //Theme browser inside WP? replace this, Also, theme preview JS will override this on the available list. 77 $update_url = wp_nonce_url('update.php?action=upgrade-theme&theme=' . urlencode($stylesheet), 'upgrade-theme_' . $stylesheet); 78 79 if ( ! current_user_can('update_themes') ) 80 printf( __('<p>There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a>.</p>'), $ct->name, $details_url, $update['new_version']); 81 else if ( empty($update->package) ) 82 printf( __('<p>There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a> <em>automatic upgrade unavailable for this theme</em>.</p>'), $ct->name, $details_url, $update['new_version']); 83 else 84 printf( __('<p>There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a> or <a href="%4$s">upgrade automatically</a>.</p>'), $ct->name, $details_url, $update['new_version'], $update_url ); 85 } 86 } 61 87 62 88 ?> … … 78 104 <p><?php _e('Tags:'); ?> <?php echo join(', ', $ct->tags); ?></p> 79 105 <?php endif; ?> 106 <?php theme_update_available($ct); ?> 107 80 108 </div> 81 109 … … 142 170 <?php if ( $tags ) : ?> 143 171 <p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p> 172 <?php endif; ?> 173 <?php theme_update_available( $themes[$theme_name] ); ?> 144 174 <noscript><p class="themeactions"><a href="<?php echo $preview_link; ?>" title="<?php echo $preview_text; ?>"><?php _e('Preview'); ?></a> <a href="<?php echo $activate_link; ?>" title="<?php echo $activate_text; ?>"><?php _e('Activate'); ?></a></p></noscript> 145 <?php endif; ?>146 175 <div style="display:none;"><a class="previewlink" href="<?php echo $preview_link; ?>"><?php echo $preview_text; ?></a> <a class="activatelink" href="<?php echo $activate_link; ?>"><?php echo $activate_text; ?></a></div> 147 176 <?php endif; // end if not empty theme_name ?>
Note: See TracChangeset
for help on using the changeset viewer.