Ticket #6802: discussion_options_action_hook.diff
| File discussion_options_action_hook.diff, 4.8 kB (added by filosofo, 4 months ago) |
|---|
-
wp-content/themes/default/functions.php
old new 7 7 'after_title' => '</h2>', 8 8 )); 9 9 10 function kubrick_avatars() { 11 ?><h3><?php _e('Avatars') ?></h3> 12 13 <p><?php _e('By default WordPress uses <a href="http://gravatar.com/">Gravatars</a> — short for Globally Recognized Avatars — for the pictures that show up next to comments. Plugins may override this.'); ?></p> 14 15 <?php // the above would be a good place to link to codex documentation on the gravatar functions, for putting it in themes. anything like that? ?> 16 17 <table class="form-table"> 18 <tr valign="top"> 19 <th scope="row"><?php _e('Avatar display') ?></th> 20 <td> 21 <?php 22 $yesorno = array(0 => __("Don’t show Avatars"), 1 => __('Show Avatars')); 23 foreach ( $yesorno as $key => $value) { 24 $selected = (get_option('show_avatars') == $key) ? 'checked="checked"' : ''; 25 echo "\n\t<label><input type='radio' name='show_avatars' value='$key' $selected> $value</label><br />"; 26 } 27 ?> 28 </td> 29 </tr> 30 <tr valign="top"> 31 <th scope="row"><?php _e('Maximum Rating') ?></th> 32 <td> 33 34 <?php 35 $ratings = array( 'G' => __('G — Suitable for all audiences'), 'PG' => __('PG — Possibly offensive, usually for audiences 13 and above'), 'R' => __('R — Intended for adult audiences above 17'), 'X' => __('X — Even more mature than above')); 36 foreach ($ratings as $key => $rating) : 37 $selected = (get_option('avatar_rating') == $key) ? 'checked="checked"' : ''; 38 echo "\n\t<label><input type='radio' name='avatar_rating' value='$key' $selected> $rating</label><br />"; 39 endforeach; 40 ?> 41 42 </td> 43 </tr> 44 45 </table><?php 46 47 } 48 49 add_action('discussion_options', 'kubrick_avatars'); 50 add_filter('discussion_page_options', create_function('$a','return array_unique(array_merge($a, array("show_avatars","avatar_rating")));')); 51 10 52 function kubrick_head() { 11 53 $head = "<style type='text/css'>\n<!--"; 12 54 $output = ''; -
wp-admin/options-discussion.php
old new 1 1 <?php 2 2 require_once('admin.php'); 3 3 4 $discussion_page_options = apply_filters('discussion_page_options', array('default_pingback_flag','default_ping_status','default_comment_status','comments_notify','moderation_notify','comment_moderation','require_name_email','comment_whitelist','comment_max_links','moderation_keys','blacklist_keys')); 5 4 6 $title = __('Discussion Settings'); 5 7 $parent_file = 'options-general.php'; 6 8 … … 76 78 </tr> 77 79 </table> 78 80 79 < h3><?php _e('Avatars') ?></h3>81 <?php do_action('discussion_options'); ?> 80 82 81 <p><?php _e('By default WordPress uses <a href="http://gravatar.com/">Gravatars</a> — short for Globally Recognized Avatars — for the pictures that show up next to comments. Plugins may override this.'); ?></p>82 83 <?php // the above would be a good place to link to codex documentation on the gravatar functions, for putting it in themes. anything like that? ?>84 85 <table class="form-table">86 <tr valign="top">87 <th scope="row"><?php _e('Avatar display') ?></th>88 <td>89 <?php90 $yesorno = array(0 => __("Don’t show Avatars"), 1 => __('Show Avatars'));91 foreach ( $yesorno as $key => $value) {92 $selected = (get_option('show_avatars') == $key) ? 'checked="checked"' : '';93 echo "\n\t<label><input type='radio' name='show_avatars' value='$key' $selected> $value</label><br />";94 }95 ?>96 </td>97 </tr>98 <tr valign="top">99 <th scope="row"><?php _e('Maximum Rating') ?></th>100 <td>101 102 <?php103 $ratings = array( 'G' => __('G — Suitable for all audiences'), 'PG' => __('PG — Possibly offensive, usually for audiences 13 and above'), 'R' => __('R — Intended for adult audiences above 17'), 'X' => __('X — Even more mature than above'));104 foreach ($ratings as $key => $rating) :105 $selected = (get_option('avatar_rating') == $key) ? 'checked="checked"' : '';106 echo "\n\t<label><input type='radio' name='avatar_rating' value='$key' $selected> $rating</label><br />";107 endforeach;108 ?>109 110 </td>111 </tr>112 113 </table>114 115 116 83 <p class="submit"> 117 84 <input type="hidden" name="action" value="update" /> 118 <input type="hidden" name="page_options" value=" default_pingback_flag,default_ping_status,default_comment_status,comments_notify,moderation_notify,comment_moderation,require_name_email,comment_whitelist,comment_max_links,moderation_keys,blacklist_keys,show_avatars,avatar_rating" />85 <input type="hidden" name="page_options" value="<?php echo implode(', ', $discussion_page_options); ?>" /> 119 86 <input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" /> 120 87 </p> 121 88 </form>
