Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r15366 r17254  
    77 */
    88
     9define('IFRAME_REQUEST' , true);
     10
    911/** WordPress Administration Bootstrap */
    1012require_once('./admin.php');
     13
    1114header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
    1215
     
    2528function press_it() {
    2629    // define some basic variables
     30    $quick = array();
    2731    $quick['post_status'] = 'draft'; // set as draft first
    2832    $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null;
     
    6064        wp_die($upload);
    6165    } 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
    6278        $quick['ID'] = $post_ID;
    6379        wp_update_post($quick);
     
    111127                <h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2>
    112128                <div class="inside">
    113                     <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo wp_htmledit_pre( $selection ); ?></textarea>
     129                    <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo esc_textarea( $selection ); ?></textarea>
    114130                    <p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p>
    115131                </div>
     
    318334addLoadEvent = 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();}}};
    319335var 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() ?>'};
    320 var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this';
     336var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>;
    321337var photostorage = false;
    322338//]]>
     
    328344    do_action('admin_head');
    329345
    330     if ( user_can_richedit() )
     346    if ( user_can_richedit() ) {
    331347        wp_tiny_mce( true, array( 'height' => '370' ) );
     348        add_action( 'admin_print_footer_scripts', 'wp_tiny_mce_preload_dialogs', 30 );
     349    }
    332350?>
    333351    <script type="text/javascript">
     
    464482
    465483            <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>
    470484                <div class="inside">
    471485                    <p>
    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 } ?>
     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                        } ?>
    478494                        <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" id="saving" style="display:none;" />
    479495                    </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; ?>
    480511                </div>
    481512            </div>
Note: See TracChangeset for help on using the changeset viewer.