Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/wp-admin/press-this.php

    r17254 r15366  
    77 */
    88
    9 define('IFRAME_REQUEST' , true);
    10 
    119/** WordPress Administration Bootstrap */
    1210require_once('./admin.php');
    13 
    1411header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
    1512
     
    2825function press_it() {
    2926    // define some basic variables
    30     $quick = array();
    3127    $quick['post_status'] = 'draft'; // set as draft first
    3228    $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null;
     
    6460        wp_die($upload);
    6561    } else {
    66         // Post formats
    67         if ( current_theme_supports( 'post-formats' ) && isset( $_POST['post_format'] ) ) {
    68             $post_formats = get_theme_support( 'post-formats' );
    69             if ( is_array( $post_formats ) ) {
    70                 $post_formats = $post_formats[0];
    71                 if ( in_array( $_POST['post_format'], $post_formats ) )
    72                     set_post_format( $post_ID, $_POST['post_format'] );
    73                 elseif ( '0' == $_POST['post_format'] )
    74                     set_post_format( $post_ID, false );
    75             }
    76         }
    77 
    7862        $quick['ID'] = $post_ID;
    7963        wp_update_post($quick);
     
    127111                <h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2>
    128112                <div class="inside">
    129                     <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo esc_textarea( $selection ); ?></textarea>
     113                    <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo wp_htmledit_pre( $selection ); ?></textarea>
    130114                    <p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p>
    131115                </div>
     
    334318addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
    335319var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};
    336 var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>;
     320var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this';
    337321var photostorage = false;
    338322//]]>
     
    344328    do_action('admin_head');
    345329
    346     if ( user_can_richedit() ) {
     330    if ( user_can_richedit() )
    347331        wp_tiny_mce( true, array( 'height' => '370' ) );
    348         add_action( 'admin_print_footer_scripts', 'wp_tiny_mce_preload_dialogs', 30 );
    349     }
    350332?>
    351333    <script type="text/javascript">
     
    482464
    483465            <div id="submitdiv" class="stuffbox">
     466                <div class="handlediv" title="<?php _e( 'Click to toggle' ); ?>">
     467                    <br/>
     468                </div>
     469                <h3><?php _e('Publish') ?></h3>
    484470                <div class="inside">
    485471                    <p>
    486                     <?php
    487                         submit_button( __( 'Save Draft' ), 'button', 'draft', false, array( 'id' => 'save' ) );
    488                         if ( current_user_can('publish_posts') ) {
    489                             submit_button( __( 'Publish' ), 'primary', 'publish', false );
    490                         } else {
    491                             echo '<br /><br />';
    492                             submit_button( __( 'Submit for Review' ), 'primary', 'review', false );
    493                         } ?>
     472                        <input class="button" type="submit" name="draft" value="<?php esc_attr_e('Save Draft') ?>" id="save" />
     473                        <?php if ( current_user_can('publish_posts') ) { ?>
     474                            <input class="button-primary" type="submit" name="publish" value="<?php esc_attr_e('Publish') ?>" id="publish" />
     475                        <?php } else { ?>
     476                            <br /><br /><input class="button-primary" type="submit" name="review" value="<?php esc_attr_e('Submit for Review') ?>" id="review" />
     477                        <?php } ?>
    494478                        <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" id="saving" style="display:none;" />
    495479                    </p>
    496                     <?php if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) :
    497                             $post_formats = get_theme_support( 'post-formats' );
    498                             if ( is_array( $post_formats[0] ) ) :
    499                                 $default_format = get_option( 'default_post_format', '0' );
    500                         ?>
    501                     <p>
    502                         <label for="post_format"><?php _e( 'Post Format:' ); ?>
    503                         <select name="post_format" id="post_format">
    504                             <option value="0"><?php _e( 'Standard' ); ?></option>
    505                         <?php foreach ( $post_formats[0] as $format ): ?>
    506                             <option<?php selected( $default_format, $format ); ?> value="<?php echo esc_attr( $format ); ?>"> <?php echo esc_html( get_post_format_string( $format ) ); ?></option>
    507                         <?php endforeach; ?>
    508                         </select></label>
    509                     </p>
    510                     <?php endif; endif; ?>
    511480                </div>
    512481            </div>
Note: See TracChangeset for help on using the changeset viewer.