Changeset 382464
- Timestamp:
- 05/08/2011 02:22:10 PM (15 years ago)
- Location:
- automatic-post-scheduler/trunk
- Files:
-
- 2 edited
-
plugin.php (modified) (1 diff)
-
settings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
automatic-post-scheduler/trunk/plugin.php
r382443 r382464 80 80 ?> 81 81 <div class="misc-pub-section" id="aps_schedule_post"> 82 <label><input type="checkbox" id="aps_schedule_post" name="aps_schedule_post" <?php echo ( $post->post_status == 'publish') ? '' : 'checked="checked"'; ?>/> <?php _e( 'Schedule as soon as posible', 'autoscheduler' ); ?></label>82 <label><input type="checkbox" id="aps_schedule_post" name="aps_schedule_post" <?php echo ( aps_current_user_disable_default() ) ? '' : 'checked="checked"'; ?>/> <?php _e( 'Schedule as soon as posible', 'autoscheduler' ); ?></label> 83 83 </div> 84 84 <?php -
automatic-post-scheduler/trunk/settings.php
r382439 r382464 93 93 } 94 94 95 function aps_current_user_disable_default( $uid = false ) { 96 global $current_user; 97 98 if( $uid === false ) 99 $uid = $current_user->ID; 100 return get_user_meta( $uid, 'aps_disable_default', true ); 101 } 102 103 add_filter( 'personal_options', 'aps_user_options' ); 104 function aps_user_options( $user ) { 105 if( !user_can( $user->ID, 'publish_posts' ) ) 106 return; 107 $disable_default = aps_current_user_disable_default(); 108 ?> 109 <tr> 110 <th scope="row"><?php _e( 'Automatic post scheduler', 'autoscheduler' ); ?></th> 111 <td><label><input type="checkbox" value="1" <?php echo $disable_default ? 'checked="checked' : ""; ?>" name="aps_disable_default" id="aps_disable_default" /> <?php _e( 'Disable scheduling of my own posts by default (can be over-ridden for individual posts)' ); ?></label></td> 112 </tr> 113 114 <?php 115 } 116 117 add_action( 'personal_options_update', 'aps_user_options_update' ); 118 add_action( 'edit_user_profile_update', 'aps_user_options_update' ); 119 120 function aps_user_options_update( $uid ) { 121 update_user_meta( $uid, 'aps_disable_default', isset($_POST['aps_disable_default']) ? $_POST['aps_disable_default'] : '' ); 122 } 123 95 124 ?>
Note: See TracChangeset
for help on using the changeset viewer.