6
6
* @subpackage Press_This
9
define('IFRAME_REQUEST' , true);
9
11
/** WordPress Administration Bootstrap */
10
12
require_once('./admin.php');
11
14
header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
13
16
if ( ! current_user_can('edit_posts') )
25
28
function press_it() {
26
29
// define some basic variables
27
31
$quick['post_status'] = 'draft'; // set as draft first
28
32
$quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null;
29
33
$quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null;
59
63
wp_delete_post($post_ID);
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 );
62
78
$quick['ID'] = $post_ID;
63
79
wp_update_post($quick);
110
126
<div class="postbox">
111
127
<h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2>
112
128
<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>
114
130
<p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p>
318
334
addLoadEvent = 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();}}};
319
335
var 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';
336
var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>;
321
337
var photostorage = false;
327
343
do_action('admin_print_scripts');
328
344
do_action('admin_head');
330
if ( user_can_richedit() )
346
if ( user_can_richedit() ) {
331
347
wp_tiny_mce( true, array( 'height' => '370' ) );
348
add_action( 'admin_print_footer_scripts', 'wp_tiny_mce_preload_dialogs', 30 );
333
351
<script type="text/javascript">
334
352
function insert_plain_editor(text) {
463
481
<div class="photolist"></div>
465
483
<div id="submitdiv" class="stuffbox">
466
<div class="handlediv" title="<?php _e( 'Click to toggle' ); ?>">
469
<h3><?php _e('Publish') ?></h3>
470
484
<div class="inside">
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" />
476
<br /><br /><input class="button-primary" type="submit" name="review" value="<?php esc_attr_e('Submit for Review') ?>" id="review" />
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 );
492
submit_button( __( 'Submit for Review' ), 'primary', 'review', false );
478
494
<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" id="saving" style="display:none;" />
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' );
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>
510
<?php endif; endif; ?>