Compare commits
98 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95841f7fd5 | ||
|
|
fbe5e94e96 | ||
|
|
8e3d139cd3 | ||
|
|
a547527125 | ||
|
|
260fe48798 | ||
|
|
9775268b25 | ||
|
|
6350a22e45 | ||
|
|
b3458cc79c | ||
|
|
57dad41e07 | ||
|
|
82fbf6950d | ||
|
|
0bdae51fe5 | ||
|
|
f1f76a4e4c | ||
|
|
9681a5253d | ||
|
|
a3dfb66515 | ||
|
|
af6fef4026 | ||
|
|
623d899936 | ||
|
|
6fef2be21e | ||
|
|
bb8543539a | ||
|
|
f1452273f9 | ||
|
|
3d3957f592 | ||
|
|
63c713caf6 | ||
|
|
c756bd4921 | ||
|
|
e88c4638a2 | ||
|
|
f98eb99312 | ||
|
|
c11965b203 | ||
|
|
ebf45790f5 | ||
|
|
c7c347c02d | ||
|
|
53c7f2acf5 | ||
|
|
b618aca0cf | ||
|
|
3d8c9363a0 | ||
|
|
617b650b27 | ||
|
|
d322fdee11 | ||
|
|
69ce5e7ed7 | ||
|
|
d3dd8860e6 | ||
|
|
c23720b30f | ||
|
|
796f7392b6 | ||
|
|
a4373b7ef2 | ||
|
|
a5902a590b | ||
|
|
8a039537be | ||
|
|
53ff53bc24 | ||
|
|
854dd6ff22 | ||
|
|
12158471b1 | ||
|
|
818187d0d4 | ||
|
|
133af6e1d7 | ||
|
|
f271e5408f | ||
|
|
cfb0604939 | ||
|
|
6e18c2cdcb | ||
|
|
385af418f4 | ||
|
|
51b70185ba | ||
|
|
85c711e5e7 | ||
|
|
cdccf9cf7c | ||
|
|
41978f0a6b | ||
|
|
e27995486a | ||
|
|
6ee80c9cce | ||
|
|
d79a67e354 | ||
|
|
535aafc0e7 | ||
|
|
3847d42a39 | ||
|
|
ff09d34fb6 | ||
|
|
58f45d75d9 | ||
|
|
7bf0947a5f | ||
|
|
d64fa01ac3 | ||
|
|
0faa107570 | ||
|
|
070e860de1 | ||
|
|
50845628eb | ||
|
|
cce06454da | ||
|
|
97d0148bdf | ||
|
|
d96579b9c7 | ||
|
|
fc904b8997 | ||
|
|
d79197327d | ||
|
|
8dd1bb2274 | ||
|
|
bc8a828561 | ||
|
|
71d449cc8e | ||
|
|
3c4c934a0f | ||
|
|
6f6f9972b4 | ||
|
|
c3fd5515b9 | ||
|
|
42e991f6ea | ||
|
|
b789427f14 | ||
|
|
f54ca4c88c | ||
|
|
f091b2d209 | ||
|
|
c37e9730d7 | ||
|
|
1c4fea65ba | ||
|
|
8a0e96d142 | ||
|
|
95f76c6970 | ||
|
|
a013a45eff | ||
|
|
c2cea0e3ed | ||
|
|
141b34477f | ||
|
|
8322d8aca0 | ||
|
|
8530c27fd9 | ||
|
|
61c836b9d3 | ||
|
|
a5c8cde108 | ||
|
|
6f44a01e9c | ||
|
|
92d74a09f9 | ||
|
|
892c04af44 | ||
|
|
c3424a7fb3 | ||
|
|
9902f02dfa | ||
|
|
da4c482270 | ||
|
|
db7d4b204b | ||
|
|
ec22eb6f6a |
@@ -8,7 +8,7 @@
|
||||
<body>
|
||||
<h1 id="logo" style="text-align: center">
|
||||
<img alt="WordPress" src="wp-admin/images/wordpress-logo.png" />
|
||||
<br /> Version 2.9
|
||||
<br /> Version 2.8.4
|
||||
</h1>
|
||||
<p style="text-align: center">Semantic Personal Publishing Platform</p>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<h1>Upgrading</h1>
|
||||
<p>Before you upgrade anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</p>
|
||||
<h2>Upgrading from any previous WordPress to 2.9:</h2>
|
||||
<h2>Upgrading from any previous WordPress to 2.8.4:</h2>
|
||||
<ol>
|
||||
<li>Delete your old WP files, saving ones you've modified.</li>
|
||||
<li>Upload the new files.</li>
|
||||
@@ -57,7 +57,7 @@
|
||||
<h1>System Recommendations</h1>
|
||||
<ul>
|
||||
<li>PHP version <strong>4.3</strong> or higher.</li>
|
||||
<li>MySQL version <strong>4.1.2</strong> or higher.</li>
|
||||
<li>MySQL version <strong>4.0</strong> or higher.</li>
|
||||
<li>... and a link to <a href="http://wordpress.org/">http://wordpress.org</a> on your site.</li>
|
||||
</ul>
|
||||
<p>WordPress is the official continuation of <a href="http://cafelog.com/">b2/cafélog</a>, which came from Michel V. The work has been continued by the <a href="http://wordpress.org/about/">WordPress developers</a>. If you would like to support WordPress, please consider <a href="http://wordpress.org/donate/">donating</a>.</p>
|
||||
|
||||
@@ -37,8 +37,8 @@ if ( ! is_user_logged_in() ) {
|
||||
$x->send();
|
||||
}
|
||||
|
||||
if ( !empty( $_REQUEST['action']) )
|
||||
do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] );
|
||||
if ( !empty( $_POST['action']) )
|
||||
do_action( 'wp_ajax_nopriv_' . $_POST['action'] );
|
||||
|
||||
die('-1');
|
||||
}
|
||||
@@ -91,8 +91,6 @@ case 'wp-compression-test' :
|
||||
echo $test_str;
|
||||
die;
|
||||
} elseif ( 2 == $_GET['test'] ) {
|
||||
if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
|
||||
die('-1');
|
||||
if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
|
||||
header('Content-Encoding: deflate');
|
||||
$out = gzdeflate( $test_str, 1 );
|
||||
@@ -113,23 +111,6 @@ case 'wp-compression-test' :
|
||||
|
||||
die('0');
|
||||
break;
|
||||
case 'imgedit-preview' :
|
||||
$post_id = intval($_GET['postid']);
|
||||
if ( empty($post_id) || !current_user_can('edit_post', $post_id) )
|
||||
die('-1');
|
||||
|
||||
check_ajax_referer( "image_editor-$post_id" );
|
||||
|
||||
include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
|
||||
if ( !stream_preview_image($post_id) )
|
||||
die('-1');
|
||||
|
||||
die();
|
||||
break;
|
||||
case 'oembed-cache' :
|
||||
$return = ( $wp_embed->cache_oembed( $_GET['post'] ) ) ? '1' : '0';
|
||||
die( $return );
|
||||
break;
|
||||
default :
|
||||
do_action( 'wp_ajax_' . $_GET['action'] );
|
||||
die('0');
|
||||
@@ -162,18 +143,15 @@ function _wp_ajax_delete_comment_response( $comment_id ) {
|
||||
if ( 0 != $total % $per_page && 1 != mt_rand( 1, $per_page ) ) // Only do the expensive stuff on a page-break, and about 1 other time per page
|
||||
die( (string) time() );
|
||||
|
||||
$post_id = 0;
|
||||
$status = 'total_comments'; // What type of comment count are we looking for?
|
||||
$parsed = parse_url( $url );
|
||||
if ( isset( $parsed['query'] ) ) {
|
||||
parse_str( $parsed['query'], $query_vars );
|
||||
if ( !empty( $query_vars['comment_status'] ) )
|
||||
$status = $query_vars['comment_status'];
|
||||
if ( !empty( $query_vars['p'] ) )
|
||||
$post_id = (int) $query_vars['p'];
|
||||
}
|
||||
|
||||
$comment_count = wp_count_comments($post_id);
|
||||
$comment_count = wp_count_comments();
|
||||
$time = time(); // The time since the last comment count
|
||||
|
||||
if ( isset( $comment_count->$status ) ) // We're looking for a known type of comment count
|
||||
@@ -203,36 +181,19 @@ function _wp_ajax_delete_comment_response( $comment_id ) {
|
||||
$id = isset($_POST['id'])? (int) $_POST['id'] : 0;
|
||||
switch ( $action = $_POST['action'] ) :
|
||||
case 'delete-comment' : // On success, die with time() instead of 1
|
||||
check_ajax_referer( "delete-comment_$id" );
|
||||
if ( !$comment = get_comment( $id ) )
|
||||
die( (string) time() );
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
|
||||
die('-1');
|
||||
|
||||
check_ajax_referer( "delete-comment_$id" );
|
||||
$status = wp_get_comment_status( $comment->comment_ID );
|
||||
|
||||
if ( isset($_POST['trash']) && 1 == $_POST['trash'] ) {
|
||||
if ( 'trash' == $status )
|
||||
if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
|
||||
if ( 'spam' == wp_get_comment_status( $comment->comment_ID ) )
|
||||
die( (string) time() );
|
||||
$r = wp_trash_comment( $comment->comment_ID );
|
||||
} elseif ( isset($_POST['untrash']) && 1 == $_POST['untrash'] ) {
|
||||
if ( 'trash' != $status )
|
||||
die( (string) time() );
|
||||
$r = wp_untrash_comment( $comment->comment_ID );
|
||||
} elseif ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
|
||||
if ( 'spam' == $status )
|
||||
die( (string) time() );
|
||||
$r = wp_spam_comment( $comment->comment_ID );
|
||||
} elseif ( isset($_POST['unspam']) && 1 == $_POST['unspam'] ) {
|
||||
if ( 'spam' != $status )
|
||||
die( (string) time() );
|
||||
$r = wp_unspam_comment( $comment->comment_ID );
|
||||
} elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) {
|
||||
$r = wp_delete_comment( $comment->comment_ID );
|
||||
$r = wp_set_comment_status( $comment->comment_ID, 'spam' );
|
||||
} else {
|
||||
die('-1');
|
||||
$r = wp_delete_comment( $comment->comment_ID );
|
||||
}
|
||||
|
||||
if ( $r ) // Decide if we need to send back '1' or a more complicated response including page links and comment counts
|
||||
_wp_ajax_delete_comment_response( $comment->comment_ID );
|
||||
die( '0' );
|
||||
@@ -252,18 +213,20 @@ case 'delete-cat' :
|
||||
die('0');
|
||||
break;
|
||||
case 'delete-tag' :
|
||||
$tag_id = (int) $_POST['tag_ID'];
|
||||
check_ajax_referer( "delete-tag_$tag_id" );
|
||||
check_ajax_referer( "delete-tag_$id" );
|
||||
if ( !current_user_can( 'manage_categories' ) )
|
||||
die('-1');
|
||||
|
||||
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
|
||||
if ( !empty($_POST['taxonomy']) )
|
||||
$taxonomy = $_POST['taxonomy'];
|
||||
else
|
||||
$taxonomy = 'post_tag';
|
||||
|
||||
$tag = get_term( $tag_id, $taxonomy );
|
||||
$tag = get_term( $id, $taxonomy );
|
||||
if ( !$tag || is_wp_error( $tag ) )
|
||||
die('1');
|
||||
|
||||
if ( wp_delete_term($tag_id, $taxonomy))
|
||||
if ( wp_delete_term($id, $taxonomy))
|
||||
die('1');
|
||||
else
|
||||
die('0');
|
||||
@@ -342,25 +305,6 @@ case 'delete-post' :
|
||||
else
|
||||
die('0');
|
||||
break;
|
||||
case 'trash-post' :
|
||||
case 'untrash-post' :
|
||||
check_ajax_referer( "{$action}_$id" );
|
||||
if ( !current_user_can( 'delete_post', $id ) )
|
||||
die('-1');
|
||||
|
||||
if ( !get_post( $id ) )
|
||||
die('1');
|
||||
|
||||
if ( 'trash-post' == $action )
|
||||
$done = wp_trash_post( $id );
|
||||
else
|
||||
$done = wp_untrash_post( $id );
|
||||
|
||||
if ( $done )
|
||||
die('1');
|
||||
|
||||
die('0');
|
||||
break;
|
||||
case 'delete-page' :
|
||||
check_ajax_referer( "{$action}_$id" );
|
||||
if ( !current_user_can( 'delete_page', $id ) )
|
||||
@@ -384,19 +328,23 @@ case 'dim-comment' : // On success, die with time() instead of 1
|
||||
$x->send();
|
||||
}
|
||||
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) && !current_user_can( 'moderate_comments' ) )
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
|
||||
die('-1');
|
||||
if ( !current_user_can( 'moderate_comments' ) )
|
||||
die('-1');
|
||||
|
||||
$current = wp_get_comment_status( $comment->comment_ID );
|
||||
if ( $_POST['new'] == $current )
|
||||
die( (string) time() );
|
||||
|
||||
check_ajax_referer( "approve-comment_$id" );
|
||||
if ( in_array( $current, array( 'unapproved', 'spam' ) ) )
|
||||
$r = 0;
|
||||
if ( in_array( $current, array( 'unapproved', 'spam' ) ) ) {
|
||||
check_ajax_referer( "approve-comment_$id" );
|
||||
$result = wp_set_comment_status( $comment->comment_ID, 'approve', true );
|
||||
else
|
||||
} else {
|
||||
check_ajax_referer( "unapprove-comment_$id" );
|
||||
$result = wp_set_comment_status( $comment->comment_ID, 'hold', true );
|
||||
|
||||
}
|
||||
if ( is_wp_error($result) ) {
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'comment',
|
||||
@@ -418,8 +366,11 @@ case 'add-category' : // On the Fly
|
||||
$parent = 0;
|
||||
$post_category = isset($_POST['post_category'])? (array) $_POST['post_category'] : array();
|
||||
$checked_categories = array_map( 'absint', (array) $post_category );
|
||||
$popular_ids = wp_popular_terms_checklist('category', 0, 10, false);
|
||||
$popular_ids = isset( $_POST['popular_ids'] ) ?
|
||||
array_map( 'absint', explode( ',', $_POST['popular_ids'] ) ) :
|
||||
false;
|
||||
|
||||
$x = new WP_Ajax_Response();
|
||||
foreach ( $names as $cat_name ) {
|
||||
$cat_name = trim($cat_name);
|
||||
$category_nicename = sanitize_title($cat_name);
|
||||
@@ -434,43 +385,28 @@ case 'add-category' : // On the Fly
|
||||
wp_category_checklist( 0, $cat_id, $checked_categories, $popular_ids );
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$add = array(
|
||||
$x->add( array(
|
||||
'what' => 'category',
|
||||
'id' => $cat_id,
|
||||
'data' => str_replace( array("\n", "\t"), '', $data),
|
||||
'data' => $data,
|
||||
'position' => -1
|
||||
);
|
||||
) );
|
||||
}
|
||||
if ( $parent ) { // Foncy - replace the parent and all its children
|
||||
$parent = get_category( $parent );
|
||||
$term_id = $parent->term_id;
|
||||
|
||||
while ( $parent->parent ) { // get the top parent
|
||||
$parent = &get_category( $parent->parent );
|
||||
if ( is_wp_error( $parent ) )
|
||||
break;
|
||||
$term_id = $parent->term_id;
|
||||
}
|
||||
|
||||
ob_start();
|
||||
wp_category_checklist( 0, $term_id, $checked_categories, $popular_ids, null, false );
|
||||
dropdown_categories( 0, $parent );
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$add = array(
|
||||
$x->add( array(
|
||||
'what' => 'category',
|
||||
'id' => $term_id,
|
||||
'data' => str_replace( array("\n", "\t"), '', $data),
|
||||
'id' => $parent->term_id,
|
||||
'old_id' => $parent->term_id,
|
||||
'data' => $data,
|
||||
'position' => -1
|
||||
);
|
||||
) );
|
||||
|
||||
}
|
||||
|
||||
ob_start();
|
||||
wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category') ) );
|
||||
$sup = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$add['supplemental'] = array( 'newcat_parent' => $sup );
|
||||
|
||||
$x = new WP_Ajax_Response( $add );
|
||||
$x->send();
|
||||
break;
|
||||
case 'add-link-category' : // On the Fly
|
||||
@@ -591,16 +527,43 @@ case 'add-tag' : // From Manage->Tags
|
||||
if ( !current_user_can( 'manage_categories' ) )
|
||||
die('-1');
|
||||
|
||||
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
|
||||
$tag = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST );
|
||||
|
||||
if ( !$tag || is_wp_error($tag) || (!$tag = get_term( $tag['term_id'], $taxonomy )) ) {
|
||||
echo '<div class="error"><p>' . __('An error has occured. Please reload the page and try again.') . '</p></div>';
|
||||
exit;
|
||||
if ( '' === trim($_POST['name']) ) {
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'tag',
|
||||
'id' => new WP_Error( 'name', __('You did not enter a tag name.') )
|
||||
) );
|
||||
$x->send();
|
||||
}
|
||||
|
||||
echo _tag_row( $tag, '', $taxonomy );
|
||||
exit;
|
||||
if ( !empty($_POST['taxonomy']) )
|
||||
$taxonomy = $_POST['taxonomy'];
|
||||
else
|
||||
$taxonomy = 'post_tag';
|
||||
|
||||
$tag = wp_insert_term($_POST['name'], $taxonomy, $_POST );
|
||||
|
||||
if ( is_wp_error($tag) ) {
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'tag',
|
||||
'id' => $tag
|
||||
) );
|
||||
$x->send();
|
||||
}
|
||||
|
||||
if ( !$tag || (!$tag = get_term( $tag['term_id'], $taxonomy )) )
|
||||
die('0');
|
||||
|
||||
$tag_full_name = $tag->name;
|
||||
$tag_full_name = esc_attr($tag_full_name);
|
||||
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'tag',
|
||||
'id' => $tag->term_id,
|
||||
'position' => '-1',
|
||||
'data' => _tag_row( $tag, '', $taxonomy ),
|
||||
'supplemental' => array('name' => $tag_full_name, 'show-link' => sprintf(__( 'Tag <a href="#%s">%s</a> added' ), "tag-$tag->term_id", $tag_full_name))
|
||||
) );
|
||||
$x->send();
|
||||
break;
|
||||
case 'get-tagcloud' :
|
||||
if ( !current_user_can( 'edit_posts' ) )
|
||||
@@ -636,7 +599,7 @@ case 'get-tagcloud' :
|
||||
break;
|
||||
case 'add-comment' :
|
||||
check_ajax_referer( $action );
|
||||
if ( !current_user_can( 'edit_posts' ) )
|
||||
if ( !current_user_can( 'edit_post', $id ) )
|
||||
die('-1');
|
||||
$search = isset($_POST['s']) ? $_POST['s'] : false;
|
||||
$status = isset($_POST['comment_status']) ? $_POST['comment_status'] : 'all';
|
||||
@@ -711,7 +674,7 @@ case 'replyto-comment' :
|
||||
|
||||
if ( empty($status) )
|
||||
die('1');
|
||||
elseif ( in_array($status, array('draft', 'pending', 'trash') ) )
|
||||
elseif ( in_array($status, array('draft', 'pending') ) )
|
||||
die( __('Error: you are replying to a comment on a draft post.') );
|
||||
|
||||
$user = wp_get_current_user();
|
||||
@@ -922,8 +885,6 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
|
||||
$message = sprintf( __('Draft Saved at %s.'), date_i18n( $draft_saved_date_format ) );
|
||||
|
||||
$supplemental = array();
|
||||
if ( isset($login_grace_period) )
|
||||
$supplemental['session_expired'] = add_query_arg( 'interim-login', 1, wp_login_url() );
|
||||
|
||||
$id = $revision_id = 0;
|
||||
if($_POST['post_ID'] < 0) {
|
||||
@@ -1003,10 +964,15 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
|
||||
case 'autosave-generate-nonces' :
|
||||
check_ajax_referer( 'autosave', 'autosavenonce' );
|
||||
$ID = (int) $_POST['post_ID'];
|
||||
$post_type = ( 'page' == $_POST['post_type'] ) ? 'page' : 'post';
|
||||
if ( current_user_can( "edit_{$post_type}", $ID ) )
|
||||
die( json_encode( array( 'updateNonce' => wp_create_nonce( "update-{$post_type}_{$ID}" ), 'deleteURL' => str_replace( '&', '&', wp_nonce_url( admin_url( $post_type . '.php?action=trash&post=' . $ID ), "trash-{$post_type}_{$ID}" ) ) ) ) );
|
||||
do_action('autosave_generate_nonces');
|
||||
if($_POST['post_type'] == 'post') {
|
||||
if(current_user_can('edit_post', $ID))
|
||||
die(wp_create_nonce('update-post_' . $ID));
|
||||
}
|
||||
if($_POST['post_type'] == 'page') {
|
||||
if(current_user_can('edit_page', $ID)) {
|
||||
die(wp_create_nonce('update-page_' . $ID));
|
||||
}
|
||||
}
|
||||
die('0');
|
||||
break;
|
||||
case 'closed-postboxes' :
|
||||
@@ -1027,7 +993,7 @@ case 'closed-postboxes' :
|
||||
update_usermeta($user->ID, 'closedpostboxes_'.$page, $closed);
|
||||
|
||||
if ( is_array($hidden) ) {
|
||||
$hidden = array_diff( $hidden, array('submitdiv', 'linksubmitdiv') ); // postboxes that are always shown
|
||||
$hidden = array_diff( $hidden, array('submitdiv', 'pagesubmitdiv', 'linksubmitdiv') ); // postboxes that are always shown
|
||||
update_usermeta($user->ID, 'meta-box-hidden_'.$page, $hidden);
|
||||
}
|
||||
|
||||
@@ -1182,7 +1148,10 @@ case 'inline-save-tax':
|
||||
|
||||
break;
|
||||
case 'tag' :
|
||||
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
|
||||
if ( !empty($_POST['taxonomy']) )
|
||||
$taxonomy = $_POST['taxonomy'];
|
||||
else
|
||||
$taxonomy = 'post_tag';
|
||||
|
||||
$tag = get_term( $id, $taxonomy );
|
||||
$_POST['description'] = $tag->description;
|
||||
@@ -1193,7 +1162,7 @@ case 'inline-save-tax':
|
||||
if ( !$tag || is_wp_error( $tag ) )
|
||||
die( __('Tag not updated.') );
|
||||
|
||||
echo _tag_row($tag, '', $taxonomy);
|
||||
echo _tag_row($tag);
|
||||
} else {
|
||||
die( __('Tag not updated.') );
|
||||
}
|
||||
@@ -1212,10 +1181,10 @@ case 'find_posts':
|
||||
$what = isset($_POST['pages']) ? 'page' : 'post';
|
||||
$s = stripslashes($_POST['ps']);
|
||||
preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches);
|
||||
$search_terms = array_map('_search_terms_tidy', $matches[0]);
|
||||
$search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
|
||||
|
||||
$searchand = $search = '';
|
||||
foreach ( (array) $search_terms as $term ) {
|
||||
foreach( (array) $search_terms as $term) {
|
||||
$term = addslashes_gpc($term);
|
||||
$search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))";
|
||||
$searchand = ' AND ';
|
||||
@@ -1224,12 +1193,12 @@ case 'find_posts':
|
||||
if ( count($search_terms) > 1 && $search_terms[0] != $s )
|
||||
$search .= " OR ($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%')";
|
||||
|
||||
$posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50" );
|
||||
$posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND $search ORDER BY post_date_gmt DESC LIMIT 50" );
|
||||
|
||||
if ( ! $posts )
|
||||
exit( __('No posts found.') );
|
||||
|
||||
$html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th>'.__('Date').'</th><th>'.__('Status').'</th></tr></thead><tbody>';
|
||||
$html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th>'.__('Time').'</th><th>'.__('Status').'</th></tr></thead><tbody>';
|
||||
foreach ( $posts as $post ) {
|
||||
|
||||
switch ( $post->post_status ) {
|
||||
@@ -1244,7 +1213,7 @@ case 'find_posts':
|
||||
$stat = __('Pending Review');
|
||||
break;
|
||||
case 'draft' :
|
||||
$stat = __('Draft');
|
||||
$stat = __('Unpublished');
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1379,51 +1348,6 @@ case 'save-widget' :
|
||||
|
||||
die();
|
||||
break;
|
||||
case 'image-editor':
|
||||
$attachment_id = intval($_POST['postid']);
|
||||
if ( empty($attachment_id) || !current_user_can('edit_post', $attachment_id) )
|
||||
die('-1');
|
||||
|
||||
check_ajax_referer( "image_editor-$attachment_id" );
|
||||
include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
|
||||
|
||||
$msg = false;
|
||||
switch ( $_POST['do'] ) {
|
||||
case 'save' :
|
||||
$msg = wp_save_image($attachment_id);
|
||||
$msg = json_encode($msg);
|
||||
die($msg);
|
||||
break;
|
||||
case 'scale' :
|
||||
$msg = wp_save_image($attachment_id);
|
||||
break;
|
||||
case 'restore' :
|
||||
$msg = wp_restore_image($attachment_id);
|
||||
break;
|
||||
}
|
||||
|
||||
wp_image_editor($attachment_id, $msg);
|
||||
die();
|
||||
break;
|
||||
case 'set-post-thumbnail':
|
||||
$post_id = intval( $_POST['post_id'] );
|
||||
if ( !current_user_can( 'edit_post', $post_id ) )
|
||||
die( '-1' );
|
||||
$thumbnail_id = intval( $_POST['thumbnail_id'] );
|
||||
|
||||
if ( $thumbnail_id == '-1' ) {
|
||||
delete_post_meta( $post_id, '_thumbnail_id' );
|
||||
die( _wp_post_thumbnail_html() );
|
||||
}
|
||||
|
||||
if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
|
||||
$thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' );
|
||||
if ( !empty( $thumbnail_html ) ) {
|
||||
update_post_meta( $post_id, '_thumbnail_id', $thumbnail_id );
|
||||
die( _wp_post_thumbnail_html( $thumbnail_id ) );
|
||||
}
|
||||
}
|
||||
die( '0' );
|
||||
default :
|
||||
do_action( 'wp_ajax_' . $_POST['action'] );
|
||||
die('0');
|
||||
|
||||
@@ -41,7 +41,7 @@ $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
|
||||
//<![CDATA[
|
||||
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();}}};
|
||||
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() ?>'};
|
||||
var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = '<?php echo substr($pagenow, 0, -4); ?>', adminpage = '<?php echo $admin_body_class; ?>', thousandsSeparator = '<?php echo $wp_locale->number_format['thousands_sep']; ?>', decimalPoint = '<?php echo $wp_locale->number_format['decimal_point']; ?>';
|
||||
var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = '<?php echo substr($pagenow, 0, -4); ?>', adminpage = '<?php echo $admin_body_class; ?>';
|
||||
//]]>
|
||||
</script>
|
||||
<?php
|
||||
|
||||
@@ -42,17 +42,13 @@ nocache_headers();
|
||||
|
||||
update_category_cache();
|
||||
|
||||
// Schedule trash collection
|
||||
if ( !wp_next_scheduled('wp_scheduled_delete') && !defined('WP_INSTALLING') )
|
||||
wp_schedule_event(time(), 'daily', 'wp_scheduled_delete');
|
||||
|
||||
set_screen_options();
|
||||
|
||||
$posts_per_page = get_option('posts_per_page');
|
||||
$date_format = get_option('date_format');
|
||||
$time_format = get_option('time_format');
|
||||
|
||||
wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'text', 'trackback', 'pingback'));
|
||||
wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback'));
|
||||
|
||||
wp_admin_css_color('classic', __('Blue'), admin_url("css/colors-classic.css"), array('#073447', '#21759B', '#EAF3FA', '#BBD8E7'));
|
||||
wp_admin_css_color('fresh', __('Gray'), admin_url("css/colors-fresh.css"), array('#464646', '#6D6D6D', '#F1F1F1', '#DFDFDF'));
|
||||
|
||||
@@ -18,8 +18,6 @@ if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_c
|
||||
$_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie'];
|
||||
elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
|
||||
$_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
|
||||
if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) )
|
||||
$_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie'];
|
||||
unset($current_user);
|
||||
require_once('admin.php');
|
||||
|
||||
|
||||
@@ -34,20 +34,17 @@ case 'addcat':
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
if ( !isset( $_GET['cat_ID'] ) ) {
|
||||
wp_redirect('categories.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$cat_ID = (int) $_GET['cat_ID'];
|
||||
check_admin_referer('delete-category_' . $cat_ID);
|
||||
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
$cat_name = get_cat_name($cat_ID);
|
||||
|
||||
// Don't delete the default cats.
|
||||
if ( $cat_ID == get_option('default_category') )
|
||||
wp_die( sprintf( __("Can’t delete the <strong>%s</strong> category: this is the default one"), get_cat_name($cat_ID) ) );
|
||||
wp_die(sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
|
||||
|
||||
wp_delete_category($cat_ID);
|
||||
|
||||
@@ -62,20 +59,18 @@ case 'bulk-delete':
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die( __('You are not allowed to delete categories.') );
|
||||
|
||||
$cats = (array) $_GET['delete'];
|
||||
$default_cat = get_option('default_category');
|
||||
foreach ( $cats as $cat_ID ) {
|
||||
$cat_ID = (int) $cat_ID;
|
||||
foreach ( (array) $_GET['delete'] as $cat_ID ) {
|
||||
$cat_name = get_cat_name($cat_ID);
|
||||
|
||||
// Don't delete the default cat.
|
||||
if ( $cat_ID == $default_cat )
|
||||
wp_die( sprintf( __("Can’t delete the <strong>%s</strong> category: this is the default one"), get_cat_name($cat_ID) ) );
|
||||
// Don't delete the default cats.
|
||||
if ( $cat_ID == get_option('default_category') )
|
||||
wp_die(sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
|
||||
|
||||
wp_delete_category($cat_ID);
|
||||
}
|
||||
|
||||
wp_safe_redirect( wp_get_referer() );
|
||||
exit;
|
||||
exit();
|
||||
|
||||
break;
|
||||
case 'edit':
|
||||
@@ -166,10 +161,10 @@ $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
|
||||
if ( empty($pagenum) )
|
||||
$pagenum = 1;
|
||||
|
||||
$cats_per_page = (int) get_user_option( 'categories_per_page', 0, false );
|
||||
if ( empty( $cats_per_page ) || $cats_per_page < 1 )
|
||||
$cats_per_page = get_user_option('categories_per_page');
|
||||
if ( empty($cats_per_page) )
|
||||
$cats_per_page = 20;
|
||||
$cats_per_page = apply_filters( 'edit_categories_per_page', $cats_per_page );
|
||||
$cats_per_page = apply_filters('edit_categories_per_page', $cats_per_page);
|
||||
|
||||
if ( !empty($_GET['s']) )
|
||||
$num_cats = count(get_categories(array('hide_empty' => 0, 'search' => $_GET['s'])));
|
||||
@@ -285,7 +280,7 @@ if ( $page_links )
|
||||
<div class="form-field">
|
||||
<label for="category_description"><?php _e('Description') ?></label>
|
||||
<textarea name="category_description" id="category_description" rows="5" cols="40"></textarea>
|
||||
<p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
|
||||
<p><?php _e('The description is not prominent by default, however some themes may show it.'); ?></p>
|
||||
</div>
|
||||
|
||||
<p class="submit"><input type="submit" class="button" name="submit" value="<?php esc_attr_e('Add Category'); ?>" /></p>
|
||||
|
||||
@@ -17,18 +17,6 @@ wp_reset_vars( array('action') );
|
||||
if ( isset( $_POST['deletecomment'] ) )
|
||||
$action = 'deletecomment';
|
||||
|
||||
if ( 'cdc' == $action )
|
||||
$action = 'delete';
|
||||
elseif ( 'mac' == $action )
|
||||
$action = 'approve';
|
||||
|
||||
if ( isset( $_GET['dt'] ) ) {
|
||||
if ( 'spam' == $_GET['dt'] )
|
||||
$action = 'spam';
|
||||
elseif ( 'trash' == $_GET['dt'] )
|
||||
$action = 'trash';
|
||||
}
|
||||
|
||||
/**
|
||||
* Display error message at bottom of comments.
|
||||
*
|
||||
@@ -56,60 +44,68 @@ case 'editcomment' :
|
||||
if ( !current_user_can('edit_post', $comment->comment_post_ID) )
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post.') );
|
||||
|
||||
if ( 'trash' == $comment->comment_approved )
|
||||
comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') );
|
||||
|
||||
$comment = get_comment_to_edit( $comment_id );
|
||||
|
||||
include('edit-form-comment.php');
|
||||
|
||||
break;
|
||||
|
||||
case 'delete' :
|
||||
case 'approve' :
|
||||
case 'trash' :
|
||||
case 'spam' :
|
||||
case 'cdc' :
|
||||
case 'mac' :
|
||||
|
||||
require_once('admin-header.php');
|
||||
|
||||
$comment_id = absint( $_GET['c'] );
|
||||
$formaction = $action . 'comment';
|
||||
$nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_';
|
||||
$formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment';
|
||||
$nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_';
|
||||
$nonce_action .= $comment_id;
|
||||
|
||||
if ( !$comment = get_comment_to_edit( $comment_id ) )
|
||||
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );
|
||||
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
|
||||
comment_footer_die( 'approve' != $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
|
||||
comment_footer_die( 'cdc' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
|
||||
?>
|
||||
<div class='wrap'>
|
||||
|
||||
<div class="narrow">
|
||||
<?php
|
||||
switch ( $action ) {
|
||||
case 'spam' :
|
||||
$caution_msg = __('You are about to mark the following comment as spam:');
|
||||
$button = __('Spam Comment');
|
||||
break;
|
||||
case 'trash' :
|
||||
$caution_msg = __('You are about to move the following comment to the Trash:');
|
||||
$button = __('Trash Comment');
|
||||
break;
|
||||
case 'delete' :
|
||||
$caution_msg = __('You are about to delete the following comment:');
|
||||
$button = __('Permanently Delete Comment');
|
||||
break;
|
||||
default :
|
||||
$caution_msg = __('You are about to approve the following comment:');
|
||||
$button = __('Approve Comment');
|
||||
break;
|
||||
if ( 'spam' == $_GET['dt'] ) {
|
||||
$caution_msg = __('You are about to mark the following comment as spam:');
|
||||
$button = __('Spam Comment');
|
||||
} elseif ( 'cdc' == $action ) {
|
||||
$caution_msg = __('You are about to delete the following comment:');
|
||||
$button = __('Delete Comment');
|
||||
} else {
|
||||
$caution_msg = __('You are about to approve the following comment:');
|
||||
$button = __('Approve Comment');
|
||||
}
|
||||
?>
|
||||
|
||||
<p><strong><?php _e('Caution:'); ?></strong> <?php echo $caution_msg; ?></p>
|
||||
|
||||
<table class="form-table comment-ays">
|
||||
<p><?php _e('Are you sure you want to do that?'); ?></p>
|
||||
|
||||
<form action='comment.php' method='get'>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td><input type='button' class="button" value='<?php esc_attr_e('No'); ?>' onclick="self.location='<?php echo admin_url('edit-comments.php'); ?>" /></td>
|
||||
<td class="textright"><input type='submit' class="button" value='<?php echo esc_attr($button); ?>' /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php wp_nonce_field( $nonce_action ); ?>
|
||||
<input type='hidden' name='action' value='<?php echo esc_attr($formaction); ?>' />
|
||||
<?php if ( 'spam' == $_GET['dt'] ) { ?>
|
||||
<input type='hidden' name='dt' value='spam' />
|
||||
<?php } ?>
|
||||
<input type='hidden' name='p' value='<?php echo esc_attr($comment->comment_post_ID); ?>' />
|
||||
<input type='hidden' name='c' value='<?php echo esc_attr($comment->comment_ID); ?>' />
|
||||
<input type='hidden' name='noredir' value='1' />
|
||||
</form>
|
||||
|
||||
<table class="form-table" cellpadding="5">
|
||||
<tr class="alt">
|
||||
<th scope="row"><?php _e('Author'); ?></th>
|
||||
<td><?php echo $comment->comment_author; ?></td>
|
||||
@@ -132,112 +128,87 @@ switch ( $action ) {
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><?php _e('Are you sure you want to do that?'); ?></p>
|
||||
|
||||
<form action='comment.php' method='get'>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td><a class="button" href="<?php echo admin_url('edit-comments.php'); ?>"><?php esc_attr_e('No'); ?></a></td>
|
||||
<td class="textright"><input type='submit' class="button" value='<?php echo esc_attr($button); ?>' /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php wp_nonce_field( $nonce_action ); ?>
|
||||
<input type='hidden' name='action' value='<?php echo esc_attr($formaction); ?>' />
|
||||
<input type='hidden' name='p' value='<?php echo esc_attr($comment->comment_post_ID); ?>' />
|
||||
<input type='hidden' name='c' value='<?php echo esc_attr($comment->comment_ID); ?>' />
|
||||
<input type='hidden' name='noredir' value='1' />
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'deletecomment' :
|
||||
case 'trashcomment' :
|
||||
case 'untrashcomment' :
|
||||
case 'spamcomment' :
|
||||
case 'unspamcomment' :
|
||||
$comment_id = absint( $_REQUEST['c'] );
|
||||
check_admin_referer( 'delete-comment_' . $comment_id );
|
||||
|
||||
$noredir = isset($_REQUEST['noredir']);
|
||||
if ( isset( $_REQUEST['noredir'] ) )
|
||||
$noredir = true;
|
||||
else
|
||||
$noredir = false;
|
||||
|
||||
if ( !$comment = get_comment($comment_id) )
|
||||
if ( !$comment = get_comment( $comment_id ) )
|
||||
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit-comments.php') );
|
||||
if ( !current_user_can('edit_post', $comment->comment_post_ID ) )
|
||||
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post.') );
|
||||
|
||||
if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php') )
|
||||
$redir = wp_get_referer();
|
||||
elseif ( '' != wp_get_original_referer() && false == $noredir )
|
||||
$redir = wp_get_original_referer();
|
||||
if ( 'spam' == $_REQUEST['dt'] )
|
||||
wp_set_comment_status( $comment->comment_ID, 'spam' );
|
||||
else
|
||||
$redir = admin_url('edit-comments.php');
|
||||
wp_delete_comment( $comment->comment_ID );
|
||||
|
||||
$redir = remove_query_arg( array('spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids'), $redir );
|
||||
|
||||
switch ( $action ) {
|
||||
case 'deletecomment' :
|
||||
wp_delete_comment( $comment_id );
|
||||
$redir = add_query_arg( array('deleted' => '1'), $redir );
|
||||
break;
|
||||
case 'trashcomment' :
|
||||
wp_trash_comment($comment_id);
|
||||
$redir = add_query_arg( array('trashed' => '1', 'ids' => $comment_id), $redir );
|
||||
break;
|
||||
case 'untrashcomment' :
|
||||
wp_untrash_comment($comment_id);
|
||||
$redir = add_query_arg( array('untrashed' => '1'), $redir );
|
||||
break;
|
||||
case 'spamcomment' :
|
||||
wp_spam_comment($comment_id);
|
||||
$redir = add_query_arg( array('spammed' => '1', 'ids' => $comment_id), $redir );
|
||||
break;
|
||||
case 'unspamcomment' :
|
||||
wp_unspam_comment($comment_id);
|
||||
$redir = add_query_arg( array('unspammed' => '1'), $redir );
|
||||
break;
|
||||
}
|
||||
|
||||
wp_redirect( $redir );
|
||||
if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php' ) )
|
||||
wp_redirect( wp_get_referer() );
|
||||
else if ( '' != wp_get_original_referer() && false == $noredir )
|
||||
wp_redirect( wp_get_original_referer() );
|
||||
else
|
||||
wp_redirect( admin_url('edit-comments.php') );
|
||||
|
||||
die;
|
||||
break;
|
||||
|
||||
case 'approvecomment' :
|
||||
case 'unapprovecomment' :
|
||||
$comment_id = absint( $_GET['c'] );
|
||||
check_admin_referer( 'approve-comment_' . $comment_id );
|
||||
check_admin_referer( 'unapprove-comment_' . $comment_id );
|
||||
|
||||
$noredir = isset( $_GET['noredir'] );
|
||||
if ( isset( $_GET['noredir'] ) )
|
||||
$noredir = true;
|
||||
else
|
||||
$noredir = false;
|
||||
|
||||
if ( !$comment = get_comment( $comment_id ) )
|
||||
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );
|
||||
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) {
|
||||
if ( 'approvecomment' == $action )
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
|
||||
else
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );
|
||||
}
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );
|
||||
|
||||
wp_set_comment_status( $comment->comment_ID, 'hold' );
|
||||
|
||||
if ( '' != wp_get_referer() && false == $noredir )
|
||||
$redir = remove_query_arg( array('approved', 'unapproved'), wp_get_referer() );
|
||||
wp_redirect( wp_get_referer() );
|
||||
else
|
||||
$redir = admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) );
|
||||
wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
|
||||
|
||||
if ( 'approvecomment' == $action ) {
|
||||
wp_set_comment_status( $comment_id, 'approve' );
|
||||
$redir = add_query_arg( array( 'approved' => 1 ), $redir );
|
||||
} else {
|
||||
wp_set_comment_status( $comment_id, 'hold' );
|
||||
$redir = add_query_arg( array( 'unapproved' => 1 ), $redir );
|
||||
}
|
||||
exit();
|
||||
break;
|
||||
|
||||
wp_redirect( $redir );
|
||||
case 'approvecomment' :
|
||||
$comment_id = absint( $_GET['c'] );
|
||||
check_admin_referer( 'approve-comment_' . $comment_id );
|
||||
|
||||
if ( isset( $_GET['noredir'] ) )
|
||||
$noredir = true;
|
||||
else
|
||||
$noredir = false;
|
||||
|
||||
if ( !$comment = get_comment( $comment_id ) )
|
||||
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );
|
||||
|
||||
if ( !current_user_can('edit_post', $comment->comment_post_ID) )
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
|
||||
|
||||
wp_set_comment_status( $comment->comment_ID, 'approve' );
|
||||
|
||||
if ( '' != wp_get_referer() && false == $noredir )
|
||||
wp_redirect( wp_get_referer() );
|
||||
else
|
||||
wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
|
||||
|
||||
exit();
|
||||
break;
|
||||
@@ -266,4 +237,4 @@ default:
|
||||
|
||||
include('admin-footer.php');
|
||||
|
||||
?>
|
||||
?>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,394 +0,0 @@
|
||||
.postbox p, .postbox ul, .postbox ol, .postbox blockquote, #wp-version-message { font-size: 11px; }
|
||||
|
||||
.edit-box {
|
||||
display: none;
|
||||
}
|
||||
|
||||
h3:hover .edit-box {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
form .input-text-wrap {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding: 2px 3px;
|
||||
border-color: #ccc;
|
||||
}
|
||||
|
||||
#dashboard-widgets form .input-text-wrap input {
|
||||
border: 0 none;
|
||||
outline: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 99%;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
form .textarea-wrap {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding: 2px;
|
||||
border-color: #ccc;
|
||||
}
|
||||
|
||||
#dashboard-widgets form .textarea-wrap textarea {
|
||||
border: 0 none;
|
||||
padding: 0;
|
||||
outline: none;
|
||||
width: 99%;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#dashboard-widgets .postbox form .submit {
|
||||
float: none;
|
||||
margin: .5em 0 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
div.postbox div.inside {
|
||||
margin: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#dashboard-widgets a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#dashboard-widgets h3 a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#dashboard-widgets h3 .postbox-title-action {
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#dashboard-widgets h4 {
|
||||
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
font-size: 13px;
|
||||
margin: 0 0 .2em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Right Now */
|
||||
|
||||
#dashboard_right_now p.sub,
|
||||
#dashboard_right_now .table, #dashboard_right_now .versions {
|
||||
margin: -12px;
|
||||
}
|
||||
|
||||
#dashboard_right_now .inside {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#dashboard_right_now p.sub {
|
||||
font-style: italic;
|
||||
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
padding: 5px 10px 15px;
|
||||
color: #777;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
#dashboard_right_now .table {
|
||||
background: #f9f9f9;
|
||||
border-top: #ececec 1px solid;
|
||||
border-bottom: #ececec 1px solid;
|
||||
margin: 0 -9px 10px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
#dashboard_right_now table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#dashboard_right_now table td {
|
||||
border-top: #ececec 1px solid;
|
||||
padding: 3px 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#dashboard_right_now table tr.first td {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
#dashboard_right_now td.b {
|
||||
padding-right: 6px;
|
||||
text-align: right;
|
||||
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#dashboard_right_now td.b a {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#dashboard_right_now td.b a:hover {
|
||||
color: #d54e21;
|
||||
}
|
||||
|
||||
#dashboard_right_now .t {
|
||||
font-size: 12px;
|
||||
padding-right: 12px;
|
||||
padding-top: 6px;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
#dashboard_right_now .t a {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#dashboard_right_now td.first,
|
||||
#dashboard_right_now td.last {
|
||||
width: 1%;
|
||||
}
|
||||
|
||||
#dashboard_right_now .spam {
|
||||
color: red;
|
||||
}
|
||||
|
||||
#dashboard_right_now .waiting {
|
||||
color: #e66f00;
|
||||
}
|
||||
|
||||
#dashboard_right_now .approved {
|
||||
color: green;
|
||||
}
|
||||
|
||||
#dashboard_right_now .versions {
|
||||
padding: 6px 10px 12px;
|
||||
}
|
||||
|
||||
#dashboard_right_now .versions .b {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#dashboard_right_now a.button {
|
||||
float: right;
|
||||
clear: right;
|
||||
position: relative;
|
||||
top: -5px;
|
||||
}
|
||||
|
||||
/* Recent Comments */
|
||||
|
||||
#dashboard_recent_comments h3 {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#dashboard_recent_comments .inside {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#dashboard_recent_comments .comment-meta .approve {
|
||||
font-style: italic;
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
#the-comment-list {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item {
|
||||
padding: 1em 10px;
|
||||
border-top: 1px solid;
|
||||
}
|
||||
|
||||
#the-comment-list .pingback {
|
||||
padding-left: 9px !important;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item,
|
||||
#the-comment-list #replyrow {
|
||||
margin: 0 -10px;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item .avatar {
|
||||
float: left;
|
||||
margin: 0 10px 5px 0;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item h4 {
|
||||
line-height: 1.4;
|
||||
margin-top: -.2em;
|
||||
font-weight: normal;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item h4 cite {
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item blockquote,
|
||||
#the-comment-list .comment-item blockquote p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#dashboard_recent_comments #the-comment-list .trackback blockquote,
|
||||
#dashboard_recent_comments #the-comment-list .pingback blockquote {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item p.row-actions {
|
||||
margin: 3px 0 0;
|
||||
padding: 0;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
/* QuickPress */
|
||||
|
||||
#dashboard_quick_press h4 {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
float: left;
|
||||
width: 5.5em;
|
||||
clear: both;
|
||||
font-weight: normal;
|
||||
text-align: right;
|
||||
padding-top: 5px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#dashboard_quick_press h4 label {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#dashboard_quick_press .input-text-wrap,
|
||||
#dashboard_quick_press .textarea-wrap {
|
||||
margin: 0 0 1em 5em;
|
||||
}
|
||||
|
||||
#dashboard_quick_press #media-buttons {
|
||||
margin: 0 0 .5em 5em;
|
||||
padding: 0 0 0 10px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#dashboard_quick_press #media-buttons a {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
#dashboard-widgets #dashboard_quick_press form p.submit {
|
||||
margin-left: 4.6em;
|
||||
}
|
||||
|
||||
#dashboard-widgets #dashboard_quick_press form p.submit input {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#dashboard-widgets #dashboard_quick_press form p.submit #save-post {
|
||||
margin: 0 1em 0 10px;
|
||||
}
|
||||
|
||||
#dashboard-widgets #dashboard_quick_press form p.submit #publish {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* Recent Drafts */
|
||||
#dashboard_recent_drafts ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#dashboard_recent_drafts ul li {
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
|
||||
#dashboard_recent_drafts h4 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#dashboard_recent_drafts h4 abbr {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
font-size: 11px;
|
||||
color: #999;
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
#dashboard_recent_drafts p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Feeds */
|
||||
|
||||
.rss-widget ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
a.rsswidget {
|
||||
font-size: 13px;
|
||||
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
line-height: 1.7em;
|
||||
}
|
||||
|
||||
.rss-widget ul li {
|
||||
line-height: 1.5em;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.rss-widget span.rss-date {
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.rss-widget cite {
|
||||
display: block;
|
||||
text-align: right;
|
||||
margin: 0 0 1em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.rss-widget cite:before {
|
||||
content: '\2014';
|
||||
}
|
||||
|
||||
/* Plugins */
|
||||
|
||||
#dashboard_plugins h4 {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
}
|
||||
|
||||
#dashboard_plugins h5 {
|
||||
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
font-size: 13px !important;
|
||||
margin: 0;
|
||||
display: inline;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
#dashboard_plugins h5 a {
|
||||
font-weight: normal;
|
||||
line-height: 1.7em;
|
||||
}
|
||||
|
||||
#dashboard_plugins p {
|
||||
margin: 0 0 1.4em;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
.dashboard-comment-wrap {
|
||||
overflow: hidden;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
@@ -78,5 +78,6 @@ body, td, textarea, input, select {
|
||||
|
||||
.screen-reader-text, .screen-reader-text span {
|
||||
left:auto;
|
||||
text-indent:-1000em;
|
||||
right:-1000em;
|
||||
}
|
||||
}
|
||||
@@ -1 +1,487 @@
|
||||
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;background:transparent;}body{line-height:1;}ol,ul{list-style:none;}blockquote,q{quotes:none;}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;}ins{text-decoration:none;}del{text-decoration:line-through;}#wpwrap{height:auto;min-height:100%;width:100%;}#wpcontent{height:100%;padding-bottom:50px;}#wpbody{clear:both;margin-left:175px;}.folded #wpbody{margin-left:60px;}#wpbody-content{float:left;width:100%;}#adminmenu{float:left;clear:left;width:145px;margin-top:15px;margin-right:5px;margin-bottom:15px;margin-left:-160px;position:relative;padding:0;list-style:none;}.folded #adminmenu{margin-left:-45px;}.folded #adminmenu,.folded #adminmenu li.menu-top{width:28px;}#footer{clear:both;position:relative;width:100%;}.inner-sidebar{float:right;clear:right;display:none;width:281px;position:relative;}.inner-sidebar #side-sortables{width:280px;min-height:300px;}.has-right-sidebar .inner-sidebar{display:block;}.has-right-sidebar #post-body{float:left;clear:left;width:100%;margin-right:-340px;}.has-right-sidebar #post-body-content{margin-right:300px;}#col-container{overflow:hidden;padding:0;margin:0;}#col-left{padding:0;margin:0;overflow:hidden;width:39%;}#col-right{float:right;clear:right;overflow:hidden;padding:0;margin:0;width:59%;}.alignleft{float:left;}.alignright{float:right;}.textleft{text-align:left;}.textright{text-align:right;}.clear{clear:both;}.screen-reader-text,.screen-reader-text span{position:absolute;left:-1000em;height:1px;width:1px;overflow:hidden;}.hidden,.js .closed .inside,.js .hide-if-js,.no-js .hide-if-no-js{display:none;}input[type="text"],input[type="password"],textarea{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}input[type="checkbox"],input[type="radio"]{vertical-align:middle;}html,body{height:100%;}body,td,textarea,input,select{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:13px;}body,textarea{line-height:1.4em;}input,select{line-height:1em;}p{margin:1em 0;}blockquote{margin:1em;}label{cursor:pointer;}li,dd{margin-bottom:6px;}p,li,dl,dd,dt{line-height:140%;}textarea,input,select{margin:1px;padding:3px;}h1{display:block;font-size:2em;font-weight:bold;margin:.67em 0;}h2{display:block;font-size:1.5em;font-weight:bold;margin:.83em 0;}h3{display:block;font-size:1.17em;font-weight:bold;margin:1em 0;}h4{display:block;font-size:1em;font-weight:bold;margin:1.33em 0;}h5{display:block;font-size:.83em;font-weight:bold;margin:1.67em 0;}h6{display:block;font-size:.67em;font-weight:bold;margin:2.33em 0;}ul.ul-disc{list-style:disc outside;}ul.ul-square{list-style:square outside;}ol.ol-decimal{list-style:decimal outside;}ul.ul-disc,ul.ul-square,ol.ol-decimal{margin-left:1.8em;}ul.ul-disc>li,ul.ul-square>li,ol.ol-decimal>li{margin:0 0 .5em;}.subsubsub{list-style:none;margin:8px 0 5px;padding:0;white-space:nowrap;font-size:11px;float:left;}.subsubsub a{line-height:2;padding:.2em;text-decoration:none;}.subsubsub a .count,.subsubsub a.current .count{color:#999;font-weight:normal;}.subsubsub a.current{font-weight:bold;background:none;border:none;}.subsubsub li{display:inline;margin:0;padding:0;}.widefat{border-width:1px;border-style:solid;border-spacing:0;width:100%;clear:both;margin:0;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.widefat *{word-wrap:break-word;}.widefat a{text-decoration:none;}.widefat td,.widefat th{border-bottom-width:1px;border-bottom-style:solid;font-size:11px;}.widefat td{padding:3px 7px;vertical-align:top;}.widefat td p,.widefat td ol,.widefat td ul{font-size:11px;}.widefat th{padding:7px 7px 8px;text-align:left;line-height:1.3em;}.widefat th input{margin:0 0 0 8px;padding:0;vertical-align:text-top;}.widefat .check-column{width:2.2em;padding:0;}.widefat tbody th.check-column{padding:7px 0 22px;}.widefat .num,.column-comments,.column-links,.column-posts{text-align:center;}.widefat th#comments{vertical-align:middle;}.wrap{margin:0 15px 0 5px;}.updated,.error{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 15px 2px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.updated p,.error p{margin:.5em 0;line-height:1;padding:2px;}.wrap .updated,.wrap .error{margin:5px 0 15px;}.wrap h2{font:italic normal normal 24px/29px Georgia,"Times New Roman","Bitstream Charter",Times,serif;margin:0;padding:14px 15px 3px 0;line-height:35px;text-shadow:rgba(255,255,255,1) 0 1px 0;}.wrap h2.long-header{padding-right:0;}
|
||||
/* http://meyerweb.com/eric/tools/css/reset/ */
|
||||
/* v1.0 | 20080212 */
|
||||
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
/* font-size: 100%;
|
||||
vertical-align: baseline; */
|
||||
background: transparent;
|
||||
}
|
||||
body {
|
||||
line-height: 1;
|
||||
}
|
||||
ol, ul {
|
||||
list-style: none;
|
||||
}
|
||||
blockquote, q {
|
||||
quotes: none;
|
||||
}
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: '';
|
||||
content: none;
|
||||
}
|
||||
|
||||
/* remember to define focus styles! */
|
||||
/*
|
||||
:focus {
|
||||
outline: 0;
|
||||
}
|
||||
*/
|
||||
/* remember to highlight inserts somehow! */
|
||||
ins {
|
||||
text-decoration: none;
|
||||
}
|
||||
del {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
/* tables still need 'cellspacing="0"' in the markup */
|
||||
/*
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
*/
|
||||
/* end reset css */
|
||||
|
||||
|
||||
/* 2 column liquid layout */
|
||||
#wpwrap {
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#wpcontent {
|
||||
height: 100%;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
#wpbody {
|
||||
clear: both;
|
||||
margin-left: 175px;
|
||||
}
|
||||
|
||||
.folded #wpbody {
|
||||
margin-left: 60px;
|
||||
}
|
||||
|
||||
#wpbody-content {
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#adminmenu {
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 145px;
|
||||
margin-top: 15px;
|
||||
margin-right: 5px;
|
||||
margin-bottom: 15px;
|
||||
margin-left: -160px;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.folded #adminmenu {
|
||||
margin-left: -45px;
|
||||
}
|
||||
|
||||
.folded #adminmenu,
|
||||
.folded #adminmenu li.menu-top {
|
||||
width: 28px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
clear: both;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* inner 2 column liquid layout */
|
||||
.inner-sidebar {
|
||||
float: right;
|
||||
clear: right;
|
||||
display: none;
|
||||
width: 281px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.inner-sidebar #side-sortables {
|
||||
width: 280px;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.has-right-sidebar .inner-sidebar {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.has-right-sidebar #post-body {
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 100%;
|
||||
margin-right: -340px;
|
||||
}
|
||||
|
||||
.has-right-sidebar #post-body-content {
|
||||
margin-right: 300px;
|
||||
}
|
||||
|
||||
/* 2 columns main area */
|
||||
|
||||
#col-container {
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#col-left {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
width: 39%;
|
||||
}
|
||||
|
||||
#col-right {
|
||||
float: right;
|
||||
clear: right;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 59%;
|
||||
}
|
||||
|
||||
/* utility classes */
|
||||
.alignleft {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.alignright {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.textleft {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.textright {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* Hide visually but not from screen readers */
|
||||
.screen-reader-text,
|
||||
.screen-reader-text span {
|
||||
position: absolute;
|
||||
left: -1000em;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.hidden,
|
||||
.js .closed .inside,
|
||||
.js .hide-if-js,
|
||||
.no-js .hide-if-no-js {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* include margin and padding in the width calculation of input and textarea */
|
||||
input[type="text"],
|
||||
input[type="password"],
|
||||
textarea {
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
-ms-box-sizing: border-box; /* ie8 only */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* styles for use by people extending the WordPress interface */
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body,
|
||||
td,
|
||||
textarea,
|
||||
input,
|
||||
select {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
body,
|
||||
textarea {
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
input,
|
||||
select {
|
||||
line-height: 1em;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
label {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
li,
|
||||
dd {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
p,
|
||||
li,
|
||||
dl,
|
||||
dd,
|
||||
dt {
|
||||
line-height: 140%;
|
||||
}
|
||||
|
||||
textarea,
|
||||
input,
|
||||
select {
|
||||
margin: 1px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
display: block;
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
margin: .67em 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
display: block;
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
margin: .83em 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
display: block;
|
||||
font-size: 1.17em;
|
||||
font-weight: bold;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
h4 {
|
||||
display: block;
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
margin: 1.33em 0;
|
||||
}
|
||||
|
||||
h5 {
|
||||
display: block;
|
||||
font-size: 0.83em;
|
||||
font-weight: bold;
|
||||
margin: 1.67em 0;
|
||||
}
|
||||
|
||||
h6 {
|
||||
display: block;
|
||||
font-size: 0.67em;
|
||||
font-weight: bold;
|
||||
margin: 2.33em 0;
|
||||
}
|
||||
|
||||
ul.ul-disc {
|
||||
list-style: disc outside;
|
||||
}
|
||||
|
||||
ul.ul-square {
|
||||
list-style: square outside;
|
||||
}
|
||||
|
||||
ol.ol-decimal {
|
||||
list-style: decimal outside;
|
||||
}
|
||||
|
||||
ul.ul-disc,
|
||||
ul.ul-square,
|
||||
ol.ol-decimal {
|
||||
margin-left: 1.8em;
|
||||
}
|
||||
|
||||
ul.ul-disc > li,
|
||||
ul.ul-square > li,
|
||||
ol.ol-decimal > li {
|
||||
margin: 0 0 0.5em;
|
||||
}
|
||||
|
||||
.subsubsub {
|
||||
list-style: none;
|
||||
margin: 8px 0 5px;
|
||||
padding: 0;
|
||||
white-space: nowrap;
|
||||
font-size: 11px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.subsubsub a {
|
||||
line-height: 2;
|
||||
padding: .2em;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.subsubsub a .count, .subsubsub a.current .count {
|
||||
color: #999;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.subsubsub a.current {
|
||||
font-weight: bold;
|
||||
background: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.subsubsub li {
|
||||
display: inline;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.widefat {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-spacing: 0;
|
||||
width: 100%;
|
||||
clear: both;
|
||||
margin: 0;
|
||||
-moz-border-radius: 4px;
|
||||
-khtml-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.widefat * {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.widefat a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.widefat td,
|
||||
.widefat th {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
font-size: 11px;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
.widefat td {
|
||||
padding: 3px 7px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.widefat td p,
|
||||
.widefat td ol,
|
||||
.widefat td ul {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.widefat th {
|
||||
padding: 7px 7px 8px;
|
||||
text-align: left;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
|
||||
.widefat th input {
|
||||
margin: 0 0 0 8px;
|
||||
padding: 0;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
.widefat .check-column {
|
||||
width: 2.2em;
|
||||
padding: 0;
|
||||
|
||||
}
|
||||
|
||||
.widefat tbody th.check-column {
|
||||
padding: 7px 0 22px;
|
||||
}
|
||||
|
||||
.widefat .num,
|
||||
.column-comments,
|
||||
.column-links,
|
||||
.column-posts,
|
||||
.column-parent {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.widefat th#comments {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
margin: 0 15px 0 5px;
|
||||
}
|
||||
|
||||
.updated,
|
||||
.error {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 0 0.6em;
|
||||
margin: 5px 15px 2px;
|
||||
-moz-border-radius: 3px;
|
||||
-khtml-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.updated p,
|
||||
.error p {
|
||||
margin: 0.5em 0;
|
||||
line-height: 1;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.wrap .updated,
|
||||
.wrap .error {
|
||||
margin: 5px 0 15px;
|
||||
}
|
||||
|
||||
.wrap h2 {
|
||||
font: italic normal normal 24px/29px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
margin: 0;
|
||||
padding: 14px 15px 3px 0;
|
||||
line-height: 35px;
|
||||
text-shadow: rgba(255,255,255,1) 0px 1px 0px;
|
||||
}
|
||||
|
||||
.wrap h2.long-header {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
@@ -1,485 +0,0 @@
|
||||
/* http://meyerweb.com/eric/tools/css/reset/ */
|
||||
/* v1.0 | 20080212 */
|
||||
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
/* font-size: 100%;
|
||||
vertical-align: baseline; */
|
||||
background: transparent;
|
||||
}
|
||||
body {
|
||||
line-height: 1;
|
||||
}
|
||||
ol, ul {
|
||||
list-style: none;
|
||||
}
|
||||
blockquote, q {
|
||||
quotes: none;
|
||||
}
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: '';
|
||||
content: none;
|
||||
}
|
||||
|
||||
/* remember to define focus styles! */
|
||||
/*
|
||||
:focus {
|
||||
outline: 0;
|
||||
}
|
||||
*/
|
||||
/* remember to highlight inserts somehow! */
|
||||
ins {
|
||||
text-decoration: none;
|
||||
}
|
||||
del {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
/* tables still need 'cellspacing="0"' in the markup */
|
||||
/*
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
*/
|
||||
/* end reset css */
|
||||
|
||||
|
||||
/* 2 column liquid layout */
|
||||
#wpwrap {
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#wpcontent {
|
||||
height: 100%;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
#wpbody {
|
||||
clear: both;
|
||||
margin-left: 175px;
|
||||
}
|
||||
|
||||
.folded #wpbody {
|
||||
margin-left: 60px;
|
||||
}
|
||||
|
||||
#wpbody-content {
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#adminmenu {
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 145px;
|
||||
margin-top: 15px;
|
||||
margin-right: 5px;
|
||||
margin-bottom: 15px;
|
||||
margin-left: -160px;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.folded #adminmenu {
|
||||
margin-left: -45px;
|
||||
}
|
||||
|
||||
.folded #adminmenu,
|
||||
.folded #adminmenu li.menu-top {
|
||||
width: 28px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
clear: both;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* inner 2 column liquid layout */
|
||||
.inner-sidebar {
|
||||
float: right;
|
||||
clear: right;
|
||||
display: none;
|
||||
width: 281px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.inner-sidebar #side-sortables {
|
||||
width: 280px;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.has-right-sidebar .inner-sidebar {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.has-right-sidebar #post-body {
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 100%;
|
||||
margin-right: -340px;
|
||||
}
|
||||
|
||||
.has-right-sidebar #post-body-content {
|
||||
margin-right: 300px;
|
||||
}
|
||||
|
||||
/* 2 columns main area */
|
||||
|
||||
#col-container {
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#col-left {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
width: 39%;
|
||||
}
|
||||
|
||||
#col-right {
|
||||
float: right;
|
||||
clear: right;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 59%;
|
||||
}
|
||||
|
||||
/* utility classes */
|
||||
.alignleft {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.alignright {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.textleft {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.textright {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* Hide visually but not from screen readers */
|
||||
.screen-reader-text,
|
||||
.screen-reader-text span {
|
||||
position: absolute;
|
||||
left: -1000em;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.hidden,
|
||||
.js .closed .inside,
|
||||
.js .hide-if-js,
|
||||
.no-js .hide-if-no-js {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* include margin and padding in the width calculation of input and textarea */
|
||||
input[type="text"],
|
||||
input[type="password"],
|
||||
textarea {
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
-ms-box-sizing: border-box; /* ie8 only */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* styles for use by people extending the WordPress interface */
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body,
|
||||
td,
|
||||
textarea,
|
||||
input,
|
||||
select {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
body,
|
||||
textarea {
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
input,
|
||||
select {
|
||||
line-height: 1em;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
label {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
li,
|
||||
dd {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
p,
|
||||
li,
|
||||
dl,
|
||||
dd,
|
||||
dt {
|
||||
line-height: 140%;
|
||||
}
|
||||
|
||||
textarea,
|
||||
input,
|
||||
select {
|
||||
margin: 1px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
display: block;
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
margin: .67em 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
display: block;
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
margin: .83em 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
display: block;
|
||||
font-size: 1.17em;
|
||||
font-weight: bold;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
h4 {
|
||||
display: block;
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
margin: 1.33em 0;
|
||||
}
|
||||
|
||||
h5 {
|
||||
display: block;
|
||||
font-size: 0.83em;
|
||||
font-weight: bold;
|
||||
margin: 1.67em 0;
|
||||
}
|
||||
|
||||
h6 {
|
||||
display: block;
|
||||
font-size: 0.67em;
|
||||
font-weight: bold;
|
||||
margin: 2.33em 0;
|
||||
}
|
||||
|
||||
ul.ul-disc {
|
||||
list-style: disc outside;
|
||||
}
|
||||
|
||||
ul.ul-square {
|
||||
list-style: square outside;
|
||||
}
|
||||
|
||||
ol.ol-decimal {
|
||||
list-style: decimal outside;
|
||||
}
|
||||
|
||||
ul.ul-disc,
|
||||
ul.ul-square,
|
||||
ol.ol-decimal {
|
||||
margin-left: 1.8em;
|
||||
}
|
||||
|
||||
ul.ul-disc > li,
|
||||
ul.ul-square > li,
|
||||
ol.ol-decimal > li {
|
||||
margin: 0 0 0.5em;
|
||||
}
|
||||
|
||||
.subsubsub {
|
||||
list-style: none;
|
||||
margin: 8px 0 5px;
|
||||
padding: 0;
|
||||
white-space: nowrap;
|
||||
font-size: 11px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.subsubsub a {
|
||||
line-height: 2;
|
||||
padding: .2em;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.subsubsub a .count, .subsubsub a.current .count {
|
||||
color: #999;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.subsubsub a.current {
|
||||
font-weight: bold;
|
||||
background: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.subsubsub li {
|
||||
display: inline;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.widefat {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-spacing: 0;
|
||||
width: 100%;
|
||||
clear: both;
|
||||
margin: 0;
|
||||
-moz-border-radius: 4px;
|
||||
-khtml-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.widefat * {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.widefat a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.widefat td,
|
||||
.widefat th {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.widefat td {
|
||||
padding: 3px 7px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.widefat td p,
|
||||
.widefat td ol,
|
||||
.widefat td ul {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.widefat th {
|
||||
padding: 7px 7px 8px;
|
||||
text-align: left;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
|
||||
.widefat th input {
|
||||
margin: 0 0 0 8px;
|
||||
padding: 0;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
.widefat .check-column {
|
||||
width: 2.2em;
|
||||
padding: 0;
|
||||
|
||||
}
|
||||
|
||||
.widefat tbody th.check-column {
|
||||
padding: 7px 0 22px;
|
||||
}
|
||||
|
||||
.widefat .num,
|
||||
.column-comments,
|
||||
.column-links,
|
||||
.column-posts {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.widefat th#comments {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
margin: 0 15px 0 5px;
|
||||
}
|
||||
|
||||
.updated,
|
||||
.error {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 0 0.6em;
|
||||
margin: 5px 15px 2px;
|
||||
-moz-border-radius: 3px;
|
||||
-khtml-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.updated p,
|
||||
.error p {
|
||||
margin: 0.5em 0;
|
||||
line-height: 1;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.wrap .updated,
|
||||
.wrap .error {
|
||||
margin: 5px 0 15px;
|
||||
}
|
||||
|
||||
.wrap h2 {
|
||||
font: italic normal normal 24px/29px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
margin: 0;
|
||||
padding: 14px 15px 3px 0;
|
||||
line-height: 35px;
|
||||
text-shadow: rgba(255,255,255,1) 0px 1px 0px;
|
||||
}
|
||||
|
||||
.wrap h2.long-header {
|
||||
padding-right: 0;
|
||||
}
|
||||
@@ -89,7 +89,3 @@ p.submit { /* quick edit and reply in edit-comments.php */
|
||||
form#widgets-filter { /* fix widget page */
|
||||
position: static;
|
||||
}
|
||||
|
||||
* html .meta-box-sortables .postbox .handlediv {
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -111px;
|
||||
}
|
||||
|
||||
@@ -21,14 +21,6 @@ input.button-highlighted {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
* html .meta-box-sortables .postbox .handlediv {
|
||||
background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;
|
||||
}
|
||||
|
||||
* html .edit-box {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
* html .inner-sidebar #side-sortables,
|
||||
* html .postbox-container .meta-box-sortables {
|
||||
height: 300px;
|
||||
@@ -325,10 +317,6 @@ div#dashboard-widgets {
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.tablenav .actions select {
|
||||
width: 155px;
|
||||
}
|
||||
|
||||
table.ie-fixed {
|
||||
table-layout: fixed;
|
||||
}
|
||||
@@ -411,34 +399,3 @@ table.ie-fixed {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
* html .media-item .pinkynail {
|
||||
height: 32px;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
#wpcontent .button-primary-disabled {
|
||||
color: #9FD0D5;
|
||||
background: #298CBA;
|
||||
}
|
||||
|
||||
#wpcontent #ajax-loading {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
* html .describe .field input.text,
|
||||
* html .describe .field textarea {
|
||||
width: 440px;
|
||||
}
|
||||
|
||||
#the-comment-list .unapproved tr,
|
||||
#the-comment-list .unapproved td {
|
||||
background-color: #ffffe0;
|
||||
}
|
||||
|
||||
.imgedit-submit {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
* html input {
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
@@ -1 +1,133 @@
|
||||
html{background:#f7f7f7;}body{background:#fff;color:#333;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;margin:2em auto 0 auto;width:700px;padding:1em 2em;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;border:1px solid #dfdfdf;}a{color:#2583ad;text-decoration:none;}a:hover{color:#d54e21;}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,"Times New Roman",Times,serif;margin:5px 0 0 -4px;padding:0;padding-bottom:7px;}h2{font-size:16px;}p,li{padding-bottom:2px;font-size:12px;line-height:18px;}code{font-size:13px;}ul,ol{padding:5px 5px 5px 22px;}#logo{margin:6px 0 14px 0;border-bottom:none;}.step{margin:20px 0 15px;}.step,th{text-align:left;padding:0;}.submit input,.button,.button-secondary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-moz-border-radius:15px;-khtml-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}.button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}.form-table{border-collapse:collapse;margin-top:1em;width:100%;}.form-table td{margin-bottom:9px;padding:10px;border-bottom:8px solid #fff;font-size:12px;}.form-table th{font-size:13px;text-align:left;padding:16px 10px 10px 10px;border-bottom:8px solid #fff;width:110px;vertical-align:top;}.form-table tr{background:#f3f3f3;}.form-table code{line-height:18px;font-size:18px;}.form-table p{margin:4px 0 0 0;font-size:11px;}.form-table input{line-height:20px;font-size:15px;padding:2px;}#error-page{margin-top:50px;}#error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}#error-page code{font-family:Consolas,Monaco,Courier,monospace;}
|
||||
html { background: #f7f7f7; }
|
||||
|
||||
body {
|
||||
background: #fff;
|
||||
color: #333;
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
margin: 2em auto 0 auto;
|
||||
width: 700px;
|
||||
padding: 1em 2em;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 11px;
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
a { color: #2583ad; text-decoration: none; }
|
||||
|
||||
a:hover { color: #d54e21; }
|
||||
|
||||
h1 {
|
||||
border-bottom: 1px solid #dadada;
|
||||
clear: both;
|
||||
color: #666;
|
||||
font: 24px Georgia, "Times New Roman", Times, serif;
|
||||
margin: 5px 0 0 -4px;
|
||||
padding: 0;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
h2 { font-size: 16px; }
|
||||
|
||||
p, li {
|
||||
padding-bottom: 2px;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
code { font-size: 13px; }
|
||||
|
||||
ul, ol { padding: 5px 5px 5px 22px; }
|
||||
|
||||
#logo { margin: 6px 0 14px 0; border-bottom: none;}
|
||||
|
||||
.step {
|
||||
margin: 20px 0 15px;
|
||||
}
|
||||
|
||||
.step, th { text-align: left; padding: 0; }
|
||||
|
||||
.submit input, .button, .button-secondary {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
text-decoration: none;
|
||||
font-size: 14px !important;
|
||||
line-height: 16px;
|
||||
padding: 6px 12px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #bbb;
|
||||
color: #464646;
|
||||
-moz-border-radius: 15px;
|
||||
-khtml-border-radius: 15px;
|
||||
-webkit-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box;
|
||||
-khtml-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.button:hover, .button-secondary:hover, .submit input:hover {
|
||||
color: #000;
|
||||
border-color: #666;
|
||||
}
|
||||
|
||||
.button, .submit input, .button-secondary {
|
||||
background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
|
||||
}
|
||||
|
||||
.button:active, .submit input:active, .button-secondary:active {
|
||||
background: #eee url(../images/white-grad-active.png) repeat-x scroll left top;
|
||||
}
|
||||
|
||||
.form-table {
|
||||
border-collapse: collapse;
|
||||
margin-top: 1em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.form-table td {
|
||||
margin-bottom: 9px;
|
||||
padding: 10px;
|
||||
border-bottom: 8px solid #fff;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.form-table th {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
padding: 16px 10px 10px 10px;
|
||||
border-bottom: 8px solid #fff;
|
||||
width: 110px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.form-table tr {
|
||||
background: #f3f3f3;
|
||||
}
|
||||
|
||||
.form-table code {
|
||||
line-height: 18px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.form-table p {
|
||||
margin: 4px 0 0 0;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.form-table input {
|
||||
line-height: 20px;
|
||||
font-size: 15px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
#error-page { margin-top: 50px; }
|
||||
|
||||
#error-page p {
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
margin: 25px 0 20px;
|
||||
}
|
||||
|
||||
#error-page code { font-family: Consolas, Monaco, Courier, monospace; }
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
html { background: #f7f7f7; }
|
||||
|
||||
body {
|
||||
background: #fff;
|
||||
color: #333;
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
margin: 2em auto 0 auto;
|
||||
width: 700px;
|
||||
padding: 1em 2em;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 11px;
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
a { color: #2583ad; text-decoration: none; }
|
||||
|
||||
a:hover { color: #d54e21; }
|
||||
|
||||
h1 {
|
||||
border-bottom: 1px solid #dadada;
|
||||
clear: both;
|
||||
color: #666;
|
||||
font: 24px Georgia, "Times New Roman", Times, serif;
|
||||
margin: 5px 0 0 -4px;
|
||||
padding: 0;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
h2 { font-size: 16px; }
|
||||
|
||||
p, li {
|
||||
padding-bottom: 2px;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
code { font-size: 13px; }
|
||||
|
||||
ul, ol { padding: 5px 5px 5px 22px; }
|
||||
|
||||
#logo { margin: 6px 0 14px 0; border-bottom: none;}
|
||||
|
||||
.step {
|
||||
margin: 20px 0 15px;
|
||||
}
|
||||
|
||||
.step, th { text-align: left; padding: 0; }
|
||||
|
||||
.submit input, .button, .button-secondary {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
text-decoration: none;
|
||||
font-size: 14px !important;
|
||||
line-height: 16px;
|
||||
padding: 6px 12px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #bbb;
|
||||
color: #464646;
|
||||
-moz-border-radius: 15px;
|
||||
-khtml-border-radius: 15px;
|
||||
-webkit-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box;
|
||||
-khtml-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.button:hover, .button-secondary:hover, .submit input:hover {
|
||||
color: #000;
|
||||
border-color: #666;
|
||||
}
|
||||
|
||||
.button, .submit input, .button-secondary {
|
||||
background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
|
||||
}
|
||||
|
||||
.button:active, .submit input:active, .button-secondary:active {
|
||||
background: #eee url(../images/white-grad-active.png) repeat-x scroll left top;
|
||||
}
|
||||
|
||||
.form-table {
|
||||
border-collapse: collapse;
|
||||
margin-top: 1em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.form-table td {
|
||||
margin-bottom: 9px;
|
||||
padding: 10px;
|
||||
border-bottom: 8px solid #fff;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.form-table th {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
padding: 16px 10px 10px 10px;
|
||||
border-bottom: 8px solid #fff;
|
||||
width: 110px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.form-table tr {
|
||||
background: #f3f3f3;
|
||||
}
|
||||
|
||||
.form-table code {
|
||||
line-height: 18px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.form-table p {
|
||||
margin: 4px 0 0 0;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.form-table input {
|
||||
line-height: 20px;
|
||||
font-size: 15px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
#error-page { margin-top: 50px; }
|
||||
|
||||
#error-page p {
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
margin: 25px 0 20px;
|
||||
}
|
||||
|
||||
#error-page code { font-family: Consolas, Monaco, Courier, monospace; }
|
||||
@@ -1 +1,111 @@
|
||||
*{margin:0;padding:0;}body{border-top-width:30px;border-top-style:solid;font:11px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}form{margin-left:8px;padding:16px 16px 40px 16px;font-weight:normal;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:5px;background:#fff;border:1px solid #e5e5e5;-moz-box-shadow:rgba(200,200,200,1) 0 4px 18px;-webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px;-khtml-box-shadow:rgba(200,200,200,1) 0 4px 18px;box-shadow:rgba(200,200,200,1) 0 4px 18px;}form .forgetmenot{font-weight:normal;float:left;margin-bottom:0;}.button-primary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;padding:3px 10px;border:none;font-size:12px;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;cursor:pointer;text-decoration:none;margin-top:-3px;}#login form p{margin-bottom:0;}label{color:#777;font-size:13px;}form .forgetmenot label{font-size:11px;line-height:19px;}form .submit,.alignright{float:right;}form p{margin-bottom:24px;}h1 a{background:url(../images/logo-login.gif) no-repeat top center;width:326px;height:67px;text-indent:-9999px;overflow:hidden;padding-bottom:15px;display:block;}#nav{text-shadow:rgba(255,255,255,1) 0 1px 0;}#backtoblog a{position:absolute;top:7px;left:15px;text-decoration:none;}#login{width:320px;margin:7em auto;}#login_error,.message{margin:0 0 16px 8px;border-width:1px;border-style:solid;padding:12px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}#nav{margin:0 0 0 8px;padding:16px;}#user_pass,#user_login,#user_email{font-size:24px;width:97%;padding:3px;margin-top:2px;margin-right:6px;margin-bottom:16px;border:1px solid #e5e5e5;background:#fbfbfb;}input{color:#555;}.clear{clear:both;}
|
||||
* { margin: 0; padding: 0; }
|
||||
|
||||
body {
|
||||
border-top-width: 30px;
|
||||
border-top-style: solid;
|
||||
font: 11px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
}
|
||||
|
||||
form {
|
||||
margin-left: 8px;
|
||||
padding: 16px 16px 40px 16px;
|
||||
font-weight: normal;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 5px;
|
||||
background: #fff;
|
||||
border: 1px solid #e5e5e5;
|
||||
-moz-box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
-webkit-box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
-khtml-box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
}
|
||||
|
||||
form .forgetmenot { font-weight: normal; float: left; margin-bottom: 0; }
|
||||
|
||||
#login form .submit input {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
padding: 3px 10px;
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 11px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
margin-top: -3px;
|
||||
text-shadow: rgba(0,0,0,0.3) 0 -1px 0;
|
||||
}
|
||||
|
||||
#login form p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
color: #777;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
form .forgetmenot label {
|
||||
font-size: 11px;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
form .submit { float: right; }
|
||||
|
||||
form p { margin-bottom: 24px; }
|
||||
|
||||
h1 a {
|
||||
background: url(../images/logo-login.gif) no-repeat top center;
|
||||
width: 326px;
|
||||
height: 67px;
|
||||
text-indent: -9999px;
|
||||
overflow: hidden;
|
||||
padding-bottom: 15px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#nav {
|
||||
text-shadow: rgba(255,255,255,1) 0 1px 0;
|
||||
}
|
||||
|
||||
#backtoblog a {
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
left: 15px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#login { width: 320px; margin: 7em auto; }
|
||||
|
||||
#login_error, .message {
|
||||
margin: 0 0 16px 8px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 12px;
|
||||
-moz-border-radius: 3px;
|
||||
-khtml-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#nav { margin: 0 0 0 8px; padding: 16px; }
|
||||
|
||||
#user_pass, #user_login, #user_email {
|
||||
font-size: 24px;
|
||||
width: 97%;
|
||||
padding: 3px;
|
||||
margin-top: 2px;
|
||||
margin-right: 6px;
|
||||
margin-bottom: 16px;
|
||||
border: 1px solid #e5e5e5;
|
||||
background: #fbfbfb;
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
* { margin: 0; padding: 0; }
|
||||
|
||||
body {
|
||||
border-top-width: 30px;
|
||||
border-top-style: solid;
|
||||
font: 11px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
}
|
||||
|
||||
form {
|
||||
margin-left: 8px;
|
||||
padding: 16px 16px 40px 16px;
|
||||
font-weight: normal;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 5px;
|
||||
background: #fff;
|
||||
border: 1px solid #e5e5e5;
|
||||
-moz-box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
-webkit-box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
-khtml-box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
}
|
||||
|
||||
form .forgetmenot {
|
||||
font-weight: normal;
|
||||
float: left;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.button-primary {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
padding: 3px 10px;
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 11px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
margin-top: -3px;
|
||||
}
|
||||
|
||||
#login form p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
color: #777;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
form .forgetmenot label {
|
||||
font-size: 11px;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
form .submit,
|
||||
.alignright {
|
||||
float: right;
|
||||
}
|
||||
|
||||
form p {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
h1 a {
|
||||
background: url(../images/logo-login.gif) no-repeat top center;
|
||||
width: 326px;
|
||||
height: 67px;
|
||||
text-indent: -9999px;
|
||||
overflow: hidden;
|
||||
padding-bottom: 15px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#nav {
|
||||
text-shadow: rgba(255,255,255,1) 0 1px 0;
|
||||
}
|
||||
|
||||
#backtoblog a {
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
left: 15px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#login { width: 320px; margin: 7em auto; }
|
||||
|
||||
#login_error,
|
||||
.message {
|
||||
margin: 0 0 16px 8px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 12px;
|
||||
-moz-border-radius: 3px;
|
||||
-khtml-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#nav {
|
||||
margin: 0 0 0 8px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
#user_pass,
|
||||
#user_login,
|
||||
#user_email {
|
||||
font-size: 24px;
|
||||
width: 97%;
|
||||
padding: 3px;
|
||||
margin-top: 2px;
|
||||
margin-right: 6px;
|
||||
margin-bottom: 16px;
|
||||
border: 1px solid #e5e5e5;
|
||||
background: #fbfbfb;
|
||||
}
|
||||
|
||||
input {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
@@ -47,7 +47,15 @@ button.dismiss {
|
||||
border-right-style: none;
|
||||
border-left-style: solid;
|
||||
}
|
||||
|
||||
.media-item .pinkynail {
|
||||
float: right;
|
||||
}
|
||||
.describe-toggle-on,
|
||||
.describe-toggle-off {
|
||||
float: left;
|
||||
margin-right: 0;
|
||||
margin-left: 20px;
|
||||
}
|
||||
/* Specific to Uploader */
|
||||
#media-upload .media-upload-form p {
|
||||
margin: 0 0 1em 1em;
|
||||
|
||||
@@ -1 +1,400 @@
|
||||
div#media-upload-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em;}body#media-upload ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px;}div#media-upload-error{margin:1em;font-weight:bold;}form{margin:1em;}#search-filter{text-align:right;}th{position:relative;}.media-upload-form label.form-help,td.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}.media-upload-form p.help{margin:0;padding:0;}.media-upload-form fieldset{width:100%;border:none;text-align:justify;margin:0 0 1em 0;padding:0;}.image-align-none-label{background:url(../images/align-none.png) no-repeat center left;}.image-align-left-label{background:url(../images/align-left.png) no-repeat center left;}.image-align-center-label{background:url(../images/align-center.png) no-repeat center left;}.image-align-right-label{background:url(../images/align-right.png) no-repeat center left;}tr.image-size td{width:460px;}tr.image-size div.image-size-item{float:left;width:25%;margin:0;}#library-form .progress,#gallery-form .progress,#flash-upload-ui,.insert-gallery,.describe.startopen,.describe.startclosed{display:none;}.media-item .thumbnail{max-width:128px;max-height:128px;}thead.media-item-info tr{background-color:transparent;}thead.media-item-info th,thead.media-item-info td{border:none;margin:0;}.form-table thead.media-item-info{border:8px solid #fff;}abbr.required{text-decoration:none;border:none;}.describe label{display:inline;}.describe td{vertical-align:middle;padding:0 5px 8px 0;}.describe td.error{padding:2px 8px;}.describe td.A1{width:132px;}.describe input[type="text"],.describe textarea{width:460px;border-width:1px;border-style:solid;}.hidden{height:0;width:0;overflow:hidden;border:none;}#media-upload p.ml-submit{padding:1em 0;}#media-upload p.help,#media-upload label.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}#media-upload tr.image-size td.field{text-align:center;}#media-upload #media-items{border-width:1px;border-style:solid;border-bottom:none;width:623px;}#media-upload .media-item{border-bottom-width:1px;border-bottom-style:solid;min-height:36px;width:100%;}#media-upload .ui-sortable .media-item{cursor:move;}.filename{line-height:36px;padding:0 10px;overflow:hidden;}#media-upload .describe{padding:5px;width:100%;clear:both;cursor:default;}#media-upload .slidetoggle{border-top-width:1px;border-top-style:solid;}#media-upload .describe th.label{padding-top:.2em;text-align:left;min-width:120px;}#media-upload tr.align td.field{text-align:center;}#media-upload tr.image-size{margin-bottom:1em;height:3em;}#media-upload #filter{width:623px;}#media-upload #filter .subsubsub{margin:8px 0;}#filter .tablenav select{border-style:solid;border-width:1px;padding:2px;vertical-align:top;width:auto;}#media-upload .del-attachment{display:none;margin:5px 0;}.menu_order{float:right;font-size:11px;margin:10px 10px 0;}.menu_order_input{border:1px solid #ddd;font-size:10px;padding:1px;width:23px;}.ui-sortable-helper{background-color:#fff;border:1px solid #aaa;opacity:.6;filter:alpha(opacity=60);}#media-upload th.order-head{width:20%;text-align:center;}#media-upload th.actions-head{width:25%;text-align:center;}#media-upload a.wp-post-thumbnail{margin:0 20px;}#media-items a.delete{display:block;float:right;}#media-upload .widefat{width:626px;border-style:solid solid none;}.sorthelper{height:37px;width:623px;display:block;}#gallery-settings th.label{width:160px;}#gallery-settings #basic th.label{padding:5px 5px 5px 0;}#gallery-settings .title{clear:both;padding:0 0 3px;font-size:1.6em;border-bottom:1px solid #DADADA;}h3.media-title{font-size:1.6em;}h4.media-sub-title{border-bottom:1px solid #DADADA;font-size:1.3em;margin:12px;padding:0 0 3px;}#gallery-settings .title,h3.media-title,h4.media-sub-title{font-family:Georgia,"Times New Roman",Times,serif;font-weight:normal;color:#5A5A5A;}#gallery-settings .describe td{vertical-align:middle;height:3em;}#gallery-settings .describe th.label{padding-top:.5em;text-align:left;}#gallery-settings .describe{padding:5px;width:615px;clear:both;cursor:default;}#gallery-settings .describe select{width:15em;}#gallery-settings .describe select option,#gallery-settings .describe td{padding:0;}#gallery-settings label,#gallery-settings legend{font-size:13px;color:#464646;margin-right:15px;}#gallery-settings .align .field label{margin:0 1.5em 0 0;}#gallery-settings p.ml-submit{border-top:1px solid #dfdfdf;}#gallery-settings select#columns{width:6em;}#sort-buttons{font-size:.8em;margin:3px 25px -8px 0;text-align:right;max-width:625px;}#sort-buttons a{text-decoration:none;}#sort-buttons #asc,#sort-buttons #showall{padding-left:5px;}#sort-buttons span{margin-right:25px;}
|
||||
div#media-upload-header {
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
height: 2.5em;
|
||||
}
|
||||
|
||||
body#media-upload ul#sidemenu {
|
||||
font-weight: normal;
|
||||
margin: 0 5px;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
bottom: -1px;
|
||||
}
|
||||
|
||||
div#media-upload-error {
|
||||
margin: 1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
form {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
#search-filter {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.media-upload-form label,
|
||||
.media-upload-form legend {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
margin-bottom: 0.5em;
|
||||
margin: 0 0 0.5em 0;
|
||||
}
|
||||
|
||||
th {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.media-upload-form label.form-help, td.help {
|
||||
font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.media-upload-form p.help {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.media-upload-form fieldset {
|
||||
width: 100%;
|
||||
border: none;
|
||||
text-align: justify;
|
||||
margin: 0 0 1em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* specific to the image upload form */
|
||||
.align .field label {
|
||||
display: inline;
|
||||
padding: 0 0 0 28px;
|
||||
margin: 0 1em 0 0;
|
||||
}
|
||||
|
||||
.image-align-none-label {
|
||||
background: url(../images/align-none.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-left-label {
|
||||
background: url(../images/align-left.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-center-label {
|
||||
background: url(../images/align-center.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-right-label {
|
||||
background: url(../images/align-right.png) no-repeat center left;
|
||||
}
|
||||
|
||||
tr.image-size td {
|
||||
width: 460px;
|
||||
}
|
||||
|
||||
tr.image-size div.image-size-item {
|
||||
float: left;
|
||||
width: 25%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
tr.image-size label {
|
||||
display: inline;
|
||||
margin: 0 0 0 1em;
|
||||
}
|
||||
|
||||
.pinkynail {
|
||||
max-width: 40px;
|
||||
max-height: 40px;
|
||||
}
|
||||
|
||||
#library-form .progress,
|
||||
#gallery-form .progress,
|
||||
#flash-upload-ui,
|
||||
.insert-gallery,
|
||||
.describe.startopen,
|
||||
.describe.startclosed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.media-item .thumbnail {
|
||||
max-width: 128px;
|
||||
max-height: 128px;
|
||||
}
|
||||
|
||||
.media-item .pinkynail {
|
||||
float: left;
|
||||
margin: 2px;
|
||||
height: 32px;
|
||||
max-width: 40px;
|
||||
}
|
||||
|
||||
thead.media-item-info tr {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
thead.media-item-info th,
|
||||
thead.media-item-info td {
|
||||
border: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.form-table thead.media-item-info {
|
||||
border: 8px solid #fff;
|
||||
}
|
||||
|
||||
abbr.required {
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.describe label {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.describe td {
|
||||
vertical-align: middle;
|
||||
padding: 0 5px 0 0;
|
||||
}
|
||||
|
||||
.describe td.A1 {
|
||||
width: 132px;
|
||||
}
|
||||
|
||||
.describe input[type="text"],
|
||||
.describe textarea {
|
||||
width: 460px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.describe-toggle-on,
|
||||
.describe-toggle-off {
|
||||
display: block;
|
||||
line-height: 36px;
|
||||
float: right;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.describe-toggle-off {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
height: 0;
|
||||
width: 0;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* Specific to Uploader */
|
||||
|
||||
#media-upload .media-upload-form p {
|
||||
margin: 0 1em 1em 0;
|
||||
}
|
||||
|
||||
#media-upload p.ml-submit {
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
#media-upload p.help,
|
||||
#media-upload label.help {
|
||||
font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#media-upload tr.image-size td.field {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload #media-items {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-bottom: none;
|
||||
width: 623px;
|
||||
}
|
||||
|
||||
#media-upload .media-item {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
min-height: 36px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#media-upload .ui-sortable .media-item {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.filename {
|
||||
line-height: 36px;
|
||||
padding: 0 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#media-upload .describe {
|
||||
padding: 5px;
|
||||
width: 100%;
|
||||
clear: both;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#media-upload .slidetoggle {
|
||||
border-top-width: 1px;
|
||||
border-top-style: solid;
|
||||
}
|
||||
|
||||
#media-upload .describe th.label {
|
||||
padding-top: .5em;
|
||||
text-align: left;
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
#media-upload tr.align td.field {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload tr.image-size {
|
||||
margin-bottom: 1em;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
#media-upload #filter {
|
||||
width: 623px;
|
||||
}
|
||||
|
||||
#media-upload #filter .subsubsub {
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
#filter .tablenav select {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding: 2px;
|
||||
vertical-align: top;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#media-upload .del-attachment {
|
||||
display: none;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.menu_order {
|
||||
float: right;
|
||||
font-size: 11px;
|
||||
margin: 10px 10px 0;
|
||||
}
|
||||
|
||||
.menu_order_input {
|
||||
border: 1px solid #ddd;
|
||||
font-size: 10px;
|
||||
padding: 1px;
|
||||
width: 23px;
|
||||
}
|
||||
|
||||
.ui-sortable-helper {
|
||||
background-color: #fff;
|
||||
border: 1px solid #aaa;
|
||||
opacity: 0.6;
|
||||
filter: alpha(opacity=60);
|
||||
}
|
||||
|
||||
#media-upload th.order-head {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload .widefat {
|
||||
width: 626px;
|
||||
border-style: solid solid none;
|
||||
}
|
||||
|
||||
.sorthelper {
|
||||
height: 37px;
|
||||
width: 623px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#gallery-settings th.label {
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
#gallery-settings #basic th.label {
|
||||
padding: 5px 5px 5px 0;
|
||||
}
|
||||
|
||||
#gallery-settings .title {
|
||||
clear: both;
|
||||
padding: 0 0 3px;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 1px;
|
||||
font-family: Georgia,"Times New Roman",Times,serif;
|
||||
font-size: 1.6em;
|
||||
border-bottom-color: #DADADA;
|
||||
color: #5A5A5A;
|
||||
}
|
||||
|
||||
h3.media-title {
|
||||
color: #5A5A5A;
|
||||
font-family: Georgia,"Times New Roman",Times,serif;
|
||||
font-size: 1.6em;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#gallery-settings .describe td {
|
||||
vertical-align: middle;
|
||||
height: 3.5em;
|
||||
}
|
||||
|
||||
#gallery-settings .describe th.label {
|
||||
padding-top: .5em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#gallery-settings .describe {
|
||||
padding: 5px;
|
||||
width: 615px;
|
||||
clear: both;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#gallery-settings .describe select {
|
||||
width: 15em;
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
#gallery-settings label,
|
||||
#gallery-settings legend {
|
||||
font-size: 13px;
|
||||
color: #464646;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
#gallery-settings .align .field label {
|
||||
margin: 0 1.5em 0 0;
|
||||
}
|
||||
|
||||
#gallery-settings p.ml-submit {
|
||||
border-top: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
#gallery-settings select#columns {
|
||||
width: 6em;
|
||||
}
|
||||
|
||||
#sort-buttons {
|
||||
font-size: 0.8em;
|
||||
margin: 3px 25px -8px 0;
|
||||
text-align: right;
|
||||
max-width: 625px;
|
||||
}
|
||||
|
||||
#sort-buttons a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#sort-buttons #asc,
|
||||
#sort-buttons #showall {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#sort-buttons span {
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
@@ -1,384 +0,0 @@
|
||||
div#media-upload-header {
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
height: 2.5em;
|
||||
}
|
||||
|
||||
body#media-upload ul#sidemenu {
|
||||
font-weight: normal;
|
||||
margin: 0 5px;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
bottom: -1px;
|
||||
}
|
||||
|
||||
div#media-upload-error {
|
||||
margin: 1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
form {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
#search-filter {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
th {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.media-upload-form label.form-help, td.help {
|
||||
font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.media-upload-form p.help {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.media-upload-form fieldset {
|
||||
width: 100%;
|
||||
border: none;
|
||||
text-align: justify;
|
||||
margin: 0 0 1em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* specific to the image upload form */
|
||||
|
||||
|
||||
.image-align-none-label {
|
||||
background: url(../images/align-none.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-left-label {
|
||||
background: url(../images/align-left.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-center-label {
|
||||
background: url(../images/align-center.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-right-label {
|
||||
background: url(../images/align-right.png) no-repeat center left;
|
||||
}
|
||||
|
||||
tr.image-size td {
|
||||
width: 460px;
|
||||
}
|
||||
|
||||
tr.image-size div.image-size-item {
|
||||
float: left;
|
||||
width: 25%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#library-form .progress,
|
||||
#gallery-form .progress,
|
||||
#flash-upload-ui,
|
||||
.insert-gallery,
|
||||
.describe.startopen,
|
||||
.describe.startclosed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.media-item .thumbnail {
|
||||
max-width: 128px;
|
||||
max-height: 128px;
|
||||
}
|
||||
|
||||
thead.media-item-info tr {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
thead.media-item-info th,
|
||||
thead.media-item-info td {
|
||||
border: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.form-table thead.media-item-info {
|
||||
border: 8px solid #fff;
|
||||
}
|
||||
|
||||
abbr.required {
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.describe label {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.describe td {
|
||||
vertical-align: middle;
|
||||
padding: 0 5px 8px 0;
|
||||
}
|
||||
|
||||
.describe td.error {
|
||||
padding: 2px 8px;
|
||||
}
|
||||
|
||||
.describe td.A1 {
|
||||
width: 132px;
|
||||
}
|
||||
|
||||
.describe input[type="text"],
|
||||
.describe textarea {
|
||||
width: 460px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
height: 0;
|
||||
width: 0;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* Specific to Uploader */
|
||||
|
||||
#media-upload p.ml-submit {
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
#media-upload p.help,
|
||||
#media-upload label.help {
|
||||
font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#media-upload tr.image-size td.field {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload #media-items {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-bottom: none;
|
||||
width: 623px;
|
||||
}
|
||||
|
||||
#media-upload .media-item {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
min-height: 36px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#media-upload .ui-sortable .media-item {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.filename {
|
||||
line-height: 36px;
|
||||
padding: 0 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#media-upload .describe {
|
||||
padding: 5px;
|
||||
width: 100%;
|
||||
clear: both;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#media-upload .slidetoggle {
|
||||
border-top-width: 1px;
|
||||
border-top-style: solid;
|
||||
}
|
||||
|
||||
#media-upload .describe th.label {
|
||||
padding-top: .2em;
|
||||
text-align: left;
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
#media-upload tr.align td.field {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload tr.image-size {
|
||||
margin-bottom: 1em;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
#media-upload #filter {
|
||||
width: 623px;
|
||||
}
|
||||
|
||||
#media-upload #filter .subsubsub {
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
#filter .tablenav select {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding: 2px;
|
||||
vertical-align: top;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#media-upload .del-attachment {
|
||||
display: none;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.menu_order {
|
||||
float: right;
|
||||
font-size: 11px;
|
||||
margin: 10px 10px 0;
|
||||
}
|
||||
|
||||
.menu_order_input {
|
||||
border: 1px solid #ddd;
|
||||
font-size: 10px;
|
||||
padding: 1px;
|
||||
width: 23px;
|
||||
}
|
||||
|
||||
.ui-sortable-helper {
|
||||
background-color: #fff;
|
||||
border: 1px solid #aaa;
|
||||
opacity: 0.6;
|
||||
filter: alpha(opacity=60);
|
||||
}
|
||||
|
||||
#media-upload th.order-head {
|
||||
width: 20%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload th.actions-head {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload a.wp-post-thumbnail {
|
||||
margin: 0 20px;
|
||||
}
|
||||
|
||||
#media-items a.delete {
|
||||
display: block;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#media-upload .widefat {
|
||||
width: 626px;
|
||||
border-style: solid solid none;
|
||||
}
|
||||
|
||||
.sorthelper {
|
||||
height: 37px;
|
||||
width: 623px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#gallery-settings th.label {
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
#gallery-settings #basic th.label {
|
||||
padding: 5px 5px 5px 0;
|
||||
}
|
||||
|
||||
#gallery-settings .title {
|
||||
clear: both;
|
||||
padding: 0 0 3px;
|
||||
font-size: 1.6em;
|
||||
border-bottom: 1px solid #DADADA;
|
||||
}
|
||||
|
||||
h3.media-title {
|
||||
font-size: 1.6em;
|
||||
}
|
||||
|
||||
h4.media-sub-title {
|
||||
border-bottom: 1px solid #DADADA;
|
||||
font-size: 1.3em;
|
||||
margin: 12px;
|
||||
padding: 0 0 3px;
|
||||
}
|
||||
|
||||
#gallery-settings .title,
|
||||
h3.media-title,
|
||||
h4.media-sub-title {
|
||||
font-family: Georgia,"Times New Roman",Times,serif;
|
||||
font-weight: normal;
|
||||
color: #5A5A5A;
|
||||
}
|
||||
|
||||
#gallery-settings .describe td {
|
||||
vertical-align: middle;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
#gallery-settings .describe th.label {
|
||||
padding-top: .5em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#gallery-settings .describe {
|
||||
padding: 5px;
|
||||
width: 615px;
|
||||
clear: both;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#gallery-settings .describe select {
|
||||
width: 15em;
|
||||
}
|
||||
|
||||
#gallery-settings .describe select option,
|
||||
#gallery-settings .describe td {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#gallery-settings label,
|
||||
#gallery-settings legend {
|
||||
font-size: 13px;
|
||||
color: #464646;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
#gallery-settings .align .field label {
|
||||
margin: 0 1.5em 0 0;
|
||||
}
|
||||
|
||||
#gallery-settings p.ml-submit {
|
||||
border-top: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
#gallery-settings select#columns {
|
||||
width: 6em;
|
||||
}
|
||||
|
||||
#sort-buttons {
|
||||
font-size: 0.8em;
|
||||
margin: 3px 25px -8px 0;
|
||||
text-align: right;
|
||||
max-width: 625px;
|
||||
}
|
||||
|
||||
#sort-buttons a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#sort-buttons #asc,
|
||||
#sort-buttons #showall {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#sort-buttons span {
|
||||
margin-right: 25px;
|
||||
}
|
||||
@@ -1 +1,148 @@
|
||||
div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.star{height:100%;position:absolute;top:0;left:0;background-color:transparent;letter-spacing:1ex;border:none;}.star1{width:20%;}.star2{width:40%;}.star3{width:60%;}.star4{width:80%;}.star5{width:100%;}.star img,div.star a,div.star a:hover,div.star a:visited{display:block;position:absolute;right:0;border:none;text-decoration:none;}div.star img{width:19px;height:19px;border-left:1px solid #fff;border-right:1px solid #fff;}#plugin-information-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em;}#plugin-information ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px;}#plugin-information p.action-button{width:100%;padding-bottom:0;margin-bottom:0;margin-top:10px;-moz-border-radius:3px 0 0 3px;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}#plugin-information .action-button a{text-align:center;font-weight:bold;text-decoration:none;display:block;line-height:2em;}#plugin-information h2{clear:none!important;margin-right:200px;}#plugin-information .fyi{margin:0 10px 50px;width:210px;}#plugin-information .fyi h2{font-size:.9em;margin-bottom:0;margin-right:0;}#plugin-information .fyi h2.mainheader{padding:5px;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;}#plugin-information .fyi ul{padding:10px 5px 10px 7px;margin:0;list-style:none;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}#plugin-information .fyi li{margin-right:0;}#plugin-information #section-holder{padding:10px;}#plugin-information .section ul,#plugin-information .section ol{margin-left:16px;list-style-type:square;list-style-image:none;}#plugin-information #section-screenshots li img{vertical-align:text-top;}#plugin-information #section-screenshots li p{font-style:italic;padding-left:20px;padding-bottom:2em;}#plugin-information .updated,#plugin-information pre{margin-right:215px;}#plugin-information pre{padding:7px;}
|
||||
/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */
|
||||
div.star-holder {
|
||||
position: relative;
|
||||
height: 19px;
|
||||
width: 100px;
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
div.star {
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: transparent;
|
||||
letter-spacing: 1ex;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.star1 { width: 20%; }
|
||||
.star2 { width: 40%; }
|
||||
.star3 { width: 60%; }
|
||||
.star4 { width: 80%; }
|
||||
.star5 { width: 100%; }
|
||||
|
||||
.star img, div.star a, div.star a:hover, div.star a:visited {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
div.star img {
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
border-left: 1px solid #fff;
|
||||
border-right: 1px solid #fff;
|
||||
}
|
||||
|
||||
/* Start custom CSS */
|
||||
/* Header on thickbox */
|
||||
#plugin-information-header {
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
height: 2.5em;
|
||||
}
|
||||
#plugin-information ul#sidemenu {
|
||||
font-weight: normal;
|
||||
margin: 0 5px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -1px;
|
||||
}
|
||||
|
||||
/* Install sidemenu */
|
||||
#plugin-information p.action-button {
|
||||
width: 100%;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
margin-top: 10px;
|
||||
-moz-border-radius: 3px 0 0 3px;
|
||||
-webkit-border-top-left-radius: 3px;
|
||||
-khtml-border-top-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
-khtml-border-bottom-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
}
|
||||
|
||||
#plugin-information .action-button a {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
line-height: 2em;
|
||||
}
|
||||
|
||||
#plugin-information h2 {
|
||||
clear: none !important;
|
||||
margin-right: 200px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi {
|
||||
margin: 0 10px 50px;
|
||||
width: 210px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi h2 {
|
||||
font-size: 0.9em;
|
||||
margin-bottom: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#plugin-information .fyi h2.mainheader {
|
||||
padding: 5px;
|
||||
-moz-border-radius-topleft: 3px;
|
||||
-webkit-border-top-left-radius: 3px;
|
||||
-khtml-border-top-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi ul {
|
||||
padding: 10px 5px 10px 7px;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
-moz-border-radius-bottomleft: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
-khtml-border-bottom-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi li {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#plugin-information #section-holder {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#plugin-information .section ul,
|
||||
#plugin-information .section ol {
|
||||
margin-left: 16px;
|
||||
list-style-type: square;
|
||||
list-style-image: none;
|
||||
}
|
||||
|
||||
#plugin-information #section-screenshots li img {
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
#plugin-information #section-screenshots li p {
|
||||
font-style: italic;
|
||||
padding-left: 20px;
|
||||
padding-bottom: 2em;
|
||||
}
|
||||
|
||||
#plugin-information .updated,
|
||||
#plugin-information pre {
|
||||
margin-right: 215px;
|
||||
}
|
||||
|
||||
#plugin-information pre {
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
@@ -1,148 +0,0 @@
|
||||
/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */
|
||||
div.star-holder {
|
||||
position: relative;
|
||||
height: 19px;
|
||||
width: 100px;
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
div.star {
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: transparent;
|
||||
letter-spacing: 1ex;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.star1 { width: 20%; }
|
||||
.star2 { width: 40%; }
|
||||
.star3 { width: 60%; }
|
||||
.star4 { width: 80%; }
|
||||
.star5 { width: 100%; }
|
||||
|
||||
.star img, div.star a, div.star a:hover, div.star a:visited {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
div.star img {
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
border-left: 1px solid #fff;
|
||||
border-right: 1px solid #fff;
|
||||
}
|
||||
|
||||
/* Start custom CSS */
|
||||
/* Header on thickbox */
|
||||
#plugin-information-header {
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
height: 2.5em;
|
||||
}
|
||||
#plugin-information ul#sidemenu {
|
||||
font-weight: normal;
|
||||
margin: 0 5px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -1px;
|
||||
}
|
||||
|
||||
/* Install sidemenu */
|
||||
#plugin-information p.action-button {
|
||||
width: 100%;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
margin-top: 10px;
|
||||
-moz-border-radius: 3px 0 0 3px;
|
||||
-webkit-border-top-left-radius: 3px;
|
||||
-khtml-border-top-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
-khtml-border-bottom-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
}
|
||||
|
||||
#plugin-information .action-button a {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
line-height: 2em;
|
||||
}
|
||||
|
||||
#plugin-information h2 {
|
||||
clear: none !important;
|
||||
margin-right: 200px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi {
|
||||
margin: 0 10px 50px;
|
||||
width: 210px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi h2 {
|
||||
font-size: 0.9em;
|
||||
margin-bottom: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#plugin-information .fyi h2.mainheader {
|
||||
padding: 5px;
|
||||
-moz-border-radius-topleft: 3px;
|
||||
-webkit-border-top-left-radius: 3px;
|
||||
-khtml-border-top-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi ul {
|
||||
padding: 10px 5px 10px 7px;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
-moz-border-radius-bottomleft: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
-khtml-border-bottom-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi li {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#plugin-information #section-holder {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#plugin-information .section ul,
|
||||
#plugin-information .section ol {
|
||||
margin-left: 16px;
|
||||
list-style-type: square;
|
||||
list-style-image: none;
|
||||
}
|
||||
|
||||
#plugin-information #section-screenshots li img {
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
#plugin-information #section-screenshots li p {
|
||||
font-style: italic;
|
||||
padding-left: 20px;
|
||||
padding-bottom: 2em;
|
||||
}
|
||||
|
||||
#plugin-information .updated,
|
||||
#plugin-information pre {
|
||||
margin-right: 215px;
|
||||
}
|
||||
|
||||
#plugin-information pre {
|
||||
padding: 7px;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,586 +0,0 @@
|
||||
|
||||
body {
|
||||
font: 13px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
|
||||
color: #333;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-width: 675px;
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
#wphead {
|
||||
border-top: none;
|
||||
padding-top: 4px;
|
||||
background: #444 !important;
|
||||
}
|
||||
|
||||
.tagchecklist span a {
|
||||
background: transparent url(../images/xit.gif) no-repeat 0 0;
|
||||
}
|
||||
|
||||
#poststuff #edButtonPreview,
|
||||
#poststuff #edButtonHTML {
|
||||
-moz-border-radius: 3px 3px 0 0;
|
||||
-webkit-border-top-right-radius: 3px;
|
||||
-webkit-border-top-left-radius: 3px;
|
||||
-khtml-border-top-right-radius: 3px;
|
||||
-khtml-border-top-left-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
height: 18px;
|
||||
margin: 0 5px 0 0;
|
||||
padding: 0 5px 0;
|
||||
font-size: 10px;
|
||||
line-height: 18px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.howto {
|
||||
margin-top: 2px;
|
||||
margin-bottom: 3px;
|
||||
font-size: 11px;
|
||||
font-style: italic;
|
||||
display: block;
|
||||
}
|
||||
|
||||
input.text {
|
||||
outline-color: -moz-use-text-color;
|
||||
outline-style: none;
|
||||
outline-width: medium;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#message {
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
/* Editor/Main Column */
|
||||
div#poststuff {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
div.zerosize {
|
||||
border: 0 none;
|
||||
height: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
#poststuff #edButtonPreview.active,
|
||||
#poststuff #edButtonHTML.active {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.posting {
|
||||
margin-right: 212px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#side-info-column {
|
||||
float: right;
|
||||
width: 200px;
|
||||
position: relative;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
#side-info-column .sleeve {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
#poststuff .inside {
|
||||
font-size: 11px;
|
||||
margin: 8px;
|
||||
}
|
||||
|
||||
#poststuff h2,#poststuff h3 {
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
margin: 0;
|
||||
padding: 7px 9px;
|
||||
}
|
||||
|
||||
#tagsdiv-post_tag h3,
|
||||
#categorydiv h3 {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
h3.tb {
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
#TB_window {
|
||||
border: 1px solid #333;
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.postbox,
|
||||
.stuffbox {
|
||||
margin-bottom: 10px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
line-height: 1;
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.stuffbox:hover .handlediv {
|
||||
background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;
|
||||
}
|
||||
|
||||
.handlediv {
|
||||
float: right;
|
||||
height: 26px;
|
||||
width: 23px;
|
||||
}
|
||||
|
||||
#title,
|
||||
.tbtitle {
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
font-size: 1.7em;
|
||||
outline: none;
|
||||
padding: 3px 4px;
|
||||
border-color: #dfdfdf;
|
||||
}
|
||||
|
||||
.tbtitle {
|
||||
font-size: 12px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
#title {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
.editor-container {
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #dfdfdf;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.postdivrich {
|
||||
padding-top: 25px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.actions {
|
||||
float: right;
|
||||
margin: -19px 0 0;
|
||||
}
|
||||
|
||||
#extra-fields .actions {
|
||||
margin: -15px -5px 0 0;
|
||||
}
|
||||
|
||||
.actions li {
|
||||
float: left;
|
||||
list-style: none;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#extra-fields .button {
|
||||
margin-right: 5px;
|
||||
padding: 3px 6px;
|
||||
border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
-khtml-border-radius: 10px;
|
||||
-moz-border-radius: 10px;
|
||||
}
|
||||
|
||||
/* Photo Styles */
|
||||
.photolist {
|
||||
margin-top: -10px;
|
||||
}
|
||||
|
||||
#photo_saving {
|
||||
margin: 0 8px 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#img_container {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
#img_container_container {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#extra-fields {
|
||||
margin-top: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#waiting {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#extra-fields .postbox {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#extra-fields .titlewrap {
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
#img_container a {
|
||||
display: block;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
vertical-align: center;
|
||||
}
|
||||
|
||||
#img_container img,
|
||||
#img_container a {
|
||||
width: 68px;
|
||||
height: 68px;
|
||||
}
|
||||
|
||||
#img_container img {
|
||||
border: none;
|
||||
background-color: #f4f4f4;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#img_container a,
|
||||
#img_container a:link,
|
||||
#img_container a:visited {
|
||||
border: 1px solid #ccc;
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#img_container a:hover,
|
||||
#img_container a:active {
|
||||
border-color: #000;
|
||||
z-index: 1000;
|
||||
border-width: 2px;
|
||||
margin: -1px;
|
||||
}
|
||||
|
||||
/* Video */
|
||||
#embed-code {
|
||||
width: 100%;
|
||||
height: 98px;
|
||||
}
|
||||
|
||||
/* Submit Column */
|
||||
#viewsite {
|
||||
padding: 0;
|
||||
margin: 0 0 20px 5px;
|
||||
font-size: 10px;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.wp-hidden-children
|
||||
.wp-hidden-child {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#category-adder {
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
#category-adder h4 {
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
|
||||
#category-add input {
|
||||
width: 94%;
|
||||
font-family: Verdana,Arial,Helvetica,sans-serif;
|
||||
font-size: 13px;
|
||||
margin: 1px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
#category-add select {
|
||||
width: 70%;
|
||||
-x-system-font: none;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
font-family: "Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;
|
||||
font-size: 12px;
|
||||
height: 2em;
|
||||
line-height: 20px;
|
||||
padding: 2px;
|
||||
margin: 1px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#category-add input,
|
||||
#category-add-sumbit {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
/* Categories */
|
||||
#categorydiv ul,
|
||||
#linkcategorydiv ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#categorydiv ul.categorychecklist ul {
|
||||
margin-left: 18px;
|
||||
}
|
||||
|
||||
#categorydiv div.tabs-panel {
|
||||
height: 140px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
ul.categorychecklist li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
/* Tags */
|
||||
.screen-reader-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tagsdiv .newtag {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.jaxtag {
|
||||
clear: both;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.tagadd {
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.tagchecklist {
|
||||
margin-top: 3px;
|
||||
margin-bottom: 1em;
|
||||
font-size: 12px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.tagchecklist strong {
|
||||
position: absolute;
|
||||
font-size: .75em;
|
||||
}
|
||||
|
||||
.tagchecklist span {
|
||||
margin-right: .5em;
|
||||
margin-left: 10px;
|
||||
display: block;
|
||||
float: left;
|
||||
font-size: 11px;
|
||||
line-height: 1.8em;
|
||||
white-space: nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.tagchecklist span a {
|
||||
margin: 6px 0 0 -9px;
|
||||
cursor: pointer;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
display: block;
|
||||
float: left;
|
||||
text-indent: -9999px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#content {
|
||||
margin: 5px 0;
|
||||
padding: 0 5px;
|
||||
border: 0 none;
|
||||
height: 365px;
|
||||
width: 97% !important;
|
||||
}
|
||||
|
||||
* html .postdivrich {
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
/* Submit */
|
||||
#saving {
|
||||
display: inline;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.submit input,
|
||||
.button,
|
||||
.button-primary,
|
||||
.button-secondary,
|
||||
.button-highlighted,
|
||||
#postcustomstuff .submit input {
|
||||
font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
|
||||
text-decoration: none;
|
||||
font-size: 11px !important;
|
||||
line-height: 16px;
|
||||
padding: 2px 8px;
|
||||
cursor: pointer;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 11px;
|
||||
}
|
||||
|
||||
.button-primary {
|
||||
background: #21759B url(../images/button-grad.png) repeat-x scroll left top;
|
||||
border-color: #21759B;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ac_results {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
position: absolute;
|
||||
z-index: 10000;
|
||||
display: none;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.ac_results li {
|
||||
padding: 2px 5px;
|
||||
white-space: nowrap;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.ac_over {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ac_match {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#TB_ajaxContent #options {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 25px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#TB_ajaxContent h3 {
|
||||
margin-bottom: .25em;
|
||||
}
|
||||
|
||||
.updated {
|
||||
margin: 10px 0;
|
||||
padding: 0;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
.updated p,
|
||||
.error p {
|
||||
margin: 0.6em 0;
|
||||
padding: 0 0.6em;
|
||||
}
|
||||
|
||||
.error a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.updated a {
|
||||
text-decoration: none;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
#post_status {
|
||||
margin-left: 10px;
|
||||
margin-bottom: 1em;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
#footer {
|
||||
height: 65px;
|
||||
display: block;
|
||||
width: 640px;
|
||||
padding: 10px 0 0 60px;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#footer p {
|
||||
margin: 0;
|
||||
padding: 7px 0;
|
||||
}
|
||||
|
||||
#footer p a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#footer p a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Utility Classes */
|
||||
.centered {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.postbox input[type="text"],
|
||||
.postbox textarea,
|
||||
.stuffbox input[type="text"],
|
||||
.stuffbox textarea {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
/* tag hints */
|
||||
.taghint {
|
||||
color: #aaa;
|
||||
margin: -17px 0 0 7px;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
input.newtag ~ div.taghint {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
input.newtag:focus ~ div.taghint {
|
||||
visibility: hidden;
|
||||
}
|
||||
@@ -1 +1,60 @@
|
||||
#template textarea{font-family:Consolas,Monaco,Courier,monospace;font-size:12px;width:97%;}#template p{width:97%;}#templateside{float:right;width:190px;word-wrap:break-word;}#templateside h3,#postcustomstuff p.submit{margin:0;}#templateside h4{margin:1em 0 0;}#templateside ol,#templateside ul{margin:.5em;padding:0;}#templateside li{margin:4px 0;}.nonessential{font-size:small;}.highlight{padding:1px;}div.tablenav{margin-right:210px;}#documentation{margin-top:10px;}#documentation label{line-height:22px;vertical-align:top;font-weight:bold;}.fileedit-sub{padding:10px 0 8px;line-height:180%;}
|
||||
#template textarea {
|
||||
font-family: Consolas, Monaco, Courier, monospace;
|
||||
font-size: 12px;
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
#template p {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
#templateside {
|
||||
float: right;
|
||||
width: 190px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#templateside h3,
|
||||
#postcustomstuff p.submit {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#templateside h4 {
|
||||
margin: 1em 0 0;
|
||||
}
|
||||
|
||||
#templateside ol,
|
||||
#templateside ul {
|
||||
margin: .5em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#templateside li {
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.nonessential {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
div.tablenav {
|
||||
margin-right: 210px;
|
||||
}
|
||||
|
||||
#documentation {
|
||||
margin-top: 10px;
|
||||
}
|
||||
#documentation label {
|
||||
line-height: 22px;
|
||||
vertical-align: top;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.fileedit-sub {
|
||||
padding: 10px 0 8px;
|
||||
line-height: 180%;
|
||||
}
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
#template textarea {
|
||||
font-family: Consolas, Monaco, Courier, monospace;
|
||||
font-size: 12px;
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
#template p {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
#templateside {
|
||||
float: right;
|
||||
width: 190px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#templateside h3,
|
||||
#postcustomstuff p.submit {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#templateside h4 {
|
||||
margin: 1em 0 0;
|
||||
}
|
||||
|
||||
#templateside ol,
|
||||
#templateside ul {
|
||||
margin: .5em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#templateside li {
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.nonessential {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
div.tablenav {
|
||||
margin-right: 210px;
|
||||
}
|
||||
|
||||
#documentation {
|
||||
margin-top: 10px;
|
||||
}
|
||||
#documentation label {
|
||||
line-height: 22px;
|
||||
vertical-align: top;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.fileedit-sub {
|
||||
padding: 10px 0 8px;
|
||||
line-height: 180%;
|
||||
}
|
||||
@@ -1 +1,142 @@
|
||||
div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.star{height:100%;position:absolute;top:0;left:0;background-color:transparent;letter-spacing:1ex;border:none;}.star1{width:20%;}.star2{width:40%;}.star3{width:60%;}.star4{width:80%;}.star5{width:100%;}.star img,div.star a,div.star a:hover,div.star a:visited{display:block;position:absolute;right:0;border:none;text-decoration:none;}div.star img{width:19px;height:19px;border-left:1px solid #fff;border-right:1px solid #fff;}.theme-listing .theme-item{display:inline-block;width:200px;border:thin solid #ccc;vertical-align:top;}.theme-listing .theme-item h3{text-align:center;font-size:14px;font-style:italic;margin:0;padding:0;}.theme-listing .theme-item img{max-width:150px;max-height:150px;}.theme-listing .theme-item-info span{display:none;}.theme-listing .theme-item:hover .theme-item-info span{display:inline;}.theme-listing .theme-item:hover .theme-item-info span.dots{display:none;}.theme-listing .theme-item-info span.action-links{font-weight:bold;text-align:center;}.theme-listing br.line{border-bottom-width:1px;border-bottom-style:solid;margin-bottom:3px;}.available-theme{padding:20px 15px;}#theme-information .theme-preview-img{float:left;margin:5px 25px 10px 15px;width:300px;}#theme-information .action-button{border-top-width:1px;border-top-style:solid;margin:10px 5px 20px;}#theme-information .action-button #cancel{float:left;margin:10px 15px;}#theme-information .action-button #install{float:right;margin:10px 15px;}#theme-information .available-theme h3{margin:1em 0;}body#theme-information{height:auto;}.feature-filter{-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;border-width:1px;border-style:solid;padding:8px 12px 0;}.feature-filter .feature-group{float:left;margin-bottom:20px;width:695px;}.feature-filter .feature-name{float:left;text-align:right;width:95px;}.feature-filter .feature-group li{display:inline;float:left;list-style-type:none;padding-right:25px;min-width:145px;}
|
||||
/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */
|
||||
div.star-holder {
|
||||
position: relative;
|
||||
height: 19px;
|
||||
width: 100px;
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
div.star {
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: transparent;
|
||||
letter-spacing: 1ex;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.star1 { width: 20%; }
|
||||
.star2 { width: 40%; }
|
||||
.star3 { width: 60%; }
|
||||
.star4 { width: 80%; }
|
||||
.star5 { width: 100%; }
|
||||
|
||||
.star img, div.star a, div.star a:hover, div.star a:visited {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
div.star img {
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
border-left: 1px solid #fff;
|
||||
border-right: 1px solid #fff;
|
||||
}
|
||||
|
||||
.theme-listing .theme-item {
|
||||
display: inline-block;
|
||||
width: 200px;
|
||||
border: thin solid #ccc;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.theme-listing .theme-item h3 {
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-style: italic;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.theme-listing .theme-item img {
|
||||
max-width: 150px;
|
||||
max-height: 150px;
|
||||
}
|
||||
|
||||
.theme-listing .theme-item-info span {
|
||||
display: none;
|
||||
}
|
||||
.theme-listing .theme-item:hover .theme-item-info span {
|
||||
display: inline;
|
||||
}
|
||||
.theme-listing .theme-item:hover .theme-item-info span.dots {
|
||||
display: none;
|
||||
}
|
||||
.theme-listing .theme-item-info span.action-links {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.theme-listing br.line {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.available-theme {
|
||||
padding: 20px 15px;
|
||||
}
|
||||
|
||||
#theme-information .theme-preview-img {
|
||||
float: left;
|
||||
margin: 5px 25px 10px 15px;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#theme-information .action-button {
|
||||
border-top-width: 1px;
|
||||
border-top-style: solid;
|
||||
margin: 10px 5px 20px;
|
||||
}
|
||||
|
||||
#theme-information .action-button #cancel {
|
||||
float: left;
|
||||
margin: 10px 15px;
|
||||
}
|
||||
|
||||
#theme-information .action-button #install {
|
||||
float: right;
|
||||
margin: 10px 15px;
|
||||
}
|
||||
|
||||
#theme-information .available-theme h3 {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
body#theme-information {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.feature-filter {
|
||||
-moz-border-radius: 8px;
|
||||
-khtml-border-radius: 8px;
|
||||
-webkit-border-radius: 8px;
|
||||
border-radius: 8px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 8px 12px 0;
|
||||
}
|
||||
|
||||
.feature-filter .feature-group {
|
||||
float: left;
|
||||
margin-bottom: 20px;
|
||||
width: 695px;
|
||||
}
|
||||
|
||||
.feature-filter .feature-name {
|
||||
float: left;
|
||||
text-align: right;
|
||||
width: 95px;
|
||||
}
|
||||
|
||||
.feature-filter .feature-group li {
|
||||
display: inline;
|
||||
float: left;
|
||||
list-style-type: none;
|
||||
padding-right: 25px;
|
||||
min-width: 145px;
|
||||
}
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */
|
||||
div.star-holder {
|
||||
position: relative;
|
||||
height: 19px;
|
||||
width: 100px;
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
div.star {
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: transparent;
|
||||
letter-spacing: 1ex;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.star1 { width: 20%; }
|
||||
.star2 { width: 40%; }
|
||||
.star3 { width: 60%; }
|
||||
.star4 { width: 80%; }
|
||||
.star5 { width: 100%; }
|
||||
|
||||
.star img, div.star a, div.star a:hover, div.star a:visited {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
div.star img {
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
border-left: 1px solid #fff;
|
||||
border-right: 1px solid #fff;
|
||||
}
|
||||
|
||||
.theme-listing .theme-item {
|
||||
display: inline-block;
|
||||
width: 200px;
|
||||
border: thin solid #ccc;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.theme-listing .theme-item h3 {
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-style: italic;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.theme-listing .theme-item img {
|
||||
max-width: 150px;
|
||||
max-height: 150px;
|
||||
}
|
||||
|
||||
.theme-listing .theme-item-info span {
|
||||
display: none;
|
||||
}
|
||||
.theme-listing .theme-item:hover .theme-item-info span {
|
||||
display: inline;
|
||||
}
|
||||
.theme-listing .theme-item:hover .theme-item-info span.dots {
|
||||
display: none;
|
||||
}
|
||||
.theme-listing .theme-item-info span.action-links {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.theme-listing br.line {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.available-theme {
|
||||
padding: 20px 15px;
|
||||
}
|
||||
|
||||
#theme-information .theme-preview-img {
|
||||
float: left;
|
||||
margin: 5px 25px 10px 15px;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#theme-information .action-button {
|
||||
border-top-width: 1px;
|
||||
border-top-style: solid;
|
||||
margin: 10px 5px 20px;
|
||||
}
|
||||
|
||||
#theme-information .action-button #cancel {
|
||||
float: left;
|
||||
margin: 10px 15px;
|
||||
}
|
||||
|
||||
#theme-information .action-button #install {
|
||||
float: right;
|
||||
margin: 10px 15px;
|
||||
}
|
||||
|
||||
#theme-information .available-theme h3 {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
body#theme-information {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.feature-filter {
|
||||
-moz-border-radius: 8px;
|
||||
-khtml-border-radius: 8px;
|
||||
-webkit-border-radius: 8px;
|
||||
border-radius: 8px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 8px 12px 0;
|
||||
}
|
||||
|
||||
.feature-filter .feature-group {
|
||||
float: left;
|
||||
margin-bottom: 20px;
|
||||
width: 695px;
|
||||
}
|
||||
|
||||
.feature-filter .feature-name {
|
||||
float: left;
|
||||
text-align: right;
|
||||
width: 95px;
|
||||
}
|
||||
|
||||
.feature-filter .feature-group li {
|
||||
display: inline;
|
||||
float: left;
|
||||
list-style-type: none;
|
||||
padding-right: 25px;
|
||||
min-width: 145px;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,370 +0,0 @@
|
||||
html,
|
||||
body {
|
||||
min-width: 950px;
|
||||
}
|
||||
|
||||
/* 2 column liquid layout */
|
||||
div.widget-liquid-left {
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 100%;
|
||||
margin-right: -325px;
|
||||
}
|
||||
|
||||
div#widgets-left {
|
||||
margin-left: 5px;
|
||||
margin-right: 325px;
|
||||
}
|
||||
|
||||
div#widgets-right {
|
||||
width: 285px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
div.widget-liquid-right {
|
||||
float: right;
|
||||
clear: right;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.widget-liquid-right .widget,
|
||||
#wp_inactive_widgets .widget,
|
||||
.widget-liquid-right .sidebar-description {
|
||||
width: 250px;
|
||||
margin: 0 auto 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.widget-liquid-right .sidebar-description {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#wp_inactive_widgets .widget {
|
||||
margin: 0 10px 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
div.sidebar-name h3 {
|
||||
margin: 0;
|
||||
padding: 5px 12px;
|
||||
font-size: 13px;
|
||||
height: 19px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.sidebar-name {
|
||||
background-repeat: repeat-x;
|
||||
background-position: 0 0;
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-moz-border-radius-topleft: 8px;
|
||||
-moz-border-radius-topright: 8px;
|
||||
-webkit-border-top-right-radius: 8px;
|
||||
-webkit-border-top-left-radius: 8px;
|
||||
-khtml-border-top-right-radius: 8px;
|
||||
-khtml-border-top-left-radius: 8px;
|
||||
border-top-right-radius: 8px;
|
||||
border-top-left-radius: 8px;
|
||||
}
|
||||
|
||||
.js .closed .sidebar-name {
|
||||
-moz-border-radius-bottomleft: 8px;
|
||||
-moz-border-radius-bottomright: 8px;
|
||||
-webkit-border-bottom-right-radius: 8px;
|
||||
-webkit-border-bottom-left-radius: 8px;
|
||||
-khtml-border-bottom-right-radius: 8px;
|
||||
-khtml-border-bottom-left-radius: 8px;
|
||||
border-bottom-right-radius: 8px;
|
||||
border-bottom-left-radius: 8px;
|
||||
}
|
||||
|
||||
.widget-liquid-right .widgets-sortables,
|
||||
#widgets-left .widget-holder {
|
||||
border-width: 0 1px 1px;
|
||||
border-style: none solid solid;
|
||||
-moz-border-radius-bottomleft: 8px;
|
||||
-moz-border-radius-bottomright: 8px;
|
||||
-webkit-border-bottom-right-radius: 8px;
|
||||
-webkit-border-bottom-left-radius: 8px;
|
||||
-khtml-border-bottom-right-radius: 8px;
|
||||
-khtml-border-bottom-left-radius: 8px;
|
||||
border-bottom-right-radius: 8px;
|
||||
border-bottom-left-radius: 8px;
|
||||
}
|
||||
|
||||
.js .closed .widgets-sortables,
|
||||
.js .closed .widget-holder {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widget-liquid-right .widgets-sortables {
|
||||
padding: 15px 0 0;
|
||||
}
|
||||
|
||||
#available-widgets .widget-holder {
|
||||
padding: 7px 5px 0;
|
||||
}
|
||||
|
||||
#wp_inactive_widgets {
|
||||
padding: 5px 5px 0;
|
||||
}
|
||||
|
||||
#widget-list .widget {
|
||||
width: 250px;
|
||||
margin: 0 10px 15px;
|
||||
border: 0 none;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#widget-list .widget-description {
|
||||
padding: 5px 8px;
|
||||
}
|
||||
|
||||
#widget-list .widget-top {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.widget-placeholder {
|
||||
border-width: 1px;
|
||||
border-style: dashed;
|
||||
margin: 0 auto 20px;
|
||||
height: 26px;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
#wp_inactive_widgets .widget-placeholder {
|
||||
margin: 0 10px 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
div.widgets-holder-wrap {
|
||||
padding: 0;
|
||||
margin: 10px 0 20px;
|
||||
}
|
||||
|
||||
#widgets-left #available-widgets {
|
||||
background-color: transparent;
|
||||
border: 0 none;
|
||||
}
|
||||
|
||||
ul#widget-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
.widget .widget-top {
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
height: 26px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.widget-top .widget-title {
|
||||
padding: 5px 9px;
|
||||
}
|
||||
|
||||
.widget-top .widget-title-action {
|
||||
float: right;
|
||||
}
|
||||
|
||||
a.widget-action {
|
||||
display: block;
|
||||
width: 24px;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
#available-widgets a.widget-action {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widget-top a.widget-action {
|
||||
background: url("../images/menu-bits.gif") no-repeat scroll 0 -110px;
|
||||
}
|
||||
|
||||
.widget .widget-inside,
|
||||
.widget .widget-description {
|
||||
padding: 12px 12px 10px;
|
||||
font-size: 11px;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
.widget-inside,
|
||||
.widget-description {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#available-widgets .widget-description {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.widget .widget-inside p {
|
||||
margin: 0 0 1em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.widget-title h4 {
|
||||
margin: 0;
|
||||
line-height: 1.3;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.widgets-sortables {
|
||||
min-height: 90px;
|
||||
}
|
||||
|
||||
.widget-control-actions {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.widget-control-actions a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.widget-control-actions a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.widget-control-actions .ajax-feedback {
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
|
||||
.widget-control-actions div.alignleft {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
div#sidebar-info {
|
||||
padding: 0 1em;
|
||||
margin-bottom: 1em;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.widget-title a,
|
||||
.widget-title a:hover {
|
||||
text-decoration: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.widget-control-edit {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
font-weight: normal;
|
||||
line-height: 26px;
|
||||
padding: 0 8px 0 0;
|
||||
}
|
||||
|
||||
a.widget-control-edit {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.widget-control-edit .add,
|
||||
.widget-control-edit .edit {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#available-widgets .widget-control-edit .add,
|
||||
#widgets-right .widget-control-edit .edit,
|
||||
#wp_inactive_widgets .widget-control-edit .edit {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.editwidget {
|
||||
margin: 0 auto 15px;
|
||||
}
|
||||
|
||||
.editwidget .widget-inside {
|
||||
display: block;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 10px;
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.inactive p.description {
|
||||
margin: 5px 15px 8px;
|
||||
}
|
||||
|
||||
#available-widgets p.description {
|
||||
margin: 0 12px 12px;
|
||||
}
|
||||
|
||||
.widget-position {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.inactive {
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.sidebar-name-arrow {
|
||||
float: right;
|
||||
height: 29px;
|
||||
width: 26px;
|
||||
}
|
||||
|
||||
.widget-title .in-widget-title {
|
||||
font-size: 11px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#removing-widget {
|
||||
display: none;
|
||||
font-weight: normal;
|
||||
padding-left: 15px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.widget-control-noform,
|
||||
#access-off,
|
||||
.widgets_access .widget-action,
|
||||
.widgets_access .sidebar-name-arrow,
|
||||
.widgets_access #access-on,
|
||||
.widgets_access .widget-holder .description {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widgets_access .widget-holder,
|
||||
.widgets_access #widget-list {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.widgets_access #access-off {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.widgets_access #wpbody-content .widget-title-action,
|
||||
.widgets_access #wpbody-content .widget-control-edit,
|
||||
.widgets_access .closed .widgets-sortables,
|
||||
.widgets_access .closed .widget-holder {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.widgets_access .closed .sidebar-name {
|
||||
-moz-border-radius-bottomleft: 0;
|
||||
-moz-border-radius-bottomright: 0;
|
||||
-webkit-border-bottom-right-radius: 0;
|
||||
-webkit-border-bottom-left-radius: 0;
|
||||
-khtml-border-bottom-right-radius: 0;
|
||||
-khtml-border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
.widgets_access .sidebar-name,
|
||||
.widgets_access .widget .widget-top {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
@@ -30,18 +30,12 @@ add_filter('the_title','esc_html');
|
||||
$alt = '';
|
||||
$posts_columns = get_column_headers('upload');
|
||||
$hidden = get_hidden_columns('upload');
|
||||
|
||||
while ( have_posts() ) : the_post();
|
||||
|
||||
if ( $is_trash && $post->post_status != 'trash' )
|
||||
continue;
|
||||
elseif ( !$is_trash && $post->post_status == 'trash' )
|
||||
continue;
|
||||
|
||||
while (have_posts()) : the_post();
|
||||
$alt = ( 'alternate' == $alt ) ? '' : 'alternate';
|
||||
global $current_user;
|
||||
$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
|
||||
$att_title = _draft_or_post_title();
|
||||
|
||||
?>
|
||||
<tr id='post-<?php echo $id; ?>' class='<?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
|
||||
|
||||
@@ -59,7 +53,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
|
||||
case 'cb':
|
||||
?>
|
||||
<th scope="row" class="check-column"><?php if ( current_user_can('edit_post', $post->ID) ) { ?><input type="checkbox" name="media[]" value="<?php the_ID(); ?>" /><?php } ?></th>
|
||||
<th scope="row" class="check-column"><input type="checkbox" name="media[]" value="<?php the_ID(); ?>" /></th>
|
||||
<?php
|
||||
break;
|
||||
|
||||
@@ -68,15 +62,13 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php
|
||||
if ( $thumb = wp_get_attachment_image( $post->ID, array(80, 60), true ) ) {
|
||||
if ( $is_trash ) echo $thumb;
|
||||
else {
|
||||
?>
|
||||
|
||||
<a href="media.php?action=edit&attachment_id=<?php the_ID(); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>">
|
||||
<?php echo $thumb; ?>
|
||||
</a>
|
||||
|
||||
<?php }
|
||||
}
|
||||
?></td>
|
||||
<?php
|
||||
// TODO
|
||||
@@ -84,24 +76,16 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
|
||||
case 'media':
|
||||
?>
|
||||
<td <?php echo $attributes ?>><strong><?php if ( $is_trash ) echo $att_title; else { ?><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $att_title; ?></a><?php } ?></strong><br />
|
||||
<td <?php echo $attributes ?>><strong><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />
|
||||
<?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?>
|
||||
<p>
|
||||
<?php
|
||||
$actions = array();
|
||||
if ( current_user_can('edit_post', $post->ID) && !$is_trash )
|
||||
if ( current_user_can('edit_post', $post->ID) )
|
||||
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
|
||||
if ( current_user_can('delete_post', $post->ID) ) {
|
||||
if ( $is_trash )
|
||||
$actions['untrash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=untrash&post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
|
||||
elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH )
|
||||
$actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
|
||||
if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH )
|
||||
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
|
||||
}
|
||||
if ( !$is_trash )
|
||||
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
||||
$actions = apply_filters( 'media_row_actions', $actions, $post );
|
||||
if ( current_user_can('delete_post', $post->ID) )
|
||||
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
|
||||
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
||||
$action_count = count($actions);
|
||||
$i = 0;
|
||||
echo '<div class="row-actions">';
|
||||
@@ -174,8 +158,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php _e('(Unattached)'); ?><br />
|
||||
<a class="hide-if-no-js" onclick="findPosts.open('media[]','<?php echo $post->ID ?>');return false;" href="#the-list"><?php _e('Attach'); ?></a></td>
|
||||
<td <?php echo $attributes ?>> </td>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ _fill_empty_category($category);
|
||||
<tr class="form-field form-required">
|
||||
<th scope="row" valign="top"><label for="cat_name"><?php _e('Category Name') ?></label></th>
|
||||
<td><input name="cat_name" id="cat_name" type="text" value="<?php echo esc_attr($category->name); ?>" size="40" aria-required="true" /><br />
|
||||
<span class="description"><?php _e('The name is used to identify the category almost everywhere, for example under the post or in the category widget.'); ?></span></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="category_nicename"><?php _e('Category Slug') ?></label></th>
|
||||
@@ -66,14 +67,14 @@ _fill_empty_category($category);
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="category_parent"><?php _e('Category Parent') ?></label></th>
|
||||
<td>
|
||||
<?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'exclude' => $category->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br />
|
||||
<?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br />
|
||||
<span class="description"><?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="category_description"><?php _e('Description') ?></label></th>
|
||||
<td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo esc_html($category->description); ?></textarea><br />
|
||||
<span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span></td>
|
||||
<span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
|
||||
</tr>
|
||||
<?php do_action('edit_category_form_fields', $category); ?>
|
||||
</table>
|
||||
|
||||
@@ -17,33 +17,40 @@ enqueue_comment_hotkeys_js();
|
||||
|
||||
$post_id = isset($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
|
||||
|
||||
if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2']) ) {
|
||||
check_admin_referer('bulk-comments');
|
||||
if ( ( isset( $_REQUEST['delete_all_spam'] ) || isset( $_REQUEST['delete_all_spam2'] ) ) && !empty( $_REQUEST['pagegen_timestamp'] ) ) {
|
||||
check_admin_referer('bulk-spam-delete', '_spam_nonce');
|
||||
|
||||
if ( (isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2'])) && !empty($_REQUEST['pagegen_timestamp']) ) {
|
||||
$comment_status = $wpdb->escape($_REQUEST['comment_status']);
|
||||
$delete_time = $wpdb->escape($_REQUEST['pagegen_timestamp']);
|
||||
$comment_ids = $wpdb->get_col( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = '$comment_status' AND '$delete_time' > comment_date_gmt" );
|
||||
$doaction = 'delete';
|
||||
} elseif ( ($_REQUEST['action'] != -1 || $_REQUEST['action2'] != -1) && isset($_REQUEST['delete_comments']) ) {
|
||||
$comment_ids = $_REQUEST['delete_comments'];
|
||||
$doaction = ($_REQUEST['action'] != -1) ? $_REQUEST['action'] : $_REQUEST['action2'];
|
||||
} elseif ( $_REQUEST['doaction'] == 'undo' && isset($_REQUEST['ids']) ) {
|
||||
$comment_ids = array_map( 'absint', explode(',', $_REQUEST['ids']) );
|
||||
$doaction = $_REQUEST['action'];
|
||||
$delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] );
|
||||
if ( current_user_can('moderate_comments')) {
|
||||
$deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" );
|
||||
} else {
|
||||
wp_redirect($_SERVER['HTTP_REFERER']);
|
||||
$deleted_spam = 0;
|
||||
}
|
||||
$redirect_to = 'edit-comments.php?comment_status=spam&deleted=' . (int) $deleted_spam;
|
||||
if ( $post_id )
|
||||
$redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to );
|
||||
wp_redirect( $redirect_to );
|
||||
} elseif ( isset($_REQUEST['delete_comments']) && isset($_REQUEST['action']) && ( -1 != $_REQUEST['action'] || -1 != $_REQUEST['action2'] ) ) {
|
||||
check_admin_referer('bulk-comments');
|
||||
$doaction = ( -1 != $_REQUEST['action'] ) ? $_REQUEST['action'] : $_REQUEST['action2'];
|
||||
|
||||
$approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0;
|
||||
|
||||
foreach ($comment_ids as $comment_id) { // Check the permissions on each
|
||||
$deleted = $approved = $unapproved = $spammed = 0;
|
||||
foreach ( (array) $_REQUEST['delete_comments'] as $comment_id) : // Check the permissions on each
|
||||
$comment_id = (int) $comment_id;
|
||||
$_post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment_id) );
|
||||
|
||||
if ( !current_user_can('edit_post', $_post_id) )
|
||||
continue;
|
||||
|
||||
switch( $doaction ) {
|
||||
case 'markspam' :
|
||||
wp_set_comment_status($comment_id, 'spam');
|
||||
$spammed++;
|
||||
break;
|
||||
case 'delete' :
|
||||
wp_set_comment_status($comment_id, 'delete');
|
||||
$deleted++;
|
||||
break;
|
||||
case 'approve' :
|
||||
wp_set_comment_status($comment_id, 'approve');
|
||||
$approved++;
|
||||
@@ -52,48 +59,10 @@ if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_R
|
||||
wp_set_comment_status($comment_id, 'hold');
|
||||
$unapproved++;
|
||||
break;
|
||||
case 'spam' :
|
||||
wp_spam_comment($comment_id);
|
||||
$spammed++;
|
||||
break;
|
||||
case 'unspam' :
|
||||
wp_unspam_comment($comment_id);
|
||||
$unspammed++;
|
||||
break;
|
||||
case 'trash' :
|
||||
wp_trash_comment($comment_id);
|
||||
$trashed++;
|
||||
break;
|
||||
case 'untrash' :
|
||||
wp_untrash_comment($comment_id);
|
||||
$untrashed++;
|
||||
break;
|
||||
case 'delete' :
|
||||
wp_delete_comment($comment_id);
|
||||
$deleted++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$redirect_to = 'edit-comments.php';
|
||||
|
||||
if ( $approved )
|
||||
$redirect_to = add_query_arg( 'approved', $approved, $redirect_to );
|
||||
if ( $unapproved )
|
||||
$redirect_to = add_query_arg( 'unapproved', $unapproved, $redirect_to );
|
||||
if ( $spammed )
|
||||
$redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to );
|
||||
if ( $unspammed )
|
||||
$redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to );
|
||||
if ( $trashed )
|
||||
$redirect_to = add_query_arg( 'trashed', $trashed, $redirect_to );
|
||||
if ( $untrashed )
|
||||
$redirect_to = add_query_arg( 'untrashed', $untrashed, $redirect_to );
|
||||
if ( $deleted )
|
||||
$redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );
|
||||
if ( $trashed || $spammed )
|
||||
$redirect_to = add_query_arg( 'ids', join(',', $comment_ids), $redirect_to );
|
||||
endforeach;
|
||||
|
||||
$redirect_to = 'edit-comments.php?deleted=' . $deleted . '&approved=' . $approved . '&spam=' . $spammed . '&unapproved=' . $unapproved;
|
||||
if ( $post_id )
|
||||
$redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to );
|
||||
if ( isset($_REQUEST['apage']) )
|
||||
@@ -120,7 +89,7 @@ require_once('admin-header.php');
|
||||
$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : esc_attr($_GET['mode']);
|
||||
|
||||
$comment_status = isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all';
|
||||
if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam', 'trash')) )
|
||||
if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam')) )
|
||||
$comment_status = 'all';
|
||||
|
||||
$comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : '';
|
||||
@@ -136,41 +105,26 @@ if ( isset($_GET['s']) && $_GET['s'] )
|
||||
</h2>
|
||||
|
||||
<?php
|
||||
if ( isset($_GET['approved']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) || isset($_GET['spammed']) || isset($_GET['unspammed']) ) {
|
||||
$approved = isset($_GET['approved']) ? (int) $_GET['approved'] : 0;
|
||||
$deleted = isset($_GET['deleted']) ? (int) $_GET['deleted'] : 0;
|
||||
$trashed = isset($_GET['trashed']) ? (int) $_GET['trashed'] : 0;
|
||||
$untrashed = isset($_GET['untrashed']) ? (int) $_GET['untrashed'] : 0;
|
||||
$spammed = isset($_GET['spammed']) ? (int) $_GET['spammed'] : 0;
|
||||
$unspammed = isset($_GET['unspammed']) ? (int) $_GET['unspammed'] : 0;
|
||||
if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['spam'] ) ) {
|
||||
$approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0;
|
||||
$deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0;
|
||||
$spam = isset( $_GET['spam'] ) ? (int) $_GET['spam'] : 0;
|
||||
|
||||
if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 ) {
|
||||
if ( $approved > 0 || $deleted > 0 || $spam > 0 ) {
|
||||
echo '<div id="moderated" class="updated fade"><p>';
|
||||
|
||||
if ( $approved > 0 ) {
|
||||
printf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
|
||||
echo '<br />';
|
||||
}
|
||||
if ( $spammed > 0 ) {
|
||||
printf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed );
|
||||
$ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
|
||||
echo ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
}
|
||||
if ( $unspammed > 0 ) {
|
||||
printf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed );
|
||||
echo '<br />';
|
||||
}
|
||||
if ( $trashed > 0 ) {
|
||||
printf( _n( '%s comment moved to the trash.', '%s comments moved to the trash.', $trashed ), $trashed );
|
||||
$ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
|
||||
echo ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
}
|
||||
if ( $untrashed > 0 ) {
|
||||
printf( _n( '%s comment restored from the trash', '%s comments restored from the trash', $untrashed ), $untrashed );
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
if ( $deleted > 0 ) {
|
||||
printf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
|
||||
printf( _n( '%s comment deleted', '%s comments deleted', $deleted ), $deleted );
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
if ( $spam > 0 ) {
|
||||
printf( _n( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam );
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
@@ -188,19 +142,13 @@ $num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments
|
||||
//, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>")
|
||||
$stati = array(
|
||||
'all' => _n_noop('All', 'All'), // singular not used
|
||||
'moderated' => _n_noop('Pending <span class="count">(<span class="pending-count">%s</span>)</span>', 'Pending <span class="count">(<span class="pending-count">%s</span>)</span>'),
|
||||
'moderated' => _n_noop('Pending (<span class="pending-count">%s</span>)', 'Pending (<span class="pending-count">%s</span>)'),
|
||||
'approved' => _n_noop('Approved', 'Approved'), // singular not used
|
||||
'spam' => _n_noop('Spam <span class="count">(<span class="spam-count">%s</span>)</span>', 'Spam <span class="count">(<span class="spam-count">%s</span>)</span>'),
|
||||
'trash' => _n_noop('Trash <span class="count">(<span class="trash-count">%s</span>)</span>', 'Trash <span class="count">(<span class="trash-count">%s</span>)</span>')
|
||||
'spam' => _n_noop('Spam (<span class="spam-count">%s</span>)', 'Spam (<span class="spam-count">%s</span>)')
|
||||
);
|
||||
|
||||
if ( !EMPTY_TRASH_DAYS )
|
||||
unset($stati['trash']);
|
||||
|
||||
$link = 'edit-comments.php';
|
||||
if ( !empty($comment_type) && 'all' != $comment_type )
|
||||
$link = add_query_arg( 'comment_type', $comment_type, $link );
|
||||
|
||||
foreach ( $stati as $status => $label ) {
|
||||
$class = '';
|
||||
|
||||
@@ -236,10 +184,10 @@ unset($status_links);
|
||||
</p>
|
||||
|
||||
<?php
|
||||
$comments_per_page = (int) get_user_option( 'edit_comments_per_page', 0, false );
|
||||
if ( empty( $comments_per_page ) || $comments_per_page < 1 )
|
||||
$comments_per_page = get_user_option('edit_comments_per_page');
|
||||
if ( empty($comments_per_page) )
|
||||
$comments_per_page = 20;
|
||||
$comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
|
||||
$comments_per_page = apply_filters('comments_per_page', $comments_per_page, $comment_status);
|
||||
|
||||
if ( isset( $_GET['apage'] ) )
|
||||
$page = abs( (int) $_GET['apage'] );
|
||||
@@ -304,19 +252,10 @@ $page_links = paginate_links( array(
|
||||
<?php if ( 'all' == $comment_status || 'moderated' == $comment_status || 'spam' == $comment_status ): ?>
|
||||
<option value="approve"><?php _e('Approve'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?>
|
||||
<option value="spam"><?php _e('Mark as Spam'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'trash' == $comment_status ): ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php elseif ( 'spam' == $comment_status ): ?>
|
||||
<option value="unspam"><?php _e('Not Spam'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'trash' == $comment_status || 'spam' == $comment_status || !EMPTY_TRASH_DAYS ): ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php else: ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php if ( 'spam' != $comment_status ): ?>
|
||||
<option value="markspam"><?php _e('Mark as Spam'); ?></option>
|
||||
<?php endif; ?>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" name="doaction" id="doaction" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary apply" />
|
||||
<?php wp_nonce_field('bulk-comments'); ?>
|
||||
@@ -342,13 +281,11 @@ $page_links = paginate_links( array(
|
||||
<input type="hidden" name="apage" value="<?php echo esc_attr( absint( $_GET['apage'] ) ); ?>" />
|
||||
<?php }
|
||||
|
||||
if ( ( 'spam' == $comment_status || 'trash' == $comment_status) && current_user_can ('moderate_comments') ) {
|
||||
wp_nonce_field('bulk-destroy', '_destroy_nonce');
|
||||
if ( 'spam' == $comment_status && current_user_can('moderate_comments') ) { ?>
|
||||
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
|
||||
<?php } elseif ( 'trash' == $comment_status && current_user_can('moderate_comments') ) { ?>
|
||||
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php }
|
||||
if ( 'spam' == $comment_status ) {
|
||||
wp_nonce_field('bulk-spam-delete', '_spam_nonce');
|
||||
if ( current_user_can ('moderate_comments')) { ?>
|
||||
<input type="submit" name="delete_all_spam" value="<?php esc_attr_e('Delete All Spam'); ?>" class="button-secondary apply" />
|
||||
<?php }
|
||||
} ?>
|
||||
<?php do_action('manage_comments_nav', $comment_status); ?>
|
||||
</div>
|
||||
@@ -402,26 +339,15 @@ if ( $page_links )
|
||||
<?php if ( 'all' == $comment_status || 'moderated' == $comment_status || 'spam' == $comment_status ): ?>
|
||||
<option value="approve"><?php _e('Approve'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?>
|
||||
<option value="spam"><?php _e('Mark as Spam'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'trash' == $comment_status ): ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'trash' == $comment_status || 'spam' == $comment_status || !EMPTY_TRASH_DAYS ): ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php elseif ( 'spam' == $comment_status ): ?>
|
||||
<option value="unspam"><?php _e('Not Spam'); ?></option>
|
||||
<?php else: ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php if ( 'spam' != $comment_status ): ?>
|
||||
<option value="markspam"><?php _e('Mark as Spam'); ?></option>
|
||||
<?php endif; ?>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" name="doaction2" id="doaction2" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary apply" />
|
||||
|
||||
<?php if ( 'spam' == $comment_status && current_user_can('moderate_comments') ) { ?>
|
||||
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
|
||||
<?php } elseif ( 'trash' == $comment_status && current_user_can('moderate_comments') ) { ?>
|
||||
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php if ( 'spam' == $comment_status ) { ?>
|
||||
<input type="submit" name="delete_all_spam2" value="<?php esc_attr_e('Delete All Spam'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
<?php do_action('manage_comments_nav', $comment_status); ?>
|
||||
</div>
|
||||
@@ -457,5 +383,4 @@ if ( $page_links )
|
||||
|
||||
<?php
|
||||
wp_comment_reply('-1', true, 'detail');
|
||||
wp_comment_trashnotice();
|
||||
include('admin-footer.php'); ?>
|
||||
|
||||
@@ -18,48 +18,22 @@ if ( !defined('ABSPATH') )
|
||||
$post_ID = isset($post_ID) ? (int) $post_ID : 0;
|
||||
|
||||
$action = isset($action) ? $action : '';
|
||||
|
||||
$message = false;
|
||||
if ( isset($_GET['message']) ) {
|
||||
if ( isset($_GET['message']) )
|
||||
$_GET['message'] = absint( $_GET['message'] );
|
||||
$messages[1] = sprintf(__('Post updated. <a href="%s">View post</a>'), get_permalink($post_ID));
|
||||
$messages[2] = __('Custom field updated.');
|
||||
$messages[3] = __('Custom field deleted.');
|
||||
$messages[4] = __('Post updated.');
|
||||
$messages[6] = sprintf(__('Post published. <a href="%s">View post</a>'), get_permalink($post_ID));
|
||||
$messages[7] = __('Post saved.');
|
||||
$messages[8] = sprintf(__('Post submitted. <a href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
|
||||
|
||||
switch ( $_GET['message'] ) {
|
||||
case 1:
|
||||
$message = sprintf( __('Post updated. <a href="%s">View post</a>'), get_permalink($post_ID) );
|
||||
break;
|
||||
case 2:
|
||||
$message = __('Custom field updated.');
|
||||
break;
|
||||
case 3:
|
||||
$message = __('Custom field deleted.');
|
||||
break;
|
||||
case 4:
|
||||
$message = __('Post updated.');
|
||||
break;
|
||||
case 5:
|
||||
if ( isset($_GET['revision']) )
|
||||
$message = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
|
||||
break;
|
||||
case 6:
|
||||
$message = sprintf( __('Post published. <a href="%s">View post</a>'), get_permalink($post_ID) );
|
||||
break;
|
||||
case 7:
|
||||
$message = __('Post saved.');
|
||||
break;
|
||||
case 8:
|
||||
$message = sprintf( __('Post submitted. <a target="_blank" href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
|
||||
break;
|
||||
case 9:
|
||||
// translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php
|
||||
$message = sprintf( __('Post scheduled for: <b>%1$s</b>. <a target="_blank" href="%2$s">Preview post</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) );
|
||||
break;
|
||||
case 10:
|
||||
$message = sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( isset($_GET['revision']) )
|
||||
$messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
|
||||
|
||||
$notice = false;
|
||||
$notices[1] = __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' );
|
||||
|
||||
if ( 0 == $post_ID ) {
|
||||
$form_action = 'post';
|
||||
$temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
|
||||
@@ -74,7 +48,7 @@ if ( 0 == $post_ID ) {
|
||||
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
|
||||
foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
|
||||
if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
|
||||
$notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' ), get_edit_post_link( $autosave->ID ) );
|
||||
$notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -83,10 +57,246 @@ if ( 0 == $post_ID ) {
|
||||
}
|
||||
|
||||
// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
|
||||
require_once('includes/meta-boxes.php');
|
||||
|
||||
/**
|
||||
* Display post submit form fields.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_submit_meta_box($post) {
|
||||
global $action;
|
||||
|
||||
$can_publish = current_user_can('publish_posts');
|
||||
?>
|
||||
<div class="submitbox" id="submitpost">
|
||||
|
||||
<div id="minor-publishing">
|
||||
|
||||
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
|
||||
<div style="display:none;">
|
||||
<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
|
||||
</div>
|
||||
|
||||
<div id="minor-publishing-actions">
|
||||
<div id="save-action">
|
||||
<?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
|
||||
<input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" tabindex="4" class="button button-highlighted" />
|
||||
<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
|
||||
<input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="preview-action">
|
||||
<?php
|
||||
if ( 'publish' == $post->post_status ) {
|
||||
$preview_link = esc_url(get_permalink($post->ID));
|
||||
$preview_button = __('Preview Changes');
|
||||
} else {
|
||||
$preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
|
||||
$preview_button = __('Preview');
|
||||
}
|
||||
?>
|
||||
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a>
|
||||
<input type="hidden" name="wp-preview" id="wp-preview" value="" />
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div><?php // /minor-publishing-actions ?>
|
||||
|
||||
<div id="misc-publishing-actions">
|
||||
|
||||
<div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label>
|
||||
<span id="post-status-display">
|
||||
<?php
|
||||
switch ( $post->post_status ) {
|
||||
case 'private':
|
||||
_e('Privately Published');
|
||||
break;
|
||||
case 'publish':
|
||||
_e('Published');
|
||||
break;
|
||||
case 'future':
|
||||
_e('Scheduled');
|
||||
break;
|
||||
case 'pending':
|
||||
_e('Pending Review');
|
||||
break;
|
||||
case 'draft':
|
||||
_e('Draft');
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
|
||||
<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
|
||||
|
||||
<div id="post-status-select" class="hide-if-js">
|
||||
<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr($post->post_status); ?>" />
|
||||
<select name='post_status' id='post_status' tabindex='4'>
|
||||
<?php if ( 'publish' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
|
||||
<?php elseif ( 'private' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
|
||||
<?php elseif ( 'future' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
|
||||
<?php endif; ?>
|
||||
<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
|
||||
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
|
||||
</select>
|
||||
<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
</div><?php // /misc-pub-section ?>
|
||||
|
||||
<div class="misc-pub-section " id="visibility">
|
||||
<?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php
|
||||
|
||||
if ( 'private' == $post->post_status ) {
|
||||
$post->post_password = '';
|
||||
$visibility = 'private';
|
||||
$visibility_trans = __('Private');
|
||||
} elseif ( !empty( $post->post_password ) ) {
|
||||
$visibility = 'password';
|
||||
$visibility_trans = __('Password protected');
|
||||
} elseif ( is_sticky( $post->ID ) ) {
|
||||
$visibility = 'public';
|
||||
$visibility_trans = __('Public, Sticky');
|
||||
} else {
|
||||
$visibility = 'public';
|
||||
$visibility_trans = __('Public');
|
||||
}
|
||||
|
||||
?><?php echo esc_html( $visibility_trans ); ?></span> <?php if ( $can_publish ) { ?> <a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
|
||||
|
||||
<div id="post-visibility-select" class="hide-if-js">
|
||||
<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
|
||||
<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID)); ?> />
|
||||
<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
|
||||
|
||||
|
||||
<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
|
||||
<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID)); ?> tabindex="4" /> <label for="sticky" class="selectit"><?php _e('Stick this post to the front page') ?></label><br /></span>
|
||||
<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
|
||||
<span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>" /><br /></span>
|
||||
<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
|
||||
|
||||
<p>
|
||||
<a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div><?php // /misc-pub-section ?>
|
||||
|
||||
|
||||
<?php
|
||||
// translators: Publish box date formt, see http://php.net/date
|
||||
$datef = __( 'M j, Y @ G:i' );
|
||||
if ( 0 != $post->ID ) {
|
||||
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
|
||||
$stamp = __('Scheduled for: <b>%1$s</b>');
|
||||
} else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
|
||||
$stamp = __('Published on: <b>%1$s</b>');
|
||||
} else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
|
||||
$stamp = __('Publish <b>immediately</b>');
|
||||
} else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
|
||||
$stamp = __('Schedule for: <b>%1$s</b>');
|
||||
} else { // draft, 1 or more saves, date specified
|
||||
$stamp = __('Publish on: <b>%1$s</b>');
|
||||
}
|
||||
$date = date_i18n( $datef, strtotime( $post->post_date ) );
|
||||
} else { // draft (no saves, and thus no date specified)
|
||||
$stamp = __('Publish <b>immediately</b>');
|
||||
$date = date_i18n( $datef, strtotime( current_time('mysql') ) );
|
||||
}
|
||||
|
||||
if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
|
||||
<div class="misc-pub-section curtime misc-pub-section-last">
|
||||
<span id="timestamp">
|
||||
<?php printf($stamp, $date); ?></span>
|
||||
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
|
||||
<div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
|
||||
</div><?php // /misc-pub-section ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="major-publishing-actions">
|
||||
<?php do_action('post_submitbox_start'); ?>
|
||||
<div id="delete-action">
|
||||
<?php
|
||||
if ( ( 'edit' == $action ) && current_user_can('delete_post', $post->ID) ) { ?>
|
||||
<a class="submitdelete deletion" href="<?php echo wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="publishing-action">
|
||||
<?php
|
||||
if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
|
||||
if ( current_user_can('publish_posts') ) :
|
||||
if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Schedule') ?>" />
|
||||
<?php else : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Publish') ?>" />
|
||||
<?php endif;
|
||||
else : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Submit for Review') ?>" />
|
||||
<?php
|
||||
endif;
|
||||
} else { ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update Post') ?>" />
|
||||
<input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Update Post') ?>" />
|
||||
<?php
|
||||
} ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'post', 'side', 'core');
|
||||
|
||||
/**
|
||||
* Display post tags form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_tags_meta_box($post, $box) {
|
||||
$tax_name = esc_attr(substr($box['id'], 8));
|
||||
$taxonomy = get_taxonomy($tax_name);
|
||||
$helps = isset($taxonomy->helps) ? esc_attr($taxonomy->helps) : __('Separate tags with commas.');
|
||||
?>
|
||||
<div class="tagsdiv" id="<?php echo $tax_name; ?>">
|
||||
<div class="jaxtag">
|
||||
<div class="nojs-tags hide-if-js">
|
||||
<p><?php _e('Add or remove tags'); ?></p>
|
||||
<textarea name="<?php echo "tax_input[$tax_name]"; ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]"><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div>
|
||||
|
||||
<span class="ajaxtag hide-if-no-js">
|
||||
<label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
|
||||
<input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="<?php esc_attr_e('Add new tag'); ?>" />
|
||||
<input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" />
|
||||
</span></div>
|
||||
<p class="howto"><?php echo $helps; ?></p>
|
||||
<div class="tagchecklist"></div>
|
||||
</div>
|
||||
<p class="tagcloud-link hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php printf( __('Choose from the most used tags in %s'), $box['title'] ); ?></a></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
// all tag-style post taxonomies
|
||||
foreach ( get_object_taxonomies('post') as $tax_name ) {
|
||||
if ( !is_taxonomy_hierarchical($tax_name) ) {
|
||||
@@ -97,29 +307,237 @@ foreach ( get_object_taxonomies('post') as $tax_name ) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display post categories form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_categories_meta_box($post) {
|
||||
?>
|
||||
<ul id="category-tabs">
|
||||
<li class="tabs"><a href="#categories-all" tabindex="3"><?php _e( 'All Categories' ); ?></a></li>
|
||||
<li class="hide-if-no-js"><a href="#categories-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>
|
||||
</ul>
|
||||
|
||||
<div id="categories-pop" class="tabs-panel" style="display: none;">
|
||||
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
|
||||
<?php $popular_ids = wp_popular_terms_checklist('category'); ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="categories-all" class="tabs-panel">
|
||||
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
|
||||
<?php wp_category_checklist($post->ID, false, false, $popular_ids) ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php if ( current_user_can('manage_categories') ) : ?>
|
||||
<div id="category-adder" class="wp-hidden-children">
|
||||
<h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
|
||||
<p id="category-add" class="wp-hidden-child">
|
||||
<label class="screen-reader-text" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
|
||||
<label class="screen-reader-text" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
|
||||
<input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php esc_attr_e( 'Add' ); ?>" tabindex="3" />
|
||||
<?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
|
||||
<span id="category-ajax-response"></span></p>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
}
|
||||
add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'side', 'core');
|
||||
if ( current_theme_supports( 'post-thumbnails', 'post' ) )
|
||||
add_meta_box('postimagediv', __('Post Thumbnail'), 'post_thumbnail_meta_box', 'post', 'side', 'low');
|
||||
|
||||
/**
|
||||
* Display post password form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_password_meta_box($post) {
|
||||
?>
|
||||
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label></p>
|
||||
<h4><?php _e( 'Post Password' ); ?></h4>
|
||||
<p><label class="screen-reader-text" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php the_post_password(); ?>" /></p>
|
||||
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
// add_meta_box('passworddiv', __('Privacy Options'), 'post_password_meta_box', 'post', 'side', 'core');
|
||||
|
||||
/**
|
||||
* Display post excerpt form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_excerpt_meta_box($post) {
|
||||
?>
|
||||
<label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
|
||||
<p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="http://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display trackback links form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_trackback_meta_box($post) {
|
||||
$form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" tabindex="7" value="'. esc_attr( str_replace("\n", ' ', $post->to_ping) ) .'" />';
|
||||
if ('' != $post->pinged) {
|
||||
$pings = '<p>'. __('Already pinged:') . '</p><ul>';
|
||||
$already_pinged = explode("\n", trim($post->pinged));
|
||||
foreach ($already_pinged as $pinged_url) {
|
||||
$pings .= "\n\t<li>" . esc_html($pinged_url) . "</li>";
|
||||
}
|
||||
$pings .= '</ul>';
|
||||
}
|
||||
|
||||
?>
|
||||
<p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
|
||||
<p><?php _e('Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress blogs they’ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
|
||||
<?php
|
||||
if ( ! empty($pings) )
|
||||
echo $pings;
|
||||
}
|
||||
add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', 'post', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display custom fields for the post form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_custom_meta_box($post) {
|
||||
?>
|
||||
<div id="postcustomstuff">
|
||||
<div id="ajax-response"></div>
|
||||
<?php
|
||||
$metadata = has_meta($post->ID);
|
||||
list_meta($metadata);
|
||||
meta_form(); ?>
|
||||
</div>
|
||||
<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'normal', 'core');
|
||||
|
||||
do_action('dbx_post_advanced');
|
||||
|
||||
/**
|
||||
* Display comment status for post form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_comment_status_meta_box($post) {
|
||||
?>
|
||||
<input name="advanced_view" type="hidden" value="1" />
|
||||
<p class="meta-options">
|
||||
<label for="comment_status" class="selectit"> <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> <?php _e('Allow comments on this post') ?></label><br />
|
||||
<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a> on this post') ?></label></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'post', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display comments for post.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_comment_meta_box($post) {
|
||||
global $wpdb, $post_ID;
|
||||
|
||||
$total = $wpdb->get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID));
|
||||
|
||||
if ( 1 > $total ) {
|
||||
echo '<p>' . __('No comments yet.') . '</p>';
|
||||
return;
|
||||
}
|
||||
|
||||
wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
|
||||
?>
|
||||
|
||||
<table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
|
||||
<thead><tr>
|
||||
<th scope="col" class="column-author"><?php _e('Author') ?></th>
|
||||
<th scope="col" class="column-comment">
|
||||
<?php /* translators: field name in comment form */ echo _x('Comment', 'noun'); ?></th>
|
||||
</tr></thead>
|
||||
<tbody id="the-comment-list" class="list:comment"></tbody>
|
||||
</table>
|
||||
<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="images/wpspin_light.gif" alt="" /></p>
|
||||
<?php
|
||||
$hidden = get_hidden_meta_boxes('post');
|
||||
if ( ! in_array('commentsdiv', $hidden) ) { ?>
|
||||
<script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
if ( 'publish' == $post->post_status || 'private' == $post->post_status )
|
||||
add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', 'post', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display post slug form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_slug_meta_box($post) {
|
||||
?>
|
||||
<label class="screen-reader-text" for="post_name"><?php _e('Post Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( $post->post_name ); ?>" />
|
||||
<?php
|
||||
}
|
||||
if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) )
|
||||
add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'normal', 'core');
|
||||
|
||||
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
|
||||
if ( $post->post_author && !in_array($post->post_author, $authors) )
|
||||
$authors[] = $post->post_author;
|
||||
if ( $authors && count( $authors ) > 1 )
|
||||
add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'normal', 'core');
|
||||
if ( $authors && count( $authors ) > 1 ) :
|
||||
/**
|
||||
* Display form field with list of authors.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_author_meta_box($post) {
|
||||
global $current_user, $user_ID;
|
||||
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
|
||||
if ( $post->post_author && !in_array($post->post_author, $authors) )
|
||||
$authors[] = $post->post_author;
|
||||
?>
|
||||
<label class="screen-reader-text" for="post_author_override"><?php _e('Post Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'normal', 'core');
|
||||
endif;
|
||||
|
||||
if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) )
|
||||
add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'normal', 'core');
|
||||
if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
|
||||
/**
|
||||
* Display list of post revisions.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_revisions_meta_box($post) {
|
||||
wp_list_post_revisions();
|
||||
}
|
||||
add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'normal', 'core');
|
||||
endif;
|
||||
|
||||
do_action('do_meta_boxes', 'post', 'normal', $post);
|
||||
do_action('do_meta_boxes', 'post', 'advanced', $post);
|
||||
@@ -129,14 +547,18 @@ require_once('admin-header.php');
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?>
|
||||
<input type="hidden" name="mode" value="bookmarklet" />
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
<?php if ( $notice ) : ?>
|
||||
<div id="notice" class="error"><p><?php echo $notice ?></p></div>
|
||||
<?php endif; ?>
|
||||
<?php if ( $message ) : ?>
|
||||
<div id="message" class="updated fade"><p><?php echo $message; ?></p></div>
|
||||
<?php if (isset($_GET['message'])) : ?>
|
||||
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
|
||||
<?php endif; ?>
|
||||
<form name="post" action="post.php" method="post" id="post">
|
||||
<?php
|
||||
|
||||
@@ -68,7 +68,7 @@ $date = date_i18n( $datef, strtotime( $comment->comment_date ) );
|
||||
|
||||
<div id="major-publishing-actions">
|
||||
<div id="delete-action">
|
||||
<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=" . ( !EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?>
|
||||
<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=deletecomment&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . esc_js(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ){return true;}return false;\">" . __('Delete') . "</a>\n"; ?>
|
||||
</div>
|
||||
<div id="publishing-action">
|
||||
<input type="submit" name="save" value="<?php esc_attr_e('Update Comment'); ?>" tabindex="4" class="button-primary" />
|
||||
|
||||
@@ -18,14 +18,13 @@ if ( isset($_GET['action']) && isset($_GET['delete']) ) {
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
if ( 'delete' == $doaction ) {
|
||||
$cats = (array) $_GET['delete'];
|
||||
$default_cat_id = get_option('default_link_category');
|
||||
foreach( (array) $_GET['delete'] as $cat_ID ) {
|
||||
$cat_name = get_term_field('name', $cat_ID, 'link_category');
|
||||
$default_cat_id = get_option('default_link_category');
|
||||
|
||||
foreach( $cats as $cat_ID ) {
|
||||
$cat_ID = (int) $cat_ID;
|
||||
// Don't delete the default cats.
|
||||
if ( $cat_ID == $default_cat_id )
|
||||
wp_die( sprintf( __("Can’t delete the <strong>%s</strong> category: this is the default one"), get_term_field('name', $cat_ID, 'link_category') ) );
|
||||
wp_die(sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
|
||||
|
||||
wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
|
||||
}
|
||||
@@ -210,7 +209,6 @@ if ( $page_links )
|
||||
<div class="form-field">
|
||||
<label for="description"><?php _e('Description (optional)') ?></label>
|
||||
<textarea name="description" id="description" rows="5" cols="40"></textarea>
|
||||
<p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
|
||||
</div>
|
||||
|
||||
<p class="submit"><input type="submit" class="button" name="submit" value="<?php esc_attr_e('Add Category'); ?>" /></p>
|
||||
|
||||
@@ -79,8 +79,7 @@ _fill_empty_link_category($category);
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="description"><?php _e('Description (optional)') ?></label></th>
|
||||
<td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea><br />
|
||||
<span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span></td>
|
||||
<td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea></td>
|
||||
</tr>
|
||||
<?php do_action('edit_link_category_form_fields', $category); ?>
|
||||
</table>
|
||||
|
||||
@@ -22,12 +22,319 @@ if ( ! empty($link_id) ) {
|
||||
$nonce_action = 'add-bookmark';
|
||||
}
|
||||
|
||||
require_once('includes/meta-boxes.php');
|
||||
/**
|
||||
* Display checked checkboxes attribute for xfn microformat options.
|
||||
*
|
||||
* @since 1.0.1
|
||||
*
|
||||
* @param string $class
|
||||
* @param string $value
|
||||
* @param mixed $deprecated Not used.
|
||||
*/
|
||||
function xfn_check($class, $value = '', $deprecated = '') {
|
||||
global $link;
|
||||
|
||||
$link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
|
||||
$rels = preg_split('/\s+/', $link_rel);
|
||||
|
||||
if ('' != $value && in_array($value, $rels) ) {
|
||||
echo ' checked="checked"';
|
||||
}
|
||||
|
||||
if ('' == $value) {
|
||||
if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"';
|
||||
if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
|
||||
if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
|
||||
if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display link create form fields.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_submit_meta_box($link) {
|
||||
?>
|
||||
<div class="submitbox" id="submitlink">
|
||||
|
||||
<div id="minor-publishing">
|
||||
|
||||
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
|
||||
<div style="display:none;">
|
||||
<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
|
||||
</div>
|
||||
|
||||
<div id="minor-publishing-actions">
|
||||
<div id="preview-action">
|
||||
<?php if ( !empty($link->link_id) ) { ?>
|
||||
<a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank" tabindex="4"><?php _e('Visit Link'); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="misc-publishing-actions">
|
||||
<div class="misc-pub-section misc-pub-section-last">
|
||||
<label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="major-publishing-actions">
|
||||
<?php do_action('post_submitbox_start'); ?>
|
||||
<div id="delete-action">
|
||||
<?php
|
||||
if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>
|
||||
<a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="publishing-action">
|
||||
<?php if ( !empty($link->link_id) ) { ?>
|
||||
<input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php esc_attr_e('Update Link') ?>" />
|
||||
<?php } else { ?>
|
||||
<input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php esc_attr_e('Add Link') ?>" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php do_action('submitlink_box'); ?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('linksubmitdiv', __('Save'), 'link_submit_meta_box', 'link', 'side', 'core');
|
||||
|
||||
/**
|
||||
* Display link categories form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_categories_meta_box($link) { ?>
|
||||
<ul id="category-tabs">
|
||||
<li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
|
||||
<li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
|
||||
</ul>
|
||||
|
||||
<div id="categories-all" class="tabs-panel">
|
||||
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
|
||||
<?php
|
||||
if ( isset($link->link_id) )
|
||||
wp_link_category_checklist($link->link_id);
|
||||
else
|
||||
wp_link_category_checklist();
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="categories-pop" class="tabs-panel" style="display: none;">
|
||||
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
|
||||
<?php wp_popular_terms_checklist('link_category'); ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="category-adder" class="wp-hidden-children">
|
||||
<h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
|
||||
<p id="link-category-add" class="wp-hidden-child">
|
||||
<label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
|
||||
<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
|
||||
<input type="button" id="category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php esc_attr_e( 'Add' ); ?>" />
|
||||
<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
|
||||
<span id="category-ajax-response"></span>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', 'link', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display form fields for changing link target.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_target_meta_box($link) { ?>
|
||||
<fieldset><legend class="screen-reader-text"><span><?php _e('Target') ?></span></legend>
|
||||
<p><label for="link_target_blank" class="selectit">
|
||||
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
|
||||
<?php _e('<code>_blank</code> - new window or tab.'); ?></label></p>
|
||||
<p><label for="link_target_top" class="selectit">
|
||||
<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
|
||||
<?php _e('<code>_top</code> - current window or tab, with no frames.'); ?></label></p>
|
||||
<p><label for="link_target_none" class="selectit">
|
||||
<input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> />
|
||||
<?php _e('<code>_none</code> - same window or tab.'); ?></label></p>
|
||||
</fieldset>
|
||||
<p><?php _e('Choose the target frame for your link.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display xfn form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_xfn_meta_box($link) {
|
||||
?>
|
||||
<table class="editform" style="width: 100%;" cellspacing="2" cellpadding="5">
|
||||
<tr>
|
||||
<th style="width: 20%;" scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?></label></th>
|
||||
<td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo ( isset( $link->link_rel ) ? esc_attr($link->link_rel) : ''); ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table cellpadding="3" cellspacing="5" class="form-table">
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?> </span></legend>
|
||||
<label for="me">
|
||||
<input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
|
||||
<?php _e('another web address of mine') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </span></legend>
|
||||
<label for="contact">
|
||||
<input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?></label>
|
||||
<label for="acquaintance">
|
||||
<input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?></label>
|
||||
<label for="friend">
|
||||
<input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?></label>
|
||||
<label for="friendship">
|
||||
<input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </span></legend>
|
||||
<label for="met">
|
||||
<input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('met') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </span></legend>
|
||||
<label for="co-worker">
|
||||
<input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-worker') ?></label>
|
||||
<label for="colleague">
|
||||
<input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('colleague') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </span></legend>
|
||||
<label for="co-resident">
|
||||
<input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-resident') ?></label>
|
||||
<label for="neighbor">
|
||||
<input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('neighbor') ?></label>
|
||||
<label for="geographical">
|
||||
<input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </span></legend>
|
||||
<label for="child">
|
||||
<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('child') ?></label>
|
||||
<label for="kin">
|
||||
<input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('kin') ?></label>
|
||||
<label for="parent">
|
||||
<input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('parent') ?></label>
|
||||
<label for="sibling">
|
||||
<input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sibling') ?></label>
|
||||
<label for="spouse">
|
||||
<input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('spouse') ?></label>
|
||||
<label for="family">
|
||||
<input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </span></legend>
|
||||
<label for="muse">
|
||||
<input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('muse') ?></label>
|
||||
<label for="crush">
|
||||
<input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('crush') ?></label>
|
||||
<label for="date">
|
||||
<input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('date') ?></label>
|
||||
<label for="romantic">
|
||||
<input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sweetheart') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display advanced link options form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_advanced_meta_box($link) {
|
||||
?>
|
||||
<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
|
||||
<tr class="form-field">
|
||||
<th valign="top" scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
|
||||
<td><input type="text" name="link_image" class="code" id="link_image" size="50" value="<?php echo ( isset( $link->link_image ) ? esc_attr($link->link_image) : ''); ?>" style="width: 95%" /></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th valign="top" scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>
|
||||
<td><input name="link_rss" class="code" type="text" id="rss_uri" value="<?php echo ( isset( $link->link_rss ) ? esc_attr($link->link_rss) : ''); ?>" size="50" style="width: 95%" /></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th valign="top" scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
|
||||
<td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); ?></textarea></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th valign="top" scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>
|
||||
<td><select name="link_rating" id="link_rating" size="1">
|
||||
<?php
|
||||
for ($r = 0; $r < 10; $r++) {
|
||||
echo(' <option value="'. esc_attr($r) .'" ');
|
||||
if ( isset($link->link_rating) && $link->link_rating == $r)
|
||||
echo 'selected="selected"';
|
||||
echo('>'.$r.'</option>');
|
||||
}
|
||||
?></select> <?php _e('(Leave at 0 for no rating.)') ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core');
|
||||
|
||||
do_action('do_meta_boxes', 'link', 'normal', $link);
|
||||
|
||||
@@ -20,41 +20,20 @@ if ( ! isset( $post_ID ) )
|
||||
if ( ! isset( $temp_ID ) )
|
||||
$temp_ID = 0;
|
||||
|
||||
$message = false;
|
||||
if ( isset($_GET['message']) ) {
|
||||
if ( isset($_GET['message']) )
|
||||
$_GET['message'] = absint( $_GET['message'] );
|
||||
$messages[1] = sprintf(__('Page updated. <a href="%s">View page</a>'), get_permalink($post_ID));
|
||||
$messages[2] = __('Custom field updated.');
|
||||
$messages[3] = __('Custom field deleted.');
|
||||
$messages[5] = sprintf(__('Page published. <a href="%s">View page</a>'), get_permalink($post_ID));
|
||||
$messages[6] = sprintf(__('Page submitted. <a href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
|
||||
|
||||
switch ( $_GET['message'] ) {
|
||||
case 1:
|
||||
$message = sprintf( __('Page updated. <a href="%s">View page</a>'), get_permalink($post_ID) );
|
||||
break;
|
||||
case 2:
|
||||
$message = __('Custom field updated.');
|
||||
break;
|
||||
case 3:
|
||||
$message = __('Custom field deleted.');
|
||||
break;
|
||||
case 4:
|
||||
$message = sprintf( __('Page published. <a href="%s">View page</a>'), get_permalink($post_ID) );
|
||||
break;
|
||||
case 5:
|
||||
if ( isset($_GET['revision']) )
|
||||
$message = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
|
||||
break;
|
||||
case 6:
|
||||
$message = sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
|
||||
break;
|
||||
case 7:
|
||||
// translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php
|
||||
$message = sprintf( __('Page scheduled for: <b>%1$s</b>. <a target="_blank" href="%2$s">Preview page</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) );
|
||||
break;
|
||||
case 8:
|
||||
$message = sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( isset($_GET['revision']) )
|
||||
$messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
|
||||
|
||||
$notice = false;
|
||||
$notices[1] = __( 'There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.' );
|
||||
|
||||
if ( 0 == $post_ID) {
|
||||
$form_action = 'post';
|
||||
$nonce_action = 'add-page';
|
||||
@@ -67,30 +46,351 @@ if ( 0 == $post_ID) {
|
||||
$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
|
||||
$autosave = wp_get_post_autosave( $post_ID );
|
||||
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) )
|
||||
$notice = sprintf( __( 'There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.' ), get_edit_post_link( $autosave->ID ) );
|
||||
$notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
|
||||
}
|
||||
|
||||
$temp_ID = (int) $temp_ID;
|
||||
$user_ID = (int) $user_ID;
|
||||
|
||||
require_once('includes/meta-boxes.php');
|
||||
/**
|
||||
* Display submit form fields.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_submit_meta_box($post) {
|
||||
global $action;
|
||||
|
||||
add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'page', 'side', 'core');
|
||||
$can_publish = current_user_can('publish_pages');
|
||||
?>
|
||||
<div class="submitbox" id="submitpage">
|
||||
|
||||
<div id="minor-publishing">
|
||||
|
||||
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
|
||||
<div style="display:none;">
|
||||
<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
|
||||
</div>
|
||||
|
||||
<div id="minor-publishing-actions">
|
||||
<div id="save-action">
|
||||
<?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
|
||||
<input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" tabindex="4" class="button button-highlighted" />
|
||||
<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
|
||||
<input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="preview-action">
|
||||
<?php
|
||||
if ( 'publish' == $post->post_status ) {
|
||||
$preview_link = esc_url(get_permalink($post->ID));
|
||||
$preview_button = __('Preview Changes');
|
||||
} else {
|
||||
$preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
|
||||
$preview_button = __('Preview');
|
||||
}
|
||||
?>
|
||||
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a>
|
||||
<input type="hidden" name="wp-preview" id="wp-preview" value="" />
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div><?php // /minor-publishing-actions ?>
|
||||
|
||||
<div id="misc-publishing-actions">
|
||||
|
||||
<div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label>
|
||||
<span id="post-status-display">
|
||||
<?php
|
||||
switch ( $post->post_status ) {
|
||||
case 'private':
|
||||
_e('Privately Published');
|
||||
break;
|
||||
case 'publish':
|
||||
_e('Published');
|
||||
break;
|
||||
case 'future':
|
||||
_e('Scheduled');
|
||||
break;
|
||||
case 'pending':
|
||||
_e('Pending Review');
|
||||
break;
|
||||
case 'draft':
|
||||
_e('Draft');
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
|
||||
<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
|
||||
|
||||
<div id="post-status-select" class="hide-if-js">
|
||||
<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr($post->post_status); ?>" />
|
||||
<select name='post_status' id='post_status' tabindex='4'>
|
||||
<?php if ( 'publish' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
|
||||
<?php elseif ( 'private' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
|
||||
<?php elseif ( 'future' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
|
||||
<?php endif; ?>
|
||||
<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
|
||||
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
|
||||
</select>
|
||||
|
||||
<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
</div><?php // /misc-pub-section ?>
|
||||
|
||||
<div class="misc-pub-section " id="visibility">
|
||||
<?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php
|
||||
|
||||
if ( 'private' == $post->post_status ) {
|
||||
$post->post_password = '';
|
||||
$visibility = 'private';
|
||||
$visibility_trans = __('Private');
|
||||
} elseif ( !empty( $post->post_password ) ) {
|
||||
$visibility = 'password';
|
||||
$visibility_trans = __('Password protected');
|
||||
} else {
|
||||
$visibility = 'public';
|
||||
$visibility_trans = __('Public');
|
||||
}
|
||||
|
||||
echo esc_html( $visibility_trans ); ?></span>
|
||||
<?php if ( $can_publish ) { ?>
|
||||
<a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
|
||||
|
||||
<div id="post-visibility-select" class="hide-if-js">
|
||||
<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
|
||||
<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
|
||||
|
||||
<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
|
||||
<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
|
||||
<span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>" /><br /></span>
|
||||
<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
|
||||
|
||||
<p><a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div><?php // /misc-pub-section ?>
|
||||
|
||||
<?php
|
||||
// translators: Publish box date formt, see http://php.net/date
|
||||
$datef = __( 'M j, Y @ G:i' );
|
||||
if ( 0 != $post->ID ) {
|
||||
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
|
||||
$stamp = __('Scheduled for: <b>%1$s</b>');
|
||||
} else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
|
||||
$stamp = __('Published on: <b>%1$s</b>');
|
||||
} else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
|
||||
$stamp = __('Publish <b>immediately</b>');
|
||||
} else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
|
||||
$stamp = __('Schedule for: <b>%1$s</b>');
|
||||
} else { // draft, 1 or more saves, date specified
|
||||
$stamp = __('Publish on: <b>%1$s</b>');
|
||||
}
|
||||
$date = date_i18n( $datef, strtotime( $post->post_date ) );
|
||||
} else { // draft (no saves, and thus no date specified)
|
||||
$stamp = __('Publish <b>immediately</b>');
|
||||
$date = date_i18n( $datef, strtotime( current_time('mysql') ) );
|
||||
}
|
||||
|
||||
if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
|
||||
<div class="misc-pub-section curtime misc-pub-section-last">
|
||||
<span id="timestamp"><?php printf($stamp, $date); ?></span>
|
||||
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
|
||||
<div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
|
||||
</div><?php // /misc-pub-section
|
||||
endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="major-publishing-actions">
|
||||
<?php do_action('post_submitbox_start'); ?>
|
||||
<div id="delete-action">
|
||||
<?php
|
||||
if ( ( 'edit' == $action ) && current_user_can('delete_page', $post->ID) ) { ?>
|
||||
<a class="submitdelete deletion" href="<?php echo wp_nonce_url("page.php?action=delete&post=$post->ID", 'delete-page_' . $post->ID); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="publishing-action">
|
||||
<?php
|
||||
if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?>
|
||||
<?php
|
||||
if ( $can_publish ) :
|
||||
if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Schedule') ?>" />
|
||||
<?php else : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Publish') ?>" />
|
||||
<?php endif;
|
||||
else : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Submit for Review') ?>" />
|
||||
<?php
|
||||
endif;
|
||||
} else { ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update Page') ?>" />
|
||||
<input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Update Page') ?>" />
|
||||
<?php
|
||||
} ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pagesubmitdiv', __('Publish'), 'page_submit_meta_box', 'page', 'side', 'core');
|
||||
|
||||
/**
|
||||
* Display page password form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_password_meta_box($post){
|
||||
?>
|
||||
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>
|
||||
<h4><?php _e( 'Page Password' ); ?></h4>
|
||||
<p><label class="screen-reader-text" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php the_post_password(); ?>" /></p>
|
||||
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this page and its comments.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
// add_meta_box('pagepassworddiv', __('Privacy Options'), 'page_password_meta_box', 'page', 'side', 'core');
|
||||
|
||||
/**
|
||||
* Display page attributes form fields.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_attributes_meta_box($post){
|
||||
?>
|
||||
<h5><?php _e('Parent') ?></h5>
|
||||
<label class="screen-reader-text" for="parent_id"><?php _e('Page Parent') ?></label>
|
||||
<?php wp_dropdown_pages(array('exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?>
|
||||
<p><?php _e('You can arrange your pages in hierarchies, for example you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
|
||||
<?php
|
||||
if ( 0 != count( get_page_templates() ) ) { ?>
|
||||
<h5><?php _e('Template') ?></h5>
|
||||
<label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
|
||||
<option value='default'><?php _e('Default Template'); ?></option>
|
||||
<?php page_template_dropdown($post->page_template); ?>
|
||||
</select>
|
||||
<p><?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them above.'); ?></p>
|
||||
<?php
|
||||
} ?>
|
||||
<h5><?php _e('Order') ?></h5>
|
||||
<p><label class="screen-reader-text" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p>
|
||||
<p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it’ll be better in future releases.)'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', 'page', 'side', 'core');
|
||||
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'page', 'normal', 'core');
|
||||
add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'page', 'normal', 'core');
|
||||
add_meta_box('slugdiv', __('Page Slug'), 'post_slug_meta_box', 'page', 'normal', 'core');
|
||||
if ( current_theme_supports( 'post-thumbnails', 'page' ) )
|
||||
add_meta_box('postimagediv', __('Page Image'), 'post_thumbnail_meta_box', 'page', 'side', 'low');
|
||||
|
||||
/**
|
||||
* Display custom field for page form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_custom_meta_box($post){
|
||||
?>
|
||||
<div id="postcustomstuff">
|
||||
<?php
|
||||
$metadata = has_meta($post->ID);
|
||||
list_meta($metadata);
|
||||
meta_form(); ?>
|
||||
<div id="ajax-response"></div>
|
||||
</div>
|
||||
<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pagecustomdiv', __('Custom Fields'), 'page_custom_meta_box', 'page', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display comments status form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_comments_status_meta_box($post){
|
||||
?>
|
||||
<input name="advanced_view" type="hidden" value="1" />
|
||||
<p><label for="comment_status" class="selectit">
|
||||
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
|
||||
<?php _e('Allow Comments') ?></label></p>
|
||||
<p><label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label></p>
|
||||
<p><?php _e('These settings apply to this page only. “Pings” are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pagecommentstatusdiv', __('Discussion'), 'page_comments_status_meta_box', 'page', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display page slug form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_slug_meta_box($post){
|
||||
?>
|
||||
<label class="screen-reader-text" for="post_name"><?php _e('Page Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( $post->post_name ); ?>" />
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', 'normal', 'core');
|
||||
|
||||
$authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
|
||||
if ( $post->post_author && !in_array($post->post_author, $authors) )
|
||||
$authors[] = $post->post_author;
|
||||
if ( $authors && count( $authors ) > 1 )
|
||||
add_meta_box('pageauthordiv', __('Page Author'), 'post_author_meta_box', 'page', 'normal', 'core');
|
||||
if ( $authors && count( $authors ) > 1 ) {
|
||||
/**
|
||||
* Display page author form fields, when more than one author exists.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_author_meta_box($post){
|
||||
global $current_user, $user_ID;
|
||||
$authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
|
||||
if ( $post->post_author && !in_array($post->post_author, $authors) )
|
||||
$authors[] = $post->post_author;
|
||||
?>
|
||||
<label class="screen-reader-text" for="post_author_override"><?php _e('Page Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pageauthordiv', __('Page Author'), 'page_author_meta_box', 'page', 'normal', 'core');
|
||||
}
|
||||
|
||||
if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) )
|
||||
add_meta_box('revisionsdiv', __('Page Revisions'), 'post_revisions_meta_box', 'page', 'normal', 'core');
|
||||
if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
|
||||
/**
|
||||
* Display list of page revisions.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_revisions_meta_box($post) {
|
||||
wp_list_post_revisions();
|
||||
}
|
||||
add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', 'normal', 'core');
|
||||
endif;
|
||||
|
||||
do_action('do_meta_boxes', 'page', 'normal', $post);
|
||||
do_action('do_meta_boxes', 'page', 'advanced', $post);
|
||||
@@ -107,12 +407,16 @@ require_once('admin-header.php');
|
||||
<?php if ( $notice ) : ?>
|
||||
<div id="notice" class="error"><p><?php echo $notice ?></p></div>
|
||||
<?php endif; ?>
|
||||
<?php if ( $message ) : ?>
|
||||
<div id="message" class="updated fade"><p><?php echo $message; ?></p></div>
|
||||
<?php if (isset($_GET['message'])) : ?>
|
||||
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php wp_nonce_field($nonce_action); ?>
|
||||
<?php
|
||||
wp_nonce_field($nonce_action);
|
||||
|
||||
if (isset($mode) && 'bookmarklet' == $mode)
|
||||
echo '<input type="hidden" name="mode" value="bookmarklet" />';
|
||||
?>
|
||||
<input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" />
|
||||
<input type="hidden" id="hiddenaction" name="action" value='<?php echo esc_attr($form_action) ?>' />
|
||||
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr($form_action) ?>" />
|
||||
|
||||
@@ -13,86 +13,58 @@ if ( !current_user_can('edit_pages') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
// Handle bulk actions
|
||||
if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) {
|
||||
check_admin_referer('bulk-pages');
|
||||
$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
|
||||
|
||||
if ( strpos($sendback, 'page.php') !== false )
|
||||
$sendback = admin_url('page-new.php');
|
||||
|
||||
if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
|
||||
$post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_GET['post_status']);
|
||||
$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status = %s", $post_status ) );
|
||||
$doaction = 'delete';
|
||||
} elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['post']) || isset($_GET['ids']) ) ) {
|
||||
$post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']);
|
||||
$doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
|
||||
} else {
|
||||
wp_redirect( admin_url('edit-pages.php') );
|
||||
}
|
||||
if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
|
||||
$doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
|
||||
|
||||
switch ( $doaction ) {
|
||||
case 'trash':
|
||||
$trashed = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can('delete_page', $post_id) )
|
||||
wp_die( __('You are not allowed to move this page to the trash.') );
|
||||
|
||||
if ( !wp_trash_post($post_id) )
|
||||
wp_die( __('Error in moving to trash...') );
|
||||
|
||||
$trashed++;
|
||||
}
|
||||
$sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids)), $sendback );
|
||||
break;
|
||||
case 'untrash':
|
||||
$untrashed = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can('delete_page', $post_id) )
|
||||
wp_die( __('You are not allowed to restore this page from the trash.') );
|
||||
|
||||
if ( !wp_untrash_post($post_id) )
|
||||
wp_die( __('Error in restoring from trash...') );
|
||||
|
||||
$untrashed++;
|
||||
}
|
||||
$sendback = add_query_arg('untrashed', $untrashed, $sendback);
|
||||
break;
|
||||
case 'delete':
|
||||
$deleted = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
$post_del = & get_post($post_id);
|
||||
if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
|
||||
check_admin_referer('bulk-pages');
|
||||
$deleted = 0;
|
||||
foreach( (array) $_GET['post'] as $post_id_del ) {
|
||||
$post_del = & get_post($post_id_del);
|
||||
|
||||
if ( !current_user_can('delete_page', $post_id) )
|
||||
wp_die( __('You are not allowed to delete this page.') );
|
||||
if ( !current_user_can('delete_page', $post_id_del) )
|
||||
wp_die( __('You are not allowed to delete this page.') );
|
||||
|
||||
if ( $post_del->post_type == 'attachment' ) {
|
||||
if ( ! wp_delete_attachment($post_id) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
} else {
|
||||
if ( !wp_delete_post($post_id) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
if ( $post_del->post_type == 'attachment' ) {
|
||||
if ( ! wp_delete_attachment($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
} else {
|
||||
if ( !wp_delete_post($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
}
|
||||
$deleted++;
|
||||
}
|
||||
$deleted++;
|
||||
}
|
||||
$sendback = add_query_arg('deleted', $deleted, $sendback);
|
||||
break;
|
||||
case 'edit':
|
||||
$_GET['post_type'] = 'page';
|
||||
$done = bulk_edit_posts($_GET);
|
||||
if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) {
|
||||
check_admin_referer('bulk-pages');
|
||||
|
||||
if ( is_array($done) ) {
|
||||
$done['updated'] = count( $done['updated'] );
|
||||
$done['skipped'] = count( $done['skipped'] );
|
||||
$done['locked'] = count( $done['locked'] );
|
||||
$sendback = add_query_arg( $done, $sendback );
|
||||
if ( -1 == $_GET['_status'] ) {
|
||||
$_GET['post_status'] = null;
|
||||
unset($_GET['_status'], $_GET['post_status']);
|
||||
} else {
|
||||
$_GET['post_status'] = $_GET['_status'];
|
||||
}
|
||||
|
||||
$done = bulk_edit_posts($_GET);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ( isset($_GET['action']) )
|
||||
$sendback = remove_query_arg( array('action', 'action2', 'post_parent', 'page_template', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view', 'post_type'), $sendback );
|
||||
|
||||
$sendback = wp_get_referer();
|
||||
if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php');
|
||||
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
|
||||
if ( isset($done) ) {
|
||||
$done['updated'] = count( $done['updated'] );
|
||||
$done['skipped'] = count( $done['skipped'] );
|
||||
$done['locked'] = count( $done['locked'] );
|
||||
$sendback = add_query_arg( $done, $sendback );
|
||||
}
|
||||
if ( isset($deleted) )
|
||||
$sendback = add_query_arg('deleted', $deleted, $sendback);
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
|
||||
@@ -110,13 +82,9 @@ $post_stati = array( // array( adj, noun )
|
||||
'future' => array(_x('Scheduled', 'page'), __('Scheduled pages'), _nx_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>', 'page')),
|
||||
'pending' => array(_x('Pending Review', 'page'), __('Pending pages'), _nx_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>', 'page')),
|
||||
'draft' => array(_x('Draft', 'page'), _x('Drafts', 'manage posts header'), _nx_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>', 'page')),
|
||||
'private' => array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>', 'page')),
|
||||
'trash' => array(_x('Trash', 'page'), __('Trash pages'), _nx_noop('Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', 'page'))
|
||||
'private' => array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>', 'page'))
|
||||
);
|
||||
|
||||
if ( !EMPTY_TRASH_DAYS )
|
||||
unset($post_stati['trash']);
|
||||
|
||||
$post_stati = apply_filters('page_stati', $post_stati);
|
||||
|
||||
$query = array('post_type' => 'page', 'orderby' => 'menu_order title',
|
||||
@@ -141,40 +109,33 @@ require_once('admin-header.php'); ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?> <a href="page-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'page'); ?></a> <?php
|
||||
<h2><?php echo esc_html( $title );
|
||||
if ( isset($_GET['s']) && $_GET['s'] )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( get_search_query() ) ); ?>
|
||||
</h2>
|
||||
|
||||
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?>
|
||||
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?>
|
||||
<div id="message" class="updated fade"><p>
|
||||
<?php if ( isset($_GET['updated']) && (int) $_GET['updated'] ) {
|
||||
printf( _n( '%s page updated.', '%s pages updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
|
||||
unset($_GET['updated']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['skipped']) && (int) $_GET['skipped'] ) {
|
||||
printf( _n( '%s page not updated, invalid parent page specified.', '%s pages not updated, invalid parent page specified.', $_GET['skipped'] ), number_format_i18n( $_GET['skipped'] ) );
|
||||
unset($_GET['skipped']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['locked']) && (int) $_GET['locked'] ) {
|
||||
printf( _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) );
|
||||
unset($_GET['locked']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
|
||||
printf( _n( 'Page permanently deleted.', '%s pages permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
|
||||
printf( _n( 'Page deleted.', '%s pages deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
|
||||
unset($_GET['deleted']);
|
||||
}
|
||||
if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
|
||||
printf( _n( 'Page moved to the trash.', '%s pages moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
|
||||
$ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
|
||||
echo ' <a href="' . esc_url( wp_nonce_url( "edit-pages.php?doaction=undo&action=untrash&ids=$ids", "bulk-pages" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
unset($_GET['trashed']);
|
||||
}
|
||||
if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) {
|
||||
printf( _n( 'Page restored from the trash.', '%s pages restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
|
||||
unset($_GET['untrashed']);
|
||||
}
|
||||
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] );
|
||||
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] );
|
||||
?>
|
||||
</p></div>
|
||||
<?php } ?>
|
||||
@@ -184,7 +145,7 @@ $_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated'
|
||||
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
|
||||
endif; ?>
|
||||
|
||||
<form id="posts-filter" action="<?php echo admin_url('edit-pages.php'); ?>" method="get">
|
||||
<form id="posts-filter" action="" method="get">
|
||||
<ul class="subsubsub">
|
||||
<?php
|
||||
|
||||
@@ -192,13 +153,13 @@ $avail_post_stati = get_available_post_statuses('page');
|
||||
if ( empty($locked_post_status) ) :
|
||||
$status_links = array();
|
||||
$num_posts = wp_count_posts('page', 'readable');
|
||||
$total_posts = array_sum( (array) $num_posts ) - $num_posts->trash;
|
||||
$total_posts = array_sum( (array) $num_posts );
|
||||
$class = empty($_GET['post_status']) ? ' class="current"' : '';
|
||||
$status_links[] = "<li><a href='edit-pages.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'pages' ), number_format_i18n( $total_posts ) ) . '</a>';
|
||||
foreach ( $post_stati as $status => $label ) {
|
||||
$class = '';
|
||||
|
||||
if ( !in_array($status, $avail_post_stati) || $num_posts->$status <= 0 )
|
||||
if ( !in_array($status, $avail_post_stati) )
|
||||
continue;
|
||||
|
||||
if ( isset( $_GET['post_status'] ) && $status == $_GET['post_status'] )
|
||||
@@ -218,7 +179,9 @@ endif;
|
||||
<input type="submit" value="<?php esc_attr_e( 'Search Pages' ); ?>" class="button" />
|
||||
</p>
|
||||
|
||||
<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_GET['post_status']) ? esc_attr($_GET['post_status']) : 'all'; ?>" />
|
||||
<?php if ( isset($_GET['post_status'] ) ) : ?>
|
||||
<input type="hidden" name="post_status" value="<?php echo esc_attr($_GET['post_status']) ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($posts) { ?>
|
||||
|
||||
@@ -228,10 +191,9 @@ endif;
|
||||
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
|
||||
if ( empty($pagenum) )
|
||||
$pagenum = 1;
|
||||
$per_page = (int) get_user_option( 'edit_pages_per_page', 0, false );
|
||||
if ( empty( $per_page ) || $per_page < 1 )
|
||||
$per_page = get_user_option('edit_pages_per_page');
|
||||
if ( empty( $per_page ) || $per_page < 0 )
|
||||
$per_page = 20;
|
||||
$per_page = apply_filters( 'edit_pages_per_page', $per_page );
|
||||
|
||||
$num_pages = ceil($wp_query->post_count / $per_page);
|
||||
$page_links = paginate_links( array(
|
||||
@@ -243,8 +205,6 @@ $page_links = paginate_links( array(
|
||||
'current' => $pagenum
|
||||
));
|
||||
|
||||
$is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash';
|
||||
|
||||
if ( $page_links ) : ?>
|
||||
<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
|
||||
number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
|
||||
@@ -257,21 +217,11 @@ if ( $page_links ) : ?>
|
||||
<div class="alignleft actions">
|
||||
<select name="action">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<?php if ( $is_trash ) { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="edit"><?php _e('Edit'); ?></option>
|
||||
<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } ?>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<?php wp_nonce_field('bulk-pages'); ?>
|
||||
<?php if ( $is_trash ) { ?>
|
||||
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
@@ -306,20 +256,10 @@ if ( $page_links )
|
||||
<div class="alignleft actions">
|
||||
<select name="action2">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<?php if ( $is_trash ) { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="edit"><?php _e('Edit'); ?></option>
|
||||
<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } ?>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
<?php if ( $is_trash ) { ?>
|
||||
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
|
||||
@@ -33,7 +33,8 @@ do_action('edit_tag_form_pre', $tag); ?>
|
||||
<table class="form-table">
|
||||
<tr class="form-field form-required">
|
||||
<th scope="row" valign="top"><label for="name"><?php _e('Tag name') ?></label></th>
|
||||
<td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" /></td>
|
||||
<td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" />
|
||||
<p class="description"><?php _e('The name is how the tag appears on your site.'); ?></p></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="slug"><?php _e('Tag slug') ?></label></th>
|
||||
|
||||
@@ -27,14 +27,14 @@ if ( isset( $_GET['action'] ) && isset($_GET['delete_tags']) && ( 'delete' == $_
|
||||
|
||||
switch($action) {
|
||||
|
||||
case 'add-tag':
|
||||
case 'addtag':
|
||||
|
||||
check_admin_referer('add-tag');
|
||||
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
$ret = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST);
|
||||
$ret = wp_insert_term($_POST['name'], $taxonomy, $_POST);
|
||||
if ( $ret && !is_wp_error( $ret ) ) {
|
||||
wp_redirect('edit-tags.php?message=1#addtag');
|
||||
} else {
|
||||
@@ -44,11 +44,6 @@ case 'add-tag':
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
if ( !isset( $_GET['tag_ID'] ) ) {
|
||||
wp_redirect("edit-tags.php?taxonomy=$taxonomy");
|
||||
exit;
|
||||
}
|
||||
|
||||
$tag_ID = (int) $_GET['tag_ID'];
|
||||
check_admin_referer('delete-tag_' . $tag_ID);
|
||||
|
||||
@@ -75,8 +70,8 @@ case 'bulk-delete':
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
$tags = (array) $_GET['delete_tags'];
|
||||
foreach( $tags as $tag_ID ) {
|
||||
$tags = $_GET['delete_tags'];
|
||||
foreach( (array) $tags as $tag_ID ) {
|
||||
wp_delete_term( $tag_ID, $taxonomy);
|
||||
}
|
||||
|
||||
@@ -160,7 +155,6 @@ if ( isset($_GET['s']) && $_GET['s'] )
|
||||
<div id="message" class="updated fade"><p><?php echo $messages[$msg]; ?></p></div>
|
||||
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
|
||||
endif; ?>
|
||||
<div id="ajax-response"></div>
|
||||
|
||||
<form class="search-form" action="" method="get">
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
|
||||
@@ -184,11 +178,11 @@ $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
|
||||
if ( empty($pagenum) )
|
||||
$pagenum = 1;
|
||||
|
||||
$tags_per_page = (int) get_user_option( 'edit_tags_per_page', 0, false );
|
||||
if ( empty($tags_per_page) || $tags_per_page < 1 )
|
||||
$tags_per_page = get_user_option('edit_tags_per_page');
|
||||
if ( empty($tags_per_page) )
|
||||
$tags_per_page = 20;
|
||||
$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
|
||||
$tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
|
||||
$tags_per_page = apply_filters('edit_tags_per_page', $tags_per_page);
|
||||
$tags_per_page = apply_filters('tagsperpage', $tags_per_page); // Old filter
|
||||
|
||||
$page_links = paginate_links( array(
|
||||
'base' => add_query_arg( 'pagenum', '%#%' ),
|
||||
@@ -280,14 +274,15 @@ else
|
||||
|
||||
<div class="form-wrap">
|
||||
<h3><?php _e('Add a New Tag'); ?></h3>
|
||||
<form id="addtag" method="post" action="edit-tags.php" class="validate">
|
||||
<input type="hidden" name="action" value="add-tag" />
|
||||
<div id="ajax-response"></div>
|
||||
<form name="addtag" id="addtag" method="post" action="edit-tags.php" class="add:the-list: validate">
|
||||
<input type="hidden" name="action" value="addtag" />
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
|
||||
<?php wp_nonce_field('add-tag'); ?>
|
||||
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-tag'); ?>
|
||||
|
||||
<div class="form-field form-required">
|
||||
<label for="tag-name"><?php _e('Tag name') ?></label>
|
||||
<input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />
|
||||
<label for="name"><?php _e('Tag name') ?></label>
|
||||
<input name="name" id="name" type="text" value="" size="40" aria-required="true" />
|
||||
<p><?php _e('The name is how the tag appears on your site.'); ?></p>
|
||||
</div>
|
||||
|
||||
@@ -300,10 +295,10 @@ else
|
||||
<div class="form-field">
|
||||
<label for="description"><?php _e('Description') ?></label>
|
||||
<textarea name="description" id="description" rows="5" cols="40"></textarea>
|
||||
<p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
|
||||
<p><?php _e('The description is not prominent by default, however some themes may show it.'); ?></p>
|
||||
</div>
|
||||
|
||||
<p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php esc_attr_e('Add Tag'); ?>" /></p>
|
||||
<p class="submit"><input type="submit" class="button" name="submit" value="<?php esc_attr_e('Add Tag'); ?>" /></p>
|
||||
<?php do_action('add_tag_form'); ?>
|
||||
</form></div>
|
||||
<?php } ?>
|
||||
|
||||
@@ -21,85 +21,58 @@ if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['pag
|
||||
}
|
||||
|
||||
// Handle bulk actions
|
||||
if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) {
|
||||
check_admin_referer('bulk-posts');
|
||||
$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
|
||||
|
||||
if ( strpos($sendback, 'post.php') !== false )
|
||||
$sendback = admin_url('post-new.php');
|
||||
|
||||
if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
|
||||
$post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_GET['post_status']);
|
||||
$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='post' AND post_status = %s", $post_status ) );
|
||||
$doaction = 'delete';
|
||||
} elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['post']) || isset($_GET['ids']) ) ) {
|
||||
$post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']);
|
||||
$doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
|
||||
} else {
|
||||
wp_redirect( admin_url('edit.php') );
|
||||
}
|
||||
if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
|
||||
$doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
|
||||
|
||||
switch ( $doaction ) {
|
||||
case 'trash':
|
||||
$trashed = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can('delete_post', $post_id) )
|
||||
wp_die( __('You are not allowed to move this post to the trash.') );
|
||||
|
||||
if ( !wp_trash_post($post_id) )
|
||||
wp_die( __('Error in moving to trash...') );
|
||||
|
||||
$trashed++;
|
||||
}
|
||||
$sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids)), $sendback );
|
||||
break;
|
||||
case 'untrash':
|
||||
$untrashed = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can('delete_post', $post_id) )
|
||||
wp_die( __('You are not allowed to restore this post from the trash.') );
|
||||
|
||||
if ( !wp_untrash_post($post_id) )
|
||||
wp_die( __('Error in restoring from trash...') );
|
||||
|
||||
$untrashed++;
|
||||
}
|
||||
$sendback = add_query_arg('untrashed', $untrashed, $sendback);
|
||||
break;
|
||||
case 'delete':
|
||||
$deleted = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
$post_del = & get_post($post_id);
|
||||
if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
|
||||
check_admin_referer('bulk-posts');
|
||||
$deleted = 0;
|
||||
foreach( (array) $_GET['post'] as $post_id_del ) {
|
||||
$post_del = & get_post($post_id_del);
|
||||
|
||||
if ( !current_user_can('delete_post', $post_id) )
|
||||
wp_die( __('You are not allowed to delete this post.') );
|
||||
if ( !current_user_can('delete_post', $post_id_del) )
|
||||
wp_die( __('You are not allowed to delete this post.') );
|
||||
|
||||
if ( $post_del->post_type == 'attachment' ) {
|
||||
if ( ! wp_delete_attachment($post_id) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
} else {
|
||||
if ( !wp_delete_post($post_id) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
if ( $post_del->post_type == 'attachment' ) {
|
||||
if ( ! wp_delete_attachment($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
} else {
|
||||
if ( !wp_delete_post($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
}
|
||||
$deleted++;
|
||||
}
|
||||
$deleted++;
|
||||
}
|
||||
$sendback = add_query_arg('deleted', $deleted, $sendback);
|
||||
break;
|
||||
case 'edit':
|
||||
$done = bulk_edit_posts($_GET);
|
||||
if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) {
|
||||
check_admin_referer('bulk-posts');
|
||||
|
||||
if ( is_array($done) ) {
|
||||
$done['updated'] = count( $done['updated'] );
|
||||
$done['skipped'] = count( $done['skipped'] );
|
||||
$done['locked'] = count( $done['locked'] );
|
||||
$sendback = add_query_arg( $done, $sendback );
|
||||
if ( -1 == $_GET['_status'] ) {
|
||||
$_GET['post_status'] = null;
|
||||
unset($_GET['_status'], $_GET['post_status']);
|
||||
} else {
|
||||
$_GET['post_status'] = $_GET['_status'];
|
||||
}
|
||||
|
||||
$done = bulk_edit_posts($_GET);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ( isset($_GET['action']) )
|
||||
$sendback = remove_query_arg( array('action', 'action2', 'cat', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view', 'post_type'), $sendback );
|
||||
|
||||
$sendback = wp_get_referer();
|
||||
if ( strpos($sendback, 'post.php') !== false ) $sendback = admin_url('post-new.php');
|
||||
elseif ( strpos($sendback, 'attachments.php') !== false ) $sendback = admin_url('attachments.php');
|
||||
if ( isset($done) ) {
|
||||
$done['updated'] = count( $done['updated'] );
|
||||
$done['skipped'] = count( $done['skipped'] );
|
||||
$done['locked'] = count( $done['locked'] );
|
||||
$sendback = add_query_arg( $done, $sendback );
|
||||
}
|
||||
if ( isset($deleted) )
|
||||
$sendback = add_query_arg('deleted', $deleted, $sendback);
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
|
||||
@@ -112,14 +85,6 @@ if ( empty($title) )
|
||||
$parent_file = 'edit.php';
|
||||
wp_enqueue_script('inline-edit-post');
|
||||
|
||||
$user_posts = false;
|
||||
if ( !current_user_can('edit_others_posts') ) {
|
||||
$user_posts_count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(1) FROM $wpdb->posts WHERE post_type = 'post' AND post_status != 'trash' AND post_author = %d", $current_user->ID) );
|
||||
$user_posts = true;
|
||||
if ( $user_posts_count && empty($_GET['post_status']) && empty($_GET['all_posts']) && empty($_GET['author']) )
|
||||
$_GET['author'] = $current_user->ID;
|
||||
}
|
||||
|
||||
list($post_stati, $avail_post_stati) = wp_edit_posts_query();
|
||||
|
||||
require_once('admin-header.php');
|
||||
@@ -134,7 +99,7 @@ else
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?> <a href="post-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'post'); ?></a> <?php
|
||||
<h2><?php echo esc_html( $title );
|
||||
if ( isset($_GET['s']) && $_GET['s'] )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( get_search_query() ) ); ?>
|
||||
</h2>
|
||||
@@ -145,7 +110,7 @@ if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET
|
||||
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
|
||||
endif; ?>
|
||||
|
||||
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?>
|
||||
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?>
|
||||
<div id="message" class="updated fade"><p>
|
||||
<?php if ( isset($_GET['updated']) && (int) $_GET['updated'] ) {
|
||||
printf( _n( '%s post updated.', '%s posts updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
|
||||
@@ -161,47 +126,26 @@ if ( isset($_GET['locked']) && (int) $_GET['locked'] ) {
|
||||
}
|
||||
|
||||
if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
|
||||
printf( _n( 'Post permanently deleted.', '%s posts permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
|
||||
printf( _n( 'Post deleted.', '%s posts deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
|
||||
unset($_GET['deleted']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
|
||||
printf( _n( 'Post moved to the trash.', '%s posts moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
|
||||
$ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
|
||||
echo ' <a href="' . esc_url( wp_nonce_url( "edit.php?doaction=undo&action=untrash&ids=$ids", "bulk-posts" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
unset($_GET['trashed']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) {
|
||||
printf( _n( 'Post restored from the trash.', '%s posts restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
|
||||
unset($_GET['undeleted']);
|
||||
}
|
||||
|
||||
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] );
|
||||
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] );
|
||||
?>
|
||||
</p></div>
|
||||
<?php } ?>
|
||||
|
||||
<form id="posts-filter" action="<?php echo admin_url('edit.php'); ?>" method="get">
|
||||
<form id="posts-filter" action="" method="get">
|
||||
|
||||
<ul class="subsubsub">
|
||||
<?php
|
||||
if ( empty($locked_post_status) ) :
|
||||
$status_links = array();
|
||||
$num_posts = wp_count_posts( 'post', 'readable' );
|
||||
$class = '';
|
||||
$allposts = '';
|
||||
$total_posts = array_sum( (array) $num_posts );
|
||||
$class = empty( $_GET['post_status'] ) ? ' class="current"' : '';
|
||||
$status_links[] = "<li><a href='edit.php' $class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '</a>';
|
||||
|
||||
if ( $user_posts ) {
|
||||
if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user->ID ) )
|
||||
$class = ' class="current"';
|
||||
$status_links[] = "<li><a href='edit.php?author=$current_user->ID'$class>" . sprintf( _nx( 'My Posts <span class="count">(%s)</span>', 'My Posts <span class="count">(%s)</span>', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . '</a>';
|
||||
$allposts = '?all_posts=1';
|
||||
}
|
||||
|
||||
$total_posts = array_sum( (array) $num_posts ) - $num_posts->trash;
|
||||
$class = empty($class) && empty($_GET['post_status']) ? ' class="current"' : '';
|
||||
$status_links[] = "<li><a href='edit.php{$allposts}'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '</a>';
|
||||
|
||||
foreach ( $post_stati as $status => $label ) {
|
||||
$class = '';
|
||||
@@ -211,11 +155,10 @@ foreach ( $post_stati as $status => $label ) {
|
||||
|
||||
if ( empty( $num_posts->$status ) )
|
||||
continue;
|
||||
|
||||
if ( isset($_GET['post_status']) && $status == $_GET['post_status'] )
|
||||
$class = ' class="current"';
|
||||
|
||||
$status_links[] = "<li><a href='edit.php?post_status=$status'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
|
||||
$status_links[] = "<li><a href='edit.php?post_status=$status' $class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
|
||||
}
|
||||
echo implode( " |</li>\n", $status_links ) . '</li>';
|
||||
unset( $status_links );
|
||||
@@ -229,7 +172,9 @@ endif;
|
||||
<input type="submit" value="<?php esc_attr_e( 'Search Posts' ); ?>" class="button" />
|
||||
</p>
|
||||
|
||||
<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_GET['post_status']) ? esc_attr($_GET['post_status']) : 'all'; ?>" />
|
||||
<?php if ( isset($_GET['post_status'] ) ) : ?>
|
||||
<input type="hidden" name="post_status" value="<?php echo esc_attr($_GET['post_status']) ?>" />
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
|
||||
|
||||
<?php if ( have_posts() ) { ?>
|
||||
@@ -245,22 +190,13 @@ $page_links = paginate_links( array(
|
||||
'current' => $_GET['paged']
|
||||
));
|
||||
|
||||
$is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash';
|
||||
|
||||
?>
|
||||
|
||||
<div class="alignleft actions">
|
||||
<select name="action">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<?php if ( $is_trash ) { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="edit"><?php _e('Edit'); ?></option>
|
||||
<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } ?>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<?php wp_nonce_field('bulk-posts'); ?>
|
||||
@@ -304,10 +240,7 @@ wp_dropdown_categories($dropdown_options);
|
||||
do_action('restrict_manage_posts');
|
||||
?>
|
||||
<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
|
||||
<?php }
|
||||
|
||||
if ( $is_trash && current_user_can('edit_others_posts') ) { ?>
|
||||
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -342,20 +275,10 @@ if ( $page_links )
|
||||
<div class="alignleft actions">
|
||||
<select name="action2">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<?php if ( $is_trash ) { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="edit"><?php _e('Edit'); ?></option>
|
||||
<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } ?>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
<?php if ( $is_trash && current_user_can('edit_others_posts') ) { ?>
|
||||
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
<br class="clear" />
|
||||
</div>
|
||||
<br class="clear" />
|
||||
@@ -363,12 +286,7 @@ if ( $page_links )
|
||||
|
||||
<?php } else { // have_posts() ?>
|
||||
<div class="clear"></div>
|
||||
<p><?php
|
||||
if ( isset($_GET['post_status']) && 'trash' == $_GET['post_status'] )
|
||||
_e('No posts found in the trash');
|
||||
else
|
||||
_e('No posts found');
|
||||
?></p>
|
||||
<p><?php _e('No posts found') ?></p>
|
||||
<?php } ?>
|
||||
|
||||
</form>
|
||||
@@ -376,7 +294,9 @@ else
|
||||
<?php inline_edit_row( 'post' ); ?>
|
||||
|
||||
<div id="ajax-response"></div>
|
||||
|
||||
<br class="clear" />
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.4 KiB |
@@ -197,7 +197,6 @@ class Blogger_Import {
|
||||
$loadauth = esc_js( __('Preparing author mapping form...') );
|
||||
$authhead = esc_js( __('Final Step: Author Mapping') );
|
||||
$nothing = esc_js( __('Nothing was imported. Had you already imported this blog?') );
|
||||
$stopping = ''; //Missing String used below.
|
||||
$title = __('Blogger Blogs');
|
||||
$name = __('Blog Name');
|
||||
$url = __('Blog URL');
|
||||
@@ -530,10 +529,6 @@ class Blogger_Import {
|
||||
return preg_replace( '|\s+|', ' ', $string );
|
||||
}
|
||||
|
||||
function _normalize_tag( $matches ) {
|
||||
return '<' . strtolower( $matches[1] );
|
||||
}
|
||||
|
||||
function import_post( $entry ) {
|
||||
global $importing_blog;
|
||||
|
||||
@@ -556,7 +551,7 @@ class Blogger_Import {
|
||||
$post_status = isset( $entry->draft ) ? 'draft' : 'publish';
|
||||
|
||||
// Clean up content
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
|
||||
$post_content = str_replace('<br>', '<br />', $post_content);
|
||||
$post_content = str_replace('<hr>', '<hr />', $post_content);
|
||||
|
||||
@@ -609,7 +604,7 @@ class Blogger_Import {
|
||||
$comment_content = addslashes( $this->no_apos( @html_entity_decode( $entry->content, ENT_COMPAT, get_option('blog_charset') ) ) );
|
||||
|
||||
// Clean up content
|
||||
$comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content);
|
||||
$comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
|
||||
$comment_content = str_replace('<br>', '<br />', $comment_content);
|
||||
$comment_content = str_replace('<hr>', '<hr />', $comment_content);
|
||||
|
||||
@@ -622,7 +617,6 @@ class Blogger_Import {
|
||||
} else {
|
||||
$comment = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_date', 'comment_content');
|
||||
|
||||
$comment = wp_filter_comment($comment);
|
||||
$comment_id = wp_insert_comment($comment);
|
||||
|
||||
$this->blogs[$importing_blog]['comments'][$entry->old_permalink] = $comment_id;
|
||||
@@ -911,19 +905,10 @@ class AtomParser {
|
||||
var $entry;
|
||||
|
||||
function AtomParser() {
|
||||
|
||||
$this->entry = new AtomEntry();
|
||||
}
|
||||
|
||||
function _map_attrs_func( $k, $v ) {
|
||||
return "$k=\"$v\"";
|
||||
}
|
||||
|
||||
function _map_xmlns_func( $p, $n ) {
|
||||
$xd = "xmlns";
|
||||
if ( strlen( $n[0] ) > 0 )
|
||||
$xd .= ":{$n[0]}";
|
||||
|
||||
return "{$xd}=\"{$n[1]}\"";
|
||||
$this->map_attrs_func = create_function('$k,$v', 'return "$k=\"$v\"";');
|
||||
$this->map_xmlns_func = create_function('$p,$n', '$xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";');
|
||||
}
|
||||
|
||||
function parse($xml) {
|
||||
@@ -965,12 +950,12 @@ class AtomParser {
|
||||
foreach($attrs as $key => $value) {
|
||||
$attrs_prefix[$this->ns_to_prefix($key)] = $this->xml_escape($value);
|
||||
}
|
||||
$attrs_str = join(' ', array_map( array( &$this, '_map_attrs_func' ), array_keys($attrs_prefix), array_values($attrs_prefix)));
|
||||
$attrs_str = join(' ', array_map($this->map_attrs_func, array_keys($attrs_prefix), array_values($attrs_prefix)));
|
||||
if(strlen($attrs_str) > 0) {
|
||||
$attrs_str = " " . $attrs_str;
|
||||
}
|
||||
|
||||
$xmlns_str = join(' ', array_map( array( &$this, '_map_xmlns_func' ), array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0])));
|
||||
$xmlns_str = join(' ', array_map($this->map_xmlns_func, array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0])));
|
||||
if(strlen($xmlns_str) > 0) {
|
||||
$xmlns_str = " " . $xmlns_str;
|
||||
}
|
||||
|
||||
@@ -42,10 +42,6 @@ class BW_Import {
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function _normalize_tag( $matches ) {
|
||||
return '<' . strtolower( $matches[1] );
|
||||
}
|
||||
|
||||
function import_posts() {
|
||||
global $wpdb, $current_user;
|
||||
|
||||
@@ -93,7 +89,7 @@ class BW_Import {
|
||||
}
|
||||
|
||||
// Clean up content
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
|
||||
$post_content = str_replace('<br>', '<br />', $post_content);
|
||||
$post_content = str_replace('<hr>', '<hr />', $post_content);
|
||||
$post_content = $wpdb->escape($post_content);
|
||||
@@ -133,7 +129,7 @@ class BW_Import {
|
||||
$comment_content = $this->unhtmlentities($comment_content);
|
||||
|
||||
// Clean up content
|
||||
$comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content);
|
||||
$comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
|
||||
$comment_content = str_replace('<br>', '<br />', $comment_content);
|
||||
$comment_content = str_replace('<hr>', '<hr />', $comment_content);
|
||||
$comment_content = $wpdb->escape($comment_content);
|
||||
|
||||
130
wp-admin/import/btt.php
Normal file
130
wp-admin/import/btt.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
/**
|
||||
* BunnyTags Plugin Tag Importer
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Importer
|
||||
*/
|
||||
|
||||
/**
|
||||
* BunnyTags Plugin tag converter
|
||||
*
|
||||
* This will process the BunnyTags plugin tags and convert them to the WordPress
|
||||
* 2.3 taxonomy.
|
||||
*
|
||||
* @since unknown
|
||||
*/
|
||||
class BunnyTags_Import {
|
||||
|
||||
function header() {
|
||||
echo '<div class="wrap">';
|
||||
screen_icon();
|
||||
echo '<h2>'.__('Import Bunny’s Technorati Tags').'</h2>';
|
||||
echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'<br /><br /></p>';
|
||||
}
|
||||
|
||||
function footer() {
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function greet() {
|
||||
echo '<div class="narrow">';
|
||||
echo '<p>'.__('Howdy! This imports tags from Bunny’s Technorati Tags into WordPress tags.').'</p>';
|
||||
echo '<p>'.__('This is suitable for Bunny’s Technorati Tags version 0.6.').'</p>';
|
||||
echo '<p><strong>'.__('All existing Bunny’s Technorati Tags will be removed after import.').'</strong></p>';
|
||||
echo '<p><strong>'.__('Don’t be stupid - backup your database before proceeding!').'</strong></p>';
|
||||
echo '<form action="admin.php?import=btt&step=1" method="post">';
|
||||
wp_nonce_field('import-btt');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Import Tags').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function dispatch() {
|
||||
if ( empty($_GET['step']) )
|
||||
$step = 0;
|
||||
else
|
||||
$step = absint($_GET['step']);
|
||||
|
||||
// load the header
|
||||
$this->header();
|
||||
|
||||
switch ( $step ) {
|
||||
case 0 :
|
||||
$this->greet();
|
||||
break;
|
||||
case 1 :
|
||||
check_admin_referer('import-btt');
|
||||
$this->check_post_keyword( true );
|
||||
break;
|
||||
case 2 :
|
||||
check_admin_referer('import-btt');
|
||||
$this->check_post_keyword( false );
|
||||
break;
|
||||
case 3:
|
||||
$this->done();
|
||||
break;
|
||||
}
|
||||
|
||||
// load the footer
|
||||
$this->footer();
|
||||
}
|
||||
|
||||
function check_post_keyword($precheck = true) {
|
||||
global $wpdb;
|
||||
|
||||
echo '<div class="narrow">';
|
||||
echo '<p><h3>'.__('Reading Bunny’s Technorati Tags…').'</h3></p>';
|
||||
|
||||
// import Bunny's Keywords tags
|
||||
$metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'tags'");
|
||||
if ( !is_array($metakeys)) {
|
||||
echo '<p>' . __('No Tags Found!') . '</p>';
|
||||
return false;
|
||||
} else {
|
||||
$count = count($metakeys);
|
||||
echo '<p>' . sprintf( _n('Done! <strong>%s</strong> post with tags were read.', 'Done! <strong>%s</strong> posts with tags were read.', $count), $count ) . '<br /></p>';
|
||||
echo '<ul>';
|
||||
foreach ( $metakeys as $post_meta ) {
|
||||
if ( $post_meta->meta_value != '' ) {
|
||||
$post_keys = explode(' ', $post_meta->meta_value);
|
||||
foreach ( $post_keys as $keyword ) {
|
||||
$keyword = addslashes(trim(str_replace('+',' ',$keyword)));
|
||||
if ( '' != $keyword ) {
|
||||
echo '<li>' . $post_meta->post_id . ' - ' . $keyword . '</li>';
|
||||
if ( !$precheck )
|
||||
wp_add_post_tags($post_meta->post_id, $keyword);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( !$precheck )
|
||||
delete_post_meta($post_meta->post_id, 'tags');
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
echo '<form action="admin.php?import=btt&step='.($precheck? 2:3).'" method="post">';
|
||||
wp_nonce_field('import-btt');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Next').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function done() {
|
||||
echo '<div class="narrow">';
|
||||
echo '<p><h3>'.__('Import Complete!').'</h3></p>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function BunnyTags_Import() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// create the import object
|
||||
$btt_import = new BunnyTags_Import();
|
||||
|
||||
// add it to the import page!
|
||||
register_importer('btt', 'Bunny’s Technorati Tags', __('Import Bunny’s Technorati Tags into WordPress tags.'), array($btt_import, 'dispatch'));
|
||||
|
||||
?>
|
||||
@@ -413,7 +413,11 @@ class Dotclear_Import {
|
||||
$web = "http://".$wpdb->escape($comment_site);
|
||||
$message = $wpdb->escape(textconv ($comment_content));
|
||||
|
||||
$comment = array(
|
||||
if($cinfo = comment_exists($name, $comment_dt))
|
||||
{
|
||||
// Update comments
|
||||
$ret_id = wp_update_comment(array(
|
||||
'comment_ID' => $cinfo,
|
||||
'comment_post_ID' => $comment_post_ID,
|
||||
'comment_author' => $name,
|
||||
'comment_author_email' => $email,
|
||||
@@ -422,16 +426,23 @@ class Dotclear_Import {
|
||||
'comment_date' => $comment_dt,
|
||||
'comment_date_gmt' => $comment_dt,
|
||||
'comment_content' => $message,
|
||||
'comment_approved' => $comment_approved);
|
||||
$comment = wp_filter_comment($comment);
|
||||
|
||||
if ( $cinfo = comment_exists($name, $comment_dt) ) {
|
||||
// Update comments
|
||||
$comment['comment_ID'] = $cinfo;
|
||||
$ret_id = wp_update_comment($comment);
|
||||
} else {
|
||||
'comment_approved' => $comment_approved)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Insert comments
|
||||
$ret_id = wp_insert_comment($comment);
|
||||
$ret_id = wp_insert_comment(array(
|
||||
'comment_post_ID' => $comment_post_ID,
|
||||
'comment_author' => $name,
|
||||
'comment_author_email' => $email,
|
||||
'comment_author_url' => $web,
|
||||
'comment_author_IP' => $comment_ip,
|
||||
'comment_date' => $comment_dt,
|
||||
'comment_date_gmt' => $comment_dt,
|
||||
'comment_content' => $message,
|
||||
'comment_approved' => $comment_approved)
|
||||
);
|
||||
}
|
||||
$dccm2wpcm[$comment_ID] = $ret_id;
|
||||
}
|
||||
@@ -593,7 +604,7 @@ class Dotclear_Import {
|
||||
{
|
||||
echo '<p>'.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from DotClear, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'</p>';
|
||||
echo '<h3>'.__('Users').'</h3>';
|
||||
echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in DotClear, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and DotClear uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Log in</a> and change it.'), '/wp-login.php').'</p>';
|
||||
echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in DotClear, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and DotClear uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Login</a> and change it.'), '/wp-login.php').'</p>';
|
||||
echo '<h3>'.__('Preserving Authors').'</h3>';
|
||||
echo '<p>'.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>';
|
||||
echo '<h3>'.__('Textile').'</h3>';
|
||||
@@ -605,7 +616,7 @@ class Dotclear_Import {
|
||||
echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums</a>').'</li>';
|
||||
echo '<li>'.__('<a href="http://codex.wordpress.org">The Codex (In other words, the WordPress Bible)</a>').'</li>';
|
||||
echo '</ul>';
|
||||
echo '<p>'.sprintf(__('That’s it! What are you waiting for? Go <a href="%1$s">log in</a>!'), '../wp-login.php').'</p>';
|
||||
echo '<p>'.sprintf(__('That’s it! What are you waiting for? Go <a href="%1$s">login</a>!'), '../wp-login.php').'</p>';
|
||||
}
|
||||
|
||||
function db_form()
|
||||
|
||||
@@ -63,7 +63,7 @@ class GM_Import {
|
||||
<tr>
|
||||
<td><label for="lastentry"><?php _e('Last entry’s number:') ?></label></td>
|
||||
<td><input type="text" name="lastentry" id="lastentry" value="00000001" /><br />
|
||||
<?php _e('This importer will search for files 00000001.cgi to 000-whatever.cgi,<br />so you need to enter the number of the last GM post here.<br />(if you don’t know that number, just log in to your FTP and look it out<br />in the entries’ folder)') ?></td>
|
||||
<?php _e('This importer will search for files 00000001.cgi to 000-whatever.cgi,<br />so you need to enter the number of the last GM post here.<br />(if you don’t know that number, just log into your FTP and look it out<br />in the entries’ folder)') ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="submit"><input type="submit" name="submit" class="button" value="<?php esc_attr_e('Start Importing') ?>" /></p>
|
||||
|
||||
192
wp-admin/import/jkw.php
Normal file
192
wp-admin/import/jkw.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
/**
|
||||
* Jeromes Keyword Plugin Importer
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Importer
|
||||
*/
|
||||
|
||||
/**
|
||||
* Jeromes Keyword Plugin Importer class
|
||||
*
|
||||
* Will convert Jeromes Keyword Plugin tags to WordPress taxonomy tags.
|
||||
*
|
||||
* @since 2.3
|
||||
*/
|
||||
class JeromesKeyword_Import {
|
||||
|
||||
function header() {
|
||||
echo '<div class="wrap">';
|
||||
screen_icon();
|
||||
echo '<h2>'.__('Import Jerome’s Keywords').'</h2>';
|
||||
echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'<br /><br /></p>';
|
||||
}
|
||||
|
||||
function footer() {
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function greet() {
|
||||
echo '<div class="narrow">';
|
||||
echo '<p>'.__('Howdy! This imports tags from Jerome’s Keywords into WordPress tags.').'</p>';
|
||||
echo '<p>'.__('This is suitable for Jerome’s Keywords version 1.x and 2.0a.').'</p>';
|
||||
echo '<p><strong>'.__('All existing Jerome’s Keywords will be removed after import.').'</strong></p>';
|
||||
echo '<p><strong>'.__('Don’t be stupid - backup your database before proceeding!').'</strong></p>';
|
||||
echo '<form action="admin.php?import=jkw&step=1" method="post">';
|
||||
wp_nonce_field('import-jkw');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Import Version 1.x').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '<form action="admin.php?import=jkw&step=3" method="post">';
|
||||
wp_nonce_field('import-jkw');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Import Version 2.0a').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function dispatch() {
|
||||
if ( empty($_GET['step']) )
|
||||
$step = 0;
|
||||
else
|
||||
$step = absint($_GET['step']);
|
||||
|
||||
// load the header
|
||||
$this->header();
|
||||
|
||||
switch ( $step ) {
|
||||
case 0 :
|
||||
$this->greet();
|
||||
break;
|
||||
case 1 :
|
||||
check_admin_referer('import-jkw');
|
||||
$this->check_V1_post_keyword( true );
|
||||
break;
|
||||
case 2 :
|
||||
check_admin_referer('import-jkw');
|
||||
$this->check_V1_post_keyword( false );
|
||||
break;
|
||||
case 3 :
|
||||
check_admin_referer('import-jkw');
|
||||
$this->check_V2_post_keyword( true );
|
||||
break;
|
||||
case 4 :
|
||||
check_admin_referer('import-jkw');
|
||||
$this->check_V2_post_keyword( false );
|
||||
break;
|
||||
case 5:
|
||||
check_admin_referer('import-jkw');
|
||||
$this->cleanup_V2_import();
|
||||
break;
|
||||
case 6:
|
||||
$this->done();
|
||||
break;
|
||||
}
|
||||
|
||||
// load the footer
|
||||
$this->footer();
|
||||
}
|
||||
|
||||
function check_V1_post_keyword($precheck = true) {
|
||||
global $wpdb;
|
||||
|
||||
echo '<div class="narrow">';
|
||||
echo '<p><h3>'.__('Reading Jerome’s Keywords Tags…').'</h3></p>';
|
||||
|
||||
// import Jerome's Keywords tags
|
||||
$metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'keywords'");
|
||||
if ( !is_array($metakeys)) {
|
||||
echo '<p>' . __('No Tags Found!') . '</p>';
|
||||
return false;
|
||||
} else {
|
||||
$count = count($metakeys);
|
||||
echo '<p>' . sprintf( _n('Done! <strong>%s</strong> post with tags were read.', 'Done! <strong>%s</strong> posts with tags were read.', $count), $count ) . '<br /></p>';
|
||||
echo '<ul>';
|
||||
foreach ( $metakeys as $post_meta ) {
|
||||
if ( $post_meta->meta_value != '' ) {
|
||||
$post_keys = explode(',', $post_meta->meta_value);
|
||||
foreach ( $post_keys as $keyword ) {
|
||||
$keyword = addslashes(trim($keyword));
|
||||
if ( '' != $keyword ) {
|
||||
echo '<li>' . $post_meta->post_id . ' - ' . $keyword . '</li>';
|
||||
if ( !$precheck )
|
||||
wp_add_post_tags($post_meta->post_id, $keyword);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( !$precheck )
|
||||
delete_post_meta($post_meta->post_id, 'keywords');
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
echo '<form action="admin.php?import=jkw&step='.($precheck? 2:6).'" method="post">';
|
||||
wp_nonce_field('import-jkw');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Next').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function check_V2_post_keyword($precheck = true) {
|
||||
global $wpdb;
|
||||
|
||||
echo '<div class="narrow">';
|
||||
echo '<p><h3>'.__('Reading Jerome’s Keywords Tags…').'</h3></p>';
|
||||
|
||||
// import Jerome's Keywords tags
|
||||
$tablename = $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1);
|
||||
$metakeys = $wpdb->get_results("SELECT post_id, tag_name FROM $tablename");
|
||||
if ( !is_array($metakeys) ) {
|
||||
echo '<p>' . __('No Tags Found!') . '</p>';
|
||||
return false;
|
||||
} else {
|
||||
$count = count($metakeys);
|
||||
echo '<p>' . sprintf( _n('Done! <strong>%s</strong> tag were read.', 'Done! <strong>%s</strong> tags were read.', $count), $count ) . '<br /></p>';
|
||||
echo '<ul>';
|
||||
foreach ( $metakeys as $post_meta ) {
|
||||
$keyword = addslashes(trim($post_meta->tag_name));
|
||||
if ( $keyword != '' ) {
|
||||
echo '<li>' . $post_meta->post_id . ' - ' . $keyword . '</li>';
|
||||
if ( !$precheck )
|
||||
wp_add_post_tags($post_meta->post_id, $keyword);
|
||||
}
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
echo '<form action="admin.php?import=jkw&step='.($precheck? 4:5).'" method="post">';
|
||||
wp_nonce_field('import-jkw');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Next').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function cleanup_V2_import() {
|
||||
global $wpdb;
|
||||
|
||||
/* options from V2.0a (jeromes-keywords.php) */
|
||||
$options = array('version', 'keywords_table', 'query_varname', 'template', 'meta_always_include', 'meta_includecats', 'meta_autoheader', 'search_strict', 'use_feed_cats', 'post_linkformat', 'post_tagseparator', 'post_includecats', 'post_notagstext', 'cloud_linkformat', 'cloud_tagseparator', 'cloud_includecats', 'cloud_sortorder', 'cloud_displaymax', 'cloud_displaymin', 'cloud_scalemax', 'cloud_scalemin');
|
||||
|
||||
$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1));
|
||||
|
||||
foreach ( $options as $o )
|
||||
delete_option('jkeywords_' . $o);
|
||||
|
||||
$this->done();
|
||||
}
|
||||
|
||||
function done() {
|
||||
echo '<div class="narrow">';
|
||||
echo '<p><h3>'.__('Import Complete!').'</h3></p>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function JeromesKeyword_Import() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// create the import object
|
||||
$jkw_import = new JeromesKeyword_Import();
|
||||
|
||||
// add it to the import page!
|
||||
register_importer('jkw', 'Jerome’s Keywords', __('Import Jerome’s Keywords into WordPress tags.'), array($jkw_import, 'dispatch'));
|
||||
|
||||
?>
|
||||
@@ -324,10 +324,6 @@ class LJ_API_Import {
|
||||
echo '</ol>';
|
||||
}
|
||||
|
||||
function _normalize_tag( $matches ) {
|
||||
return '<' . strtolower( $matches[1] );
|
||||
}
|
||||
|
||||
function import_post( $post ) {
|
||||
global $wpdb;
|
||||
|
||||
@@ -354,7 +350,7 @@ class LJ_API_Import {
|
||||
|
||||
// Clean up content
|
||||
$post_content = $post['event'];
|
||||
$post_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content );
|
||||
$post_content = preg_replace_callback( '|<(/?[A-Z]+)|', create_function( '$match', 'return "<" . strtolower( $match[1] );' ), $post_content );
|
||||
// XHTMLize some tags
|
||||
$post_content = str_replace( '<br>', '<br />', $post_content );
|
||||
$post_content = str_replace( '<hr>', '<hr />', $post_content );
|
||||
@@ -535,7 +531,6 @@ class LJ_API_Import {
|
||||
|
||||
// Parse this comment into an array and insert
|
||||
$comment = $this->parse_comment( $comment );
|
||||
$comment = wp_filter_comment( $comment );
|
||||
$id = wp_insert_comment( $comment );
|
||||
|
||||
// Clear cache
|
||||
@@ -586,7 +581,7 @@ class LJ_API_Import {
|
||||
$comment_content = wpautop( $comment_content );
|
||||
$comment_content = str_replace( '<br>', '<br />', $comment_content );
|
||||
$comment_content = str_replace( '<hr>', '<hr />', $comment_content );
|
||||
$comment_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content );
|
||||
$comment_content = preg_replace_callback( '|<(/?[A-Z]+)|', create_function( '$match', 'return "<" . strtolower( $match[1] );' ), $comment_content );
|
||||
$comment_content = $wpdb->escape( trim( $comment_content ) );
|
||||
|
||||
// Get and convert the date
|
||||
@@ -725,7 +720,7 @@ class LJ_API_Import {
|
||||
$this->protected_password = get_option( 'ljapi_protected_password' );
|
||||
}
|
||||
|
||||
// Log in to confirm the details are correct
|
||||
// Login to confirm the details are correct
|
||||
if ( empty( $this->username ) || empty( $this->password ) ) {
|
||||
?>
|
||||
<p><?php _e( 'Please enter your LiveJournal username <em>and</em> password so we can download your posts and comments.' ) ?></p>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Movable Type and TypePad Importer
|
||||
* Movable Type and Typepad Importer
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Importer
|
||||
*/
|
||||
|
||||
/**
|
||||
* Moveable Type and TypePad Importer class
|
||||
* Moveable Type and Typepad Importer class
|
||||
*
|
||||
* Upload your exported Movable Type or TypePad entries into WordPress.
|
||||
* Upload your exported Movable Type or Typepad entries into WordPress.
|
||||
*
|
||||
* @since unknown
|
||||
*/
|
||||
@@ -36,7 +36,7 @@ class MT_Import {
|
||||
$this->header();
|
||||
?>
|
||||
<div class="narrow">
|
||||
<p><?php _e('Howdy! We’re about to begin importing all of your Movable Type or TypePad entries into WordPress. To begin, either choose a file to upload and click “Upload file and import”, or use FTP to upload your MT export file as <code>mt-export.txt</code> in your <code>/wp-content/</code> directory and then click "Import mt-export.txt"'); ?></p>
|
||||
<p><?php _e('Howdy! We’re about to begin importing all of your Movable Type or Typepad entries into WordPress. To begin, either choose a file to upload and click “Upload file and import”, or use FTP to upload your MT export file as <code>mt-export.txt</code> in your <code>/wp-content/</code> directory and then click "Import mt-export.txt"'); ?></p>
|
||||
|
||||
<?php wp_import_upload_form( add_query_arg('step', 1) ); ?>
|
||||
<form method="post" action="<?php echo esc_attr(add_query_arg('step', 1)); ?>" class="import-upload-form">
|
||||
@@ -510,5 +510,5 @@ class MT_Import {
|
||||
|
||||
$mt_import = new MT_Import();
|
||||
|
||||
register_importer('mt', __('Movable Type and TypePad'), __('Import posts and comments from a Movable Type or TypePad blog.'), array ($mt_import, 'dispatch'));
|
||||
register_importer('mt', __('Movable Type and TypePad'), __('Import posts and comments from a Movable Type or Typepad blog.'), array ($mt_import, 'dispatch'));
|
||||
?>
|
||||
|
||||
@@ -43,10 +43,6 @@ class RSS_Import {
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function _normalize_tag( $matches ) {
|
||||
return '<' . strtolower( $matches[1] );
|
||||
}
|
||||
|
||||
function get_posts() {
|
||||
global $wpdb;
|
||||
|
||||
@@ -107,7 +103,7 @@ class RSS_Import {
|
||||
}
|
||||
|
||||
// Clean up content
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
|
||||
$post_content = str_replace('<br>', '<br />', $post_content);
|
||||
$post_content = str_replace('<hr>', '<hr />', $post_content);
|
||||
|
||||
|
||||
@@ -397,24 +397,33 @@ class Textpattern_Import {
|
||||
$web = $wpdb->escape($web);
|
||||
$message = $wpdb->escape($message);
|
||||
|
||||
$comment = array(
|
||||
'comment_post_ID' => $comment_post_ID,
|
||||
'comment_author' => $name,
|
||||
'comment_author_IP' => $ip,
|
||||
'comment_author_email' => $email,
|
||||
'comment_author_url' => $web,
|
||||
'comment_date' => $posted,
|
||||
'comment_content' => $message,
|
||||
'comment_approved' => $comment_approved);
|
||||
$comment = wp_filter_comment($comment);
|
||||
|
||||
if ( $cinfo = comment_exists($name, $posted) ) {
|
||||
if($cinfo = comment_exists($name, $posted))
|
||||
{
|
||||
// Update comments
|
||||
$comment['comment_ID'] = $cinfo;
|
||||
$ret_id = wp_update_comment($comment);
|
||||
} else {
|
||||
$ret_id = wp_update_comment(array(
|
||||
'comment_ID' => $cinfo,
|
||||
'comment_post_ID' => $comment_post_ID,
|
||||
'comment_author' => $name,
|
||||
'comment_author_email' => $email,
|
||||
'comment_author_url' => $web,
|
||||
'comment_date' => $posted,
|
||||
'comment_content' => $message,
|
||||
'comment_approved' => $comment_approved)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Insert comments
|
||||
$ret_id = wp_insert_comment($comment);
|
||||
$ret_id = wp_insert_comment(array(
|
||||
'comment_post_ID' => $comment_post_ID,
|
||||
'comment_author' => $name,
|
||||
'comment_author_email' => $email,
|
||||
'comment_author_url' => $web,
|
||||
'comment_author_IP' => $ip,
|
||||
'comment_date' => $posted,
|
||||
'comment_content' => $message,
|
||||
'comment_approved' => $comment_approved)
|
||||
);
|
||||
}
|
||||
$txpcm2wpcm[$comment_ID] = $ret_id;
|
||||
}
|
||||
@@ -573,7 +582,7 @@ class Textpattern_Import {
|
||||
{
|
||||
echo '<p>'.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from Textpattern, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'</p>';
|
||||
echo '<h3>'.__('Users').'</h3>';
|
||||
echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in Textpattern, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">log in</a> and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
|
||||
echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in Textpattern, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Login</a> and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
|
||||
echo '<h3>'.__('Preserving Authors').'</h3>';
|
||||
echo '<p>'.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>';
|
||||
echo '<h3>'.__('Textile').'</h3>';
|
||||
@@ -585,7 +594,7 @@ class Textpattern_Import {
|
||||
echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums</a>').'</li>';
|
||||
echo '<li>'.__('<a href="http://codex.wordpress.org">The Codex (In other words, the WordPress Bible)</a>').'</li>';
|
||||
echo '</ul>';
|
||||
echo '<p>'.sprintf(__('That’s it! What are you waiting for? Go <a href="%1$s">log in</a>!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
|
||||
echo '<p>'.sprintf(__('That’s it! What are you waiting for? Go <a href="%1$s">login</a>!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
|
||||
}
|
||||
|
||||
function db_form()
|
||||
|
||||
@@ -27,7 +27,6 @@ class WP_Import {
|
||||
var $author_ids = array ();
|
||||
var $tags = array ();
|
||||
var $categories = array ();
|
||||
var $terms = array ();
|
||||
|
||||
var $j = -1;
|
||||
var $fetch_attachments = false;
|
||||
@@ -123,11 +122,6 @@ class WP_Import {
|
||||
$this->tags[] = $tag[1];
|
||||
continue;
|
||||
}
|
||||
if ( false !== strpos($importline, '<wp:term>') ) {
|
||||
preg_match('|<wp:term>(.*?)</wp:term>|is', $importline, $term);
|
||||
$this->terms[] = $term[1];
|
||||
continue;
|
||||
}
|
||||
if ( false !== strpos($importline, '<item>') ) {
|
||||
$this->post = '';
|
||||
$doing_entry = true;
|
||||
@@ -204,6 +198,7 @@ class WP_Import {
|
||||
|
||||
function wp_authors_form() {
|
||||
?>
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php _e('Assign Authors'); ?></h2>
|
||||
<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.'); ?></p>
|
||||
<?php
|
||||
@@ -215,9 +210,7 @@ class WP_Import {
|
||||
$authors = $this->get_wp_authors();
|
||||
echo '<form action="?import=wordpress&step=2&id=' . $this->id . '" method="post">';
|
||||
wp_nonce_field('import-wordpress');
|
||||
?>
|
||||
<ol id="authors">
|
||||
<?php
|
||||
echo '<ol id="authors">';
|
||||
$j = -1;
|
||||
foreach ($authors as $author) {
|
||||
++ $j;
|
||||
@@ -229,6 +222,7 @@ class WP_Import {
|
||||
if ( $this->allow_fetch_attachments() ) {
|
||||
?>
|
||||
</ol>
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php _e('Import Attachments'); ?></h2>
|
||||
<p>
|
||||
<input type="checkbox" value="1" name="attachments" id="import-attachments" />
|
||||
@@ -343,43 +337,6 @@ class WP_Import {
|
||||
$tag_ID = wp_insert_term($tag_name, 'post_tag', $tagarr);
|
||||
}
|
||||
}
|
||||
|
||||
function process_terms() {
|
||||
global $wpdb, $wp_taxonomies;
|
||||
|
||||
$custom_taxonomies = $wp_taxonomies;
|
||||
// get rid of the standard taxonomies
|
||||
unset( $custom_taxonomies['category'] );
|
||||
unset( $custom_taxonomies['post_tag'] );
|
||||
unset( $custom_taxonomies['link_category'] );
|
||||
|
||||
$custom_taxonomies = array_keys( $custom_taxonomies );
|
||||
$current_terms = (array) get_terms( $custom_taxonomies, 'get=all' );
|
||||
$taxonomies = array();
|
||||
foreach ( $current_terms as $term ) {
|
||||
if ( isset( $_terms[$term->taxonomy] ) ) {
|
||||
$taxonomies[$term->taxonomy] = array_merge( $taxonomies[$term->taxonomy], array($term->name) );
|
||||
} else {
|
||||
$taxonomies[$term->taxonomy] = array($term->name);
|
||||
}
|
||||
}
|
||||
|
||||
while ( $c = array_shift($this->terms) ) {
|
||||
$term_name = trim($this->get_tag( $c, 'wp:term_name' ));
|
||||
$term_taxonomy = trim($this->get_tag( $c, 'wp:term_taxonomy' ));
|
||||
|
||||
// If the term exists in the taxonomy we leave it alone
|
||||
if ( isset($taxonomies[$term_taxonomy] ) && in_array( $term_name, $taxonomies[$term_taxonomy] ) )
|
||||
continue;
|
||||
|
||||
$slug = $this->get_tag( $c, 'wp:term_slug' );
|
||||
$description = $this->get_tag( $c, 'wp:term_description' );
|
||||
|
||||
$termarr = compact('slug', 'description');
|
||||
|
||||
$term_ID = wp_insert_term($term_name, $this->get_tag( $c, 'wp:term_taxonomy' ), $termarr);
|
||||
}
|
||||
}
|
||||
|
||||
function process_author($post) {
|
||||
$author = $this->get_tag( $post, 'dc:creator' );
|
||||
@@ -400,10 +357,6 @@ class WP_Import {
|
||||
echo '<h3>'.sprintf(__('All done.').' <a href="%s">'.__('Have fun!').'</a>', get_option('home')).'</h3>';
|
||||
}
|
||||
|
||||
function _normalize_tag( $matches ) {
|
||||
return '<' . strtolower( $matches[1] );
|
||||
}
|
||||
|
||||
function process_post($post) {
|
||||
global $wpdb;
|
||||
|
||||
@@ -425,17 +378,16 @@ class WP_Import {
|
||||
$menu_order = $this->get_tag( $post, 'wp:menu_order' );
|
||||
$post_type = $this->get_tag( $post, 'wp:post_type' );
|
||||
$post_password = $this->get_tag( $post, 'wp:post_password' );
|
||||
$is_sticky = $this->get_tag( $post, 'wp:is_sticky' );
|
||||
$guid = $this->get_tag( $post, 'guid' );
|
||||
$post_author = $this->get_tag( $post, 'dc:creator' );
|
||||
|
||||
$post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
|
||||
$post_excerpt = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_excerpt);
|
||||
$post_excerpt = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_excerpt);
|
||||
$post_excerpt = str_replace('<br>', '<br />', $post_excerpt);
|
||||
$post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt);
|
||||
|
||||
$post_content = $this->get_tag( $post, 'content:encoded' );
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
|
||||
$post_content = str_replace('<br>', '<br />', $post_content);
|
||||
$post_content = str_replace('<hr>', '<hr />', $post_content);
|
||||
|
||||
@@ -496,9 +448,6 @@ class WP_Import {
|
||||
else {
|
||||
printf(__('Importing post <em>%s</em>...'), stripslashes($post_title));
|
||||
$comment_post_ID = $post_id = wp_insert_post($postdata);
|
||||
if ( $post_id && $is_sticky == 1 )
|
||||
stick_post( $post_id );
|
||||
|
||||
}
|
||||
|
||||
if ( is_wp_error( $post_id ) )
|
||||
@@ -559,35 +508,25 @@ class WP_Import {
|
||||
preg_match_all('|<wp:comment>(.*?)</wp:comment>|is', $post, $comments);
|
||||
$comments = $comments[1];
|
||||
$num_comments = 0;
|
||||
$inserted_comments = array();
|
||||
if ( $comments) {
|
||||
foreach ($comments as $comment) {
|
||||
$comment_id = $this->get_tag( $comment, 'wp:comment_id');
|
||||
$newcomments[$comment_id]['comment_post_ID'] = $comment_post_ID;
|
||||
$newcomments[$comment_id]['comment_author'] = $this->get_tag( $comment, 'wp:comment_author');
|
||||
$newcomments[$comment_id]['comment_author_email'] = $this->get_tag( $comment, 'wp:comment_author_email');
|
||||
$newcomments[$comment_id]['comment_author_IP'] = $this->get_tag( $comment, 'wp:comment_author_IP');
|
||||
$newcomments[$comment_id]['comment_author_url'] = $this->get_tag( $comment, 'wp:comment_author_url');
|
||||
$newcomments[$comment_id]['comment_date'] = $this->get_tag( $comment, 'wp:comment_date');
|
||||
$newcomments[$comment_id]['comment_date_gmt'] = $this->get_tag( $comment, 'wp:comment_date_gmt');
|
||||
$newcomments[$comment_id]['comment_content'] = $this->get_tag( $comment, 'wp:comment_content');
|
||||
$newcomments[$comment_id]['comment_approved'] = $this->get_tag( $comment, 'wp:comment_approved');
|
||||
$newcomments[$comment_id]['comment_type'] = $this->get_tag( $comment, 'wp:comment_type');
|
||||
$newcomments[$comment_id]['comment_parent'] = $this->get_tag( $comment, 'wp:comment_parent');
|
||||
if ( $comments) { foreach ($comments as $comment) {
|
||||
$comment_author = $this->get_tag( $comment, 'wp:comment_author');
|
||||
$comment_author_email = $this->get_tag( $comment, 'wp:comment_author_email');
|
||||
$comment_author_IP = $this->get_tag( $comment, 'wp:comment_author_IP');
|
||||
$comment_author_url = $this->get_tag( $comment, 'wp:comment_author_url');
|
||||
$comment_date = $this->get_tag( $comment, 'wp:comment_date');
|
||||
$comment_date_gmt = $this->get_tag( $comment, 'wp:comment_date_gmt');
|
||||
$comment_content = $this->get_tag( $comment, 'wp:comment_content');
|
||||
$comment_approved = $this->get_tag( $comment, 'wp:comment_approved');
|
||||
$comment_type = $this->get_tag( $comment, 'wp:comment_type');
|
||||
$comment_parent = $this->get_tag( $comment, 'wp:comment_parent');
|
||||
|
||||
// if this is a new post we can skip the comment_exists() check
|
||||
if ( !$post_exists || !comment_exists($comment_author, $comment_date) ) {
|
||||
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_approved', 'comment_type', 'comment_parent');
|
||||
wp_insert_comment($commentdata);
|
||||
$num_comments++;
|
||||
}
|
||||
// Sort by comment ID, to make sure comment parents exist (if there at all)
|
||||
ksort($newcomments);
|
||||
foreach ($newcomments as $key => $comment) {
|
||||
// if this is a new post we can skip the comment_exists() check
|
||||
if ( !$post_exists || !comment_exists($comment['comment_author'], $comment['comment_date']) ) {
|
||||
if (isset($inserted_comments[$comment['comment_parent']]))
|
||||
$comment['comment_parent'] = $inserted_comments[$comment['comment_parent']];
|
||||
$comment = wp_filter_comment($comment);
|
||||
$inserted_comments[$key] = wp_insert_comment($comment);
|
||||
$num_comments++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
if ( $num_comments )
|
||||
printf(' '._n('(%s comment)', '(%s comments)', $num_comments), $num_comments);
|
||||
@@ -745,8 +684,8 @@ class WP_Import {
|
||||
}
|
||||
|
||||
function is_valid_meta_key($key) {
|
||||
// skip attachment metadata since we'll regenerate it from scratch
|
||||
if ( $key == '_wp_attached_file' || $key == '_wp_attachment_metadata' )
|
||||
// skip _wp_attached_file metadata since we'll regenerate it from scratch
|
||||
if ( $key == '_wp_attached_file' )
|
||||
return false;
|
||||
return $key;
|
||||
}
|
||||
@@ -801,7 +740,6 @@ class WP_Import {
|
||||
$this->get_entries();
|
||||
$this->process_categories();
|
||||
$this->process_tags();
|
||||
$this->process_terms();
|
||||
$result = $this->process_posts();
|
||||
wp_suspend_cache_invalidation(false);
|
||||
$this->backfill_parents();
|
||||
|
||||
@@ -278,10 +278,7 @@ class ftp_base {
|
||||
$dns=@gethostbyaddr($host);
|
||||
if(!$ip) $ip=$host;
|
||||
if(!$dns) $dns=$host;
|
||||
// Validate the IPAddress PHP4 returns -1 for invalid, PHP5 false
|
||||
// -1 === "255.255.255.255" which is the broadcast address which is also going to be invalid
|
||||
$ipaslong = ip2long($ip);
|
||||
if ( ($ipaslong == false) || ($ipaslong === -1) ) {
|
||||
if(ip2long($ip) === -1) {
|
||||
$this->SendMSG("Wrong host name/address \"".$host."\"");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -210,7 +210,7 @@ class WP_Filesystem_Base {
|
||||
return trailingslashit($base . $last_path);
|
||||
}
|
||||
if ( $loop )
|
||||
return false; //Prevent tihs function looping again.
|
||||
return false;//Prevent tihs function looping again.
|
||||
//As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups.
|
||||
return $this->search_for_folder($folder, '/', true);
|
||||
|
||||
@@ -242,7 +242,7 @@ class WP_Filesystem_Base {
|
||||
$info = 'd';
|
||||
elseif (($perms & 0x2000) == 0x2000) // Character special
|
||||
$info = 'c';
|
||||
elseif (($perms & 0x1000) == 0x1000) // FIFO pipe
|
||||
elseif (($perms & 0x1000) == 0x1000)// FIFO pipe
|
||||
$info = 'p';
|
||||
else // Unknown
|
||||
$info = 'u';
|
||||
|
||||
@@ -15,84 +15,38 @@
|
||||
* @uses WP_Filesystem_Base Extends class
|
||||
*/
|
||||
class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
var $permission = null;
|
||||
var $errors = null;
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param $arg mixed ingored argument
|
||||
*/
|
||||
function WP_Filesystem_Direct($arg) {
|
||||
$this->method = 'direct';
|
||||
$this->errors = new WP_Error();
|
||||
}
|
||||
/**
|
||||
* connect filesystem.
|
||||
*
|
||||
* @return bool Returns true on success or false on failure (always true for WP_Filesystem_Direct).
|
||||
*/
|
||||
function connect() {
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Reads entire file into a string
|
||||
*
|
||||
* @param $file string Name of the file to read.
|
||||
* @return string|bool The function returns the read data or false on failure.
|
||||
*/
|
||||
function setDefaultPermissions($perm) {
|
||||
$this->permission = $perm;
|
||||
}
|
||||
function get_contents($file) {
|
||||
return @file_get_contents($file);
|
||||
}
|
||||
/**
|
||||
* Reads entire file into an array
|
||||
*
|
||||
* @param $file string Path to the file.
|
||||
* @return array|bool the file contents in an array or false on failure.
|
||||
*/
|
||||
function get_contents_array($file) {
|
||||
return @file($file);
|
||||
}
|
||||
/**
|
||||
* Write a string to a file
|
||||
*
|
||||
* @param $file string Path to the file where to write the data.
|
||||
* @param $contents string The data to write.
|
||||
* @param $mode int (optional) The file permissions as octal number, usually 0644.
|
||||
* @param $type string (optional) Specifies additional type of access you require to the file.
|
||||
* @return bool False upon failure.
|
||||
*/
|
||||
function put_contents($file, $contents, $mode = false, $type = '') {
|
||||
if ( ! ($fp = @fopen($file, 'w' . $type)) )
|
||||
return false;
|
||||
@fwrite($fp, $contents);
|
||||
@fclose($fp);
|
||||
$this->chmod($file, $mode);
|
||||
$this->chmod($file,$mode);
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Gets the current working directory
|
||||
*
|
||||
* @return string|bool the current working directory on success, or false on failure.
|
||||
*/
|
||||
function cwd() {
|
||||
return @getcwd();
|
||||
}
|
||||
/**
|
||||
* Change directory
|
||||
*
|
||||
* @param $dir string The new current directory.
|
||||
* @return bool Returns true on success or false on failure.
|
||||
*/
|
||||
function chdir($dir) {
|
||||
return @chdir($dir);
|
||||
}
|
||||
/**
|
||||
* Changes file group
|
||||
*
|
||||
* @param $file string Path to the file.
|
||||
* @param $group mixed A group name or number.
|
||||
* @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False.
|
||||
* @return bool Returns true on success or false on failure.
|
||||
*/
|
||||
function chgrp($file, $group, $recursive = false) {
|
||||
if ( ! $this->exists($file) )
|
||||
return false;
|
||||
@@ -108,25 +62,19 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Changes filesystem permissions
|
||||
*
|
||||
* @param $file string Path to the file.
|
||||
* @param $mode int (optional) The permissions as octal number, usually 0644 for files, 0755 for dirs.
|
||||
* @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False.
|
||||
* @return bool Returns true on success or false on failure.
|
||||
*/
|
||||
function chmod($file, $mode = false, $recursive = false) {
|
||||
if ( ! $this->exists($file) )
|
||||
return false;
|
||||
|
||||
if ( ! $mode ) {
|
||||
if ( $this->is_file($file) )
|
||||
if ( $this->permission )
|
||||
$mode = $this->permission;
|
||||
elseif ( $this->is_file($file) )
|
||||
$mode = FS_CHMOD_FILE;
|
||||
elseif ( $this->is_dir($file) )
|
||||
$mode = FS_CHMOD_DIR;
|
||||
else
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $recursive )
|
||||
@@ -141,14 +89,6 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Changes file owner
|
||||
*
|
||||
* @param $file string Path to the file.
|
||||
* @param $owner mixed A user name or number.
|
||||
* @param $recursive bool (optional) If set True changes file owner recursivly. Defaults to False.
|
||||
* @return bool Returns true on success or false on failure.
|
||||
*/
|
||||
function chown($file, $owner, $recursive = false) {
|
||||
if ( ! $this->exists($file) )
|
||||
return false;
|
||||
@@ -158,17 +98,11 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
return @chown($file, $owner);
|
||||
//Is a directory, and we want recursive
|
||||
$filelist = $this->dirlist($file);
|
||||
foreach ($filelist as $filename) {
|
||||
foreach ($filelist as $filename){
|
||||
$this->chown($file . '/' . $filename, $owner, $recursive);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Gets file owner
|
||||
*
|
||||
* @param $file string Path to the file.
|
||||
* @return string Username of the user.
|
||||
*/
|
||||
function owner($file) {
|
||||
$owneruid = @fileowner($file);
|
||||
if ( ! $owneruid )
|
||||
@@ -178,14 +112,6 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
$ownerarray = posix_getpwuid($owneruid);
|
||||
return $ownerarray['name'];
|
||||
}
|
||||
/**
|
||||
* Gets file permissions
|
||||
*
|
||||
* FIXME does not handle errors in fileperms()
|
||||
*
|
||||
* @param $file string Path to the file.
|
||||
* @return string Mode of the file (last 4 digits).
|
||||
*/
|
||||
function getchmod($file) {
|
||||
return substr(decoct(@fileperms($file)),3);
|
||||
}
|
||||
@@ -207,7 +133,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
|
||||
function move($source, $destination, $overwrite = false) {
|
||||
//Possible to use rename()?
|
||||
if ( $this->copy($source, $destination, $overwrite) && $this->exists($destination) ) {
|
||||
if ( $this->copy($source, $destination, $overwrite) && $this->exists($destination) ){
|
||||
$this->delete($source);
|
||||
return true;
|
||||
} else {
|
||||
@@ -271,7 +197,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
return @filesize($file);
|
||||
}
|
||||
|
||||
function touch($file, $time = 0, $atime = 0) {
|
||||
function touch($file, $time = 0, $atime = 0){
|
||||
if ($time == 0)
|
||||
$time = time();
|
||||
if ($atime == 0)
|
||||
@@ -279,10 +205,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
return @touch($file, $time, $atime);
|
||||
}
|
||||
|
||||
function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
|
||||
if ( ! $chmod )
|
||||
$chmod = FS_CHMOD_DIR;
|
||||
|
||||
function mkdir($path, $chmod = false, $chown = false, $chgrp = false){
|
||||
if ( ! @mkdir($path) )
|
||||
return false;
|
||||
$this->chmod($path, $chmod);
|
||||
@@ -307,34 +230,29 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
return @rmdir($path);
|
||||
}
|
||||
|
||||
function dirlist($path, $include_hidden = true, $recursive = false) {
|
||||
function dirlist($path, $incdot = false, $recursive = false) {
|
||||
if ( $this->is_file($path) ) {
|
||||
$limit_file = basename($path);
|
||||
$limitFile = basename($path);
|
||||
$path = dirname($path);
|
||||
} else {
|
||||
$limit_file = false;
|
||||
$limitFile = false;
|
||||
}
|
||||
|
||||
if ( ! $this->is_dir($path) )
|
||||
return false;
|
||||
|
||||
$ret = array();
|
||||
$dir = @dir($path);
|
||||
if ( ! $dir )
|
||||
return false;
|
||||
|
||||
$ret = array();
|
||||
|
||||
while (false !== ($entry = $dir->read()) ) {
|
||||
$struc = array();
|
||||
$struc['name'] = $entry;
|
||||
|
||||
if ( '.' == $struc['name'] || '..' == $struc['name'] )
|
||||
continue; //Do not care about these folders.
|
||||
if ( '.' == $struc['name'][0] && !$incdot)
|
||||
continue;
|
||||
|
||||
if ( ! $include_hidden && '.' == $struc['name'][0] )
|
||||
continue;
|
||||
|
||||
if ( $limit_file && $struc['name'] != $limit_file)
|
||||
if ( $limitFile && $struc['name'] != $limitFile)
|
||||
continue;
|
||||
|
||||
$struc['perms'] = $this->gethchmod($path.'/'.$entry);
|
||||
@@ -350,7 +268,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
|
||||
if ( 'd' == $struc['type'] ) {
|
||||
if ( $recursive )
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
|
||||
else
|
||||
$struc['files'] = array();
|
||||
}
|
||||
|
||||
@@ -16,9 +16,12 @@
|
||||
*/
|
||||
class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
var $link;
|
||||
var $timeout = 5;
|
||||
var $errors = null;
|
||||
var $options = array();
|
||||
|
||||
var $permission = null;
|
||||
|
||||
function WP_Filesystem_FTPext($opt='') {
|
||||
$this->method = 'ftpext';
|
||||
$this->errors = new WP_Error();
|
||||
@@ -30,11 +33,6 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
// Set defaults:
|
||||
//This Class uses the timeout on a per-connection basis, Others use it on a per-action basis.
|
||||
|
||||
if ( ! defined('FS_TIMEOUT') )
|
||||
define('FS_TIMEOUT', 240);
|
||||
|
||||
if ( empty($opt['port']) )
|
||||
$this->options['port'] = 21;
|
||||
else
|
||||
@@ -66,9 +64,9 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
|
||||
function connect() {
|
||||
if ( isset($this->options['ssl']) && $this->options['ssl'] && function_exists('ftp_ssl_connect') )
|
||||
$this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT);
|
||||
$this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], $this->timeout);
|
||||
else
|
||||
$this->link = @ftp_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT);
|
||||
$this->link = @ftp_connect($this->options['hostname'], $this->options['port'], $this->timeout);
|
||||
|
||||
if ( ! $this->link ) {
|
||||
$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
|
||||
@@ -82,21 +80,23 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
|
||||
//Set the Connection to use Passive FTP
|
||||
@ftp_pasv( $this->link, true );
|
||||
if ( @ftp_get_option($this->link, FTP_TIMEOUT_SEC) < FS_TIMEOUT )
|
||||
@ftp_set_option($this->link, FTP_TIMEOUT_SEC, FS_TIMEOUT);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function get_contents($file, $type = '', $resumepos = 0 ) {
|
||||
if ( empty($type) )
|
||||
function setDefaultPermissions($perm) {
|
||||
$this->permission = $perm;
|
||||
}
|
||||
|
||||
function get_contents($file, $type = '', $resumepos = 0 ){
|
||||
if( empty($type) )
|
||||
$type = FTP_BINARY;
|
||||
|
||||
$temp = tmpfile();
|
||||
if ( ! $temp )
|
||||
return false;
|
||||
|
||||
if ( ! @ftp_fget($this->link, $temp, $file, $type, $resumepos) )
|
||||
if( ! @ftp_fget($this->link, $temp, $file, $type, $resumepos) )
|
||||
return false;
|
||||
|
||||
fseek($temp, 0); //Skip back to the start of the file being written to
|
||||
@@ -112,7 +112,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
return explode("\n", $this->get_contents($file));
|
||||
}
|
||||
function put_contents($file, $contents, $type = '' ) {
|
||||
if ( empty($type) )
|
||||
if( empty($type) )
|
||||
$type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII;
|
||||
|
||||
$temp = tmpfile();
|
||||
@@ -129,29 +129,23 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
}
|
||||
function cwd() {
|
||||
$cwd = @ftp_pwd($this->link);
|
||||
if ( $cwd )
|
||||
if( $cwd )
|
||||
$cwd = trailingslashit($cwd);
|
||||
return $cwd;
|
||||
}
|
||||
function chdir($dir) {
|
||||
return @ftp_chdir($this->link, $dir);
|
||||
return @ftp_chdir($dir);
|
||||
}
|
||||
function chgrp($file, $group, $recursive = false ) {
|
||||
return false;
|
||||
}
|
||||
function chmod($file, $mode = false, $recursive = false) {
|
||||
if( ! $mode )
|
||||
$mode = $this->permission;
|
||||
if( ! $mode )
|
||||
return false;
|
||||
if ( ! $this->exists($file) && ! $this->is_dir($file) )
|
||||
return false;
|
||||
|
||||
if ( ! $mode ) {
|
||||
if ( $this->is_file($file) )
|
||||
$mode = FS_CHMOD_FILE;
|
||||
elseif ( $this->is_dir($file) )
|
||||
$mode = FS_CHMOD_DIR;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $recursive || ! $this->is_dir($file) ) {
|
||||
if ( ! function_exists('ftp_chmod') )
|
||||
return @ftp_site($this->link, sprintf('CHMOD %o %s', $mode, $file));
|
||||
@@ -159,7 +153,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
}
|
||||
//Is a directory, and we want recursive
|
||||
$filelist = $this->dirlist($file);
|
||||
foreach ( $filelist as $filename ) {
|
||||
foreach($filelist as $filename){
|
||||
$this->chmod($file . '/' . $filename, $mode, $recursive);
|
||||
}
|
||||
return true;
|
||||
@@ -180,10 +174,10 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
return $dir[$file]['group'];
|
||||
}
|
||||
function copy($source, $destination, $overwrite = false ) {
|
||||
if ( ! $overwrite && $this->exists($destination) )
|
||||
if( ! $overwrite && $this->exists($destination) )
|
||||
return false;
|
||||
$content = $this->get_contents($source);
|
||||
if ( false === $content)
|
||||
if( false === $content)
|
||||
return false;
|
||||
return $this->put_contents($destination, $content);
|
||||
}
|
||||
@@ -207,7 +201,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function exists($file) {
|
||||
$list = @ftp_nlist($this->link, $file);
|
||||
$list = @ftp_rawlist($this->link, $file, false);
|
||||
return !empty($list); //empty list = no file, so invert.
|
||||
}
|
||||
function is_file($file) {
|
||||
@@ -216,7 +210,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
function is_dir($path) {
|
||||
$cwd = $this->cwd();
|
||||
$result = @ftp_chdir($this->link, trailingslashit($path) );
|
||||
if ( $result && $path == $this->cwd() || $this->cwd() != $cwd ) {
|
||||
if( $result && $path == $this->cwd() || $this->cwd() != $cwd ) {
|
||||
@ftp_chdir($this->link, $cwd);
|
||||
return true;
|
||||
}
|
||||
@@ -243,14 +237,13 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
return false;
|
||||
}
|
||||
function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
|
||||
if ( !ftp_mkdir($this->link, $path) )
|
||||
if( !ftp_mkdir($this->link, $path) )
|
||||
return false;
|
||||
if ( ! $chmod )
|
||||
$chmod = FS_CHMOD_DIR;
|
||||
$this->chmod($path, $chmod);
|
||||
if ( $chown )
|
||||
if( $chmod )
|
||||
$this->chmod($path, $chmod);
|
||||
if( $chown )
|
||||
$this->chown($path, $chown);
|
||||
if ( $chgrp )
|
||||
if( $chgrp )
|
||||
$this->chgrp($path, $chgrp);
|
||||
return true;
|
||||
}
|
||||
@@ -263,9 +256,9 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
if ( is_null($is_windows) )
|
||||
$is_windows = strpos( strtolower(ftp_systype($this->link)), 'win') !== false;
|
||||
|
||||
if ( $is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/", $line, $lucifer) ) {
|
||||
if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/", $line, $lucifer)) {
|
||||
$b = array();
|
||||
if ( $lucifer[3] < 70 ) { $lucifer[3] +=2000; } else { $lucifer[3] += 1900; } // 4digit year fix
|
||||
if ($lucifer[3]<70) { $lucifer[3] +=2000; } else { $lucifer[3]+=1900; } // 4digit year fix
|
||||
$b['isdir'] = ($lucifer[7]=="<DIR>");
|
||||
if ( $b['isdir'] )
|
||||
$b['type'] = 'd';
|
||||
@@ -323,12 +316,12 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
return $b;
|
||||
}
|
||||
|
||||
function dirlist($path = '.', $include_hidden = true, $recursive = false) {
|
||||
if ( $this->is_file($path) ) {
|
||||
$limit_file = basename($path);
|
||||
function dirlist($path = '.', $incdot = false, $recursive = false) {
|
||||
if( $this->is_file($path) ) {
|
||||
$limitFile = basename($path);
|
||||
$path = dirname($path) . '/';
|
||||
} else {
|
||||
$limit_file = false;
|
||||
$limitFile = false;
|
||||
}
|
||||
|
||||
$list = @ftp_rawlist($this->link, '-a ' . $path, false);
|
||||
@@ -342,13 +335,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
if ( empty($entry) )
|
||||
continue;
|
||||
|
||||
if ( '.' == $entry['name'] || '..' == $entry['name'] )
|
||||
continue;
|
||||
|
||||
if ( ! $include_hidden && '.' == $entry['name'][0] )
|
||||
continue;
|
||||
|
||||
if ( $limit_file && $entry['name'] != $limit_file)
|
||||
if ( '.' == $entry["name"] || '..' == $entry["name"] )
|
||||
continue;
|
||||
|
||||
$dirlist[ $entry['name'] ] = $entry;
|
||||
@@ -356,23 +343,34 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
|
||||
if ( ! $dirlist )
|
||||
return false;
|
||||
if ( empty($dirlist) )
|
||||
return array();
|
||||
|
||||
$ret = array();
|
||||
foreach ( (array)$dirlist as $struc ) {
|
||||
if ( 'd' == $struc['type'] ) {
|
||||
if ( $recursive )
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
|
||||
else
|
||||
$struc['files'] = array();
|
||||
}
|
||||
foreach ( $dirlist as $struc ) {
|
||||
|
||||
$ret[ $struc['name'] ] = $struc;
|
||||
if ( 'd' == $struc['type'] ) {
|
||||
$struc['files'] = array();
|
||||
|
||||
if ( $incdot ){
|
||||
//We're including the doted starts
|
||||
if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
|
||||
if ($recursive)
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
|
||||
}
|
||||
} else { //No dots
|
||||
if ($recursive)
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
|
||||
}
|
||||
}
|
||||
//File
|
||||
$ret[$struc['name']] = $struc;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
if ( $this->link )
|
||||
function __destruct(){
|
||||
if( $this->link )
|
||||
ftp_close($this->link);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,15 +16,18 @@
|
||||
*/
|
||||
class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
var $ftp = false;
|
||||
var $timeout = 5;
|
||||
var $errors = null;
|
||||
var $options = array();
|
||||
|
||||
var $permission = null;
|
||||
|
||||
function WP_Filesystem_ftpsockets($opt = '') {
|
||||
$this->method = 'ftpsockets';
|
||||
$this->errors = new WP_Error();
|
||||
|
||||
//Check if possible to use ftp functions.
|
||||
if ( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' )
|
||||
if( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' )
|
||||
return false;
|
||||
$this->ftp = new ftp();
|
||||
|
||||
@@ -58,13 +61,12 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
if ( ! $this->ftp )
|
||||
return false;
|
||||
|
||||
$this->ftp->setTimeout(FS_CONNECT_TIMEOUT);
|
||||
//$this->ftp->Verbose = true;
|
||||
|
||||
if ( ! $this->ftp->SetServer($this->options['hostname'], $this->options['port']) ) {
|
||||
$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $this->ftp->connect() ) {
|
||||
$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
|
||||
return false;
|
||||
@@ -77,15 +79,18 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
|
||||
$this->ftp->SetType(FTP_AUTOASCII);
|
||||
$this->ftp->Passive(true);
|
||||
$this->ftp->setTimeout(FS_TIMEOUT);
|
||||
return true;
|
||||
}
|
||||
|
||||
function setDefaultPermissions($perm) {
|
||||
$this->permission = $perm;
|
||||
}
|
||||
|
||||
function get_contents($file, $type = '', $resumepos = 0) {
|
||||
if ( ! $this->exists($file) )
|
||||
if( ! $this->exists($file) )
|
||||
return false;
|
||||
|
||||
if ( empty($type) )
|
||||
if( empty($type) )
|
||||
$type = FTP_AUTOASCII;
|
||||
$this->ftp->SetType($type);
|
||||
|
||||
@@ -116,13 +121,13 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function put_contents($file, $contents, $type = '' ) {
|
||||
if ( empty($type) )
|
||||
if( empty($type) )
|
||||
$type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII;
|
||||
|
||||
$this->ftp->SetType($type);
|
||||
|
||||
$temp = wp_tempnam( $file );
|
||||
if ( ! $temphandle = fopen($temp, 'w+') ) {
|
||||
if ( ! $temphandle = fopen($temp, 'w+') ){
|
||||
unlink($temp);
|
||||
return false;
|
||||
}
|
||||
@@ -139,7 +144,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
|
||||
function cwd() {
|
||||
$cwd = $this->ftp->pwd();
|
||||
if ( $cwd )
|
||||
if( $cwd )
|
||||
$cwd = trailingslashit($cwd);
|
||||
return $cwd;
|
||||
}
|
||||
@@ -153,25 +158,20 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function chmod($file, $mode = false, $recursive = false ) {
|
||||
|
||||
if ( ! $mode ) {
|
||||
if ( $this->is_file($file) )
|
||||
$mode = FS_CHMOD_FILE;
|
||||
elseif ( $this->is_dir($file) )
|
||||
$mode = FS_CHMOD_DIR;
|
||||
else
|
||||
return false;
|
||||
if( ! $mode )
|
||||
$mode = $this->permission;
|
||||
if( ! $mode )
|
||||
return false;
|
||||
//if( ! $this->exists($file) )
|
||||
// return false;
|
||||
if( ! $recursive || ! $this->is_dir($file) ) {
|
||||
return $this->ftp->chmod($file,$mode);
|
||||
}
|
||||
|
||||
if ( ! $recursive || ! $this->is_dir($file) ) {
|
||||
return $this->ftp->chmod($file, $mode);
|
||||
}
|
||||
|
||||
//Is a directory, and we want recursive
|
||||
$filelist = $this->dirlist($file);
|
||||
foreach ( $filelist as $filename )
|
||||
foreach($filelist as $filename){
|
||||
$this->chmod($file . '/' . $filename, $mode, $recursive);
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function copy($source, $destination, $overwrite = false ) {
|
||||
if ( ! $overwrite && $this->exists($destination) )
|
||||
if( ! $overwrite && $this->exists($destination) )
|
||||
return false;
|
||||
|
||||
$content = $this->get_contents($source);
|
||||
@@ -264,57 +264,57 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
|
||||
if ( ! $this->ftp->mkdir($path) )
|
||||
if( ! $this->ftp->mkdir($path) )
|
||||
return false;
|
||||
if ( ! $chmod )
|
||||
$chmod = FS_CHMOD_DIR;
|
||||
$this->chmod($path, $chmod);
|
||||
if ( $chown )
|
||||
if( $chmod )
|
||||
$this->chmod($path, $chmod);
|
||||
if( $chown )
|
||||
$this->chown($path, $chown);
|
||||
if ( $chgrp )
|
||||
if( $chgrp )
|
||||
$this->chgrp($path, $chgrp);
|
||||
return true;
|
||||
}
|
||||
|
||||
function rmdir($path, $recursive = false ) {
|
||||
if ( ! $recursive )
|
||||
if( ! $recursive )
|
||||
return $this->ftp->rmdir($path);
|
||||
|
||||
return $this->ftp->mdel($path);
|
||||
}
|
||||
|
||||
function dirlist($path = '.', $include_hidden = true, $recursive = false ) {
|
||||
if ( $this->is_file($path) ) {
|
||||
$limit_file = basename($path);
|
||||
function dirlist($path = '.', $incdot = false, $recursive = false ) {
|
||||
if( $this->is_file($path) ) {
|
||||
$limitFile = basename($path);
|
||||
$path = dirname($path) . '/';
|
||||
} else {
|
||||
$limit_file = false;
|
||||
$limitFile = false;
|
||||
}
|
||||
|
||||
$list = $this->ftp->dirlist($path);
|
||||
if ( ! $list )
|
||||
if( ! $list )
|
||||
return false;
|
||||
if( empty($list) )
|
||||
return array();
|
||||
|
||||
$ret = array();
|
||||
foreach ( $list as $struc ) {
|
||||
|
||||
if ( '.' == $struc['name'] || '..' == $struc['name'] )
|
||||
continue;
|
||||
|
||||
if ( ! $include_hidden && '.' == $struc['name'][0] )
|
||||
continue;
|
||||
|
||||
if ( $limit_file && $struc['name'] != $limit_file )
|
||||
continue;
|
||||
|
||||
if ( 'd' == $struc['type'] ) {
|
||||
if ( $recursive )
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
|
||||
else
|
||||
$struc['files'] = array();
|
||||
}
|
||||
$struc['files'] = array();
|
||||
|
||||
$ret[ $struc['name'] ] = $struc;
|
||||
if ( $incdot ){
|
||||
//We're including the doted starts
|
||||
if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
|
||||
if ($recursive)
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
|
||||
}
|
||||
} else { //No dots
|
||||
if ($recursive)
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
|
||||
}
|
||||
}
|
||||
//File
|
||||
$ret[$struc['name']] = $struc;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -45,9 +45,19 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
var $link = false;
|
||||
var $sftp_link = false;
|
||||
var $keys = false;
|
||||
/*
|
||||
* This is the timeout value for ssh results.
|
||||
* Slower servers might need this incressed, but this number otherwise should not change.
|
||||
*
|
||||
* @parm $timeout int
|
||||
*
|
||||
*/
|
||||
var $timeout = 15;
|
||||
var $errors = array();
|
||||
var $options = array();
|
||||
|
||||
var $permission = 0644;
|
||||
|
||||
function WP_Filesystem_SSH2($opt='') {
|
||||
$this->method = 'ssh2';
|
||||
$this->errors = new WP_Error();
|
||||
@@ -138,7 +148,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
$this->errors->add('command', sprintf(__('Unable to perform command: %s'), $command));
|
||||
} else {
|
||||
stream_set_blocking( $stream, true );
|
||||
stream_set_timeout( $stream, FS_TIMEOUT );
|
||||
stream_set_timeout( $stream, $this->timeout );
|
||||
$data = stream_get_contents( $stream );
|
||||
fclose( $stream );
|
||||
|
||||
@@ -150,6 +160,12 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
return false;
|
||||
}
|
||||
|
||||
function setDefaultPermissions($perm) {
|
||||
$this->debug("setDefaultPermissions();");
|
||||
if ( $perm )
|
||||
$this->permission = $perm;
|
||||
}
|
||||
|
||||
function get_contents($file, $type = '', $resumepos = 0 ) {
|
||||
$file = ltrim($file, '/');
|
||||
return file_get_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file);
|
||||
@@ -162,7 +178,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
|
||||
function put_contents($file, $contents, $type = '' ) {
|
||||
$file = ltrim($file, '/');
|
||||
return false !== file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents);
|
||||
return file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents);
|
||||
}
|
||||
|
||||
function cwd() {
|
||||
@@ -185,18 +201,12 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function chmod($file, $mode = false, $recursive = false) {
|
||||
if( ! $mode )
|
||||
$mode = $this->permission;
|
||||
if( ! $mode )
|
||||
return false;
|
||||
if ( ! $this->exists($file) )
|
||||
return false;
|
||||
|
||||
if ( ! $mode ) {
|
||||
if ( $this->is_file($file) )
|
||||
$mode = FS_CHMOD_FILE;
|
||||
elseif ( $this->is_dir($file) )
|
||||
$mode = FS_CHMOD_DIR;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $recursive || ! $this->is_dir($file) )
|
||||
return $this->run_command(sprintf('chmod %o %s', $mode, escapeshellarg($file)), true);
|
||||
return $this->run_command(sprintf('chmod -R %o %s', $mode, escapeshellarg($file)), true);
|
||||
@@ -305,10 +315,9 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
//Not implmented.
|
||||
}
|
||||
|
||||
function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
|
||||
function mkdir($path, $chmod = null, $chown = false, $chgrp = false) {
|
||||
$path = untrailingslashit($path);
|
||||
if ( ! $chmod )
|
||||
$chmod = FS_CHMOD_DIR;
|
||||
$chmod = !empty($chmod) ? $chmod : $this->permission;
|
||||
if ( ! ssh2_sftp_mkdir($this->sftp_link, $path, $chmod, true) )
|
||||
return false;
|
||||
if ( $chown )
|
||||
@@ -322,34 +331,29 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
return $this->delete($path, $recursive);
|
||||
}
|
||||
|
||||
function dirlist($path, $include_hidden = true, $recursive = false) {
|
||||
function dirlist($path, $incdot = false, $recursive = false) {
|
||||
if ( $this->is_file($path) ) {
|
||||
$limit_file = basename($path);
|
||||
$limitFile = basename($path);
|
||||
$path = dirname($path);
|
||||
} else {
|
||||
$limit_file = false;
|
||||
$limitFile = false;
|
||||
}
|
||||
|
||||
if ( ! $this->is_dir($path) )
|
||||
return false;
|
||||
|
||||
$ret = array();
|
||||
$dir = @dir('ssh2.sftp://' . $this->sftp_link .'/' . ltrim($path, '/') );
|
||||
|
||||
if ( ! $dir )
|
||||
return false;
|
||||
|
||||
while (false !== ($entry = $dir->read()) ) {
|
||||
$struc = array();
|
||||
$struc['name'] = $entry;
|
||||
|
||||
if ( '.' == $struc['name'] || '..' == $struc['name'] )
|
||||
continue; //Do not care about these folders.
|
||||
|
||||
if ( ! $include_hidden && '.' == $struc['name'][0] )
|
||||
if ( '.' == $struc['name'][0] && !$incdot)
|
||||
continue;
|
||||
|
||||
if ( $limit_file && $struc['name'] != $limit_file )
|
||||
if ( $limitFile && $struc['name'] != $limitFile)
|
||||
continue;
|
||||
|
||||
$struc['perms'] = $this->gethchmod($path.'/'.$entry);
|
||||
@@ -365,7 +369,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
|
||||
if ( 'd' == $struc['type'] ) {
|
||||
if ( $recursive )
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
|
||||
else
|
||||
$struc['files'] = array();
|
||||
}
|
||||
|
||||
@@ -81,28 +81,20 @@ class WP_Upgrader {
|
||||
return new WP_Error('fs_error', $this->strings['fs_error'], $wp_filesystem->errors);
|
||||
|
||||
foreach ( (array)$directories as $dir ) {
|
||||
switch ( $dir ) {
|
||||
case ABSPATH:
|
||||
if ( ! $wp_filesystem->abspath() )
|
||||
return new WP_Error('fs_no_root_dir', $this->strings['fs_no_root_dir']);
|
||||
break;
|
||||
case WP_CONTENT_DIR:
|
||||
if ( ! $wp_filesystem->wp_content_dir() )
|
||||
return new WP_Error('fs_no_content_dir', $this->strings['fs_no_content_dir']);
|
||||
break;
|
||||
case WP_PLUGIN_DIR:
|
||||
if ( ! $wp_filesystem->wp_plugins_dir() )
|
||||
return new WP_Error('fs_no_plugins_dir', $this->strings['fs_no_plugins_dir']);
|
||||
break;
|
||||
case WP_CONTENT_DIR . '/themes':
|
||||
if ( ! $wp_filesystem->find_folder(WP_CONTENT_DIR . '/themes') )
|
||||
return new WP_Error('fs_no_themes_dir', $this->strings['fs_no_themes_dir']);
|
||||
break;
|
||||
default:
|
||||
if ( ! $wp_filesystem->find_folder($dir) )
|
||||
return new WP_Error('fs_no_folder', sprintf($this->strings['fs_no_folder'], $dir));
|
||||
break;
|
||||
}
|
||||
if ( ABSPATH == $dir && ! $wp_filesystem->abspath() )
|
||||
return new WP_Error('fs_no_root_dir', $this->strings['fs_no_root_dir']);
|
||||
|
||||
elseif ( WP_CONTENT_DIR == $dir && ! $wp_filesystem->wp_content_dir() )
|
||||
return new WP_Error('fs_no_content_dir', $this->strings['fs_no_content_dir']);
|
||||
|
||||
elseif ( WP_PLUGIN_DIR == $dir && ! $wp_filesystem->wp_plugins_dir() )
|
||||
return new WP_Error('fs_no_plugins_dir', $this->strings['fs_no_plugins_dir']);
|
||||
|
||||
elseif ( WP_CONTENT_DIR . '/themes' == $dir && ! $wp_filesystem->find_folder(WP_CONTENT_DIR . '/themes') )
|
||||
return new WP_Error('fs_no_themes_dir', $this->strings['fs_no_themes_dir']);
|
||||
|
||||
elseif ( ! $wp_filesystem->find_folder($dir) )
|
||||
return new WP_Error('fs_no_folder', sprintf($strings['fs_no_folder'], $dir));
|
||||
}
|
||||
return true;
|
||||
} //end fs_connect();
|
||||
@@ -210,26 +202,24 @@ class WP_Upgrader {
|
||||
$destination = trailingslashit($destination) . trailingslashit(basename($source));
|
||||
}
|
||||
|
||||
if ( $wp_filesystem->exists($remote_destination) ) {
|
||||
if ( $clear_destination ) {
|
||||
//We're going to clear the destination if theres something there
|
||||
$this->skin->feedback('remove_old');
|
||||
$removed = $wp_filesystem->delete($remote_destination, true);
|
||||
$removed = apply_filters('upgrader_clear_destination', $removed, $local_destination, $remote_destination, $hook_extra);
|
||||
//If we're not clearing the destination folder, and something exists there allready, Bail.
|
||||
if ( ! $clear_destination && $wp_filesystem->exists($remote_destination) ) {
|
||||
$wp_filesystem->delete($remote_source, true); //Clear out the source files.
|
||||
return new WP_Error('folder_exists', $this->strings['folder_exists'], $remote_destination );
|
||||
} else if ( $clear_destination ) {
|
||||
//We're going to clear the destination if theres something there
|
||||
$this->skin->feedback('remove_old');
|
||||
|
||||
if ( is_wp_error($removed) )
|
||||
return $removed;
|
||||
else if ( ! $removed )
|
||||
return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
|
||||
} else {
|
||||
//If we're not clearing the destination folder and something exists there allready, Bail.
|
||||
//But first check to see if there are actually any files in the folder.
|
||||
$_files = $wp_filesystem->dirlist($remote_destination);
|
||||
if ( ! empty($_files) ) {
|
||||
$wp_filesystem->delete($remote_source, true); //Clear out the source files.
|
||||
return new WP_Error('folder_exists', $this->strings['folder_exists'], $remote_destination );
|
||||
}
|
||||
}
|
||||
$removed = true;
|
||||
if ( $wp_filesystem->exists($remote_destination) )
|
||||
$removed = $wp_filesystem->delete($remote_destination, true);
|
||||
|
||||
$removed = apply_filters('upgrader_clear_destination', $removed, $local_destination, $remote_destination, $hook_extra);
|
||||
|
||||
if ( is_wp_error($removed) )
|
||||
return $removed;
|
||||
else if ( ! $removed )
|
||||
return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
|
||||
}
|
||||
|
||||
//Create destination if needed
|
||||
@@ -271,7 +261,6 @@ class WP_Upgrader {
|
||||
'destination' => '', //And this
|
||||
'clear_destination' => false,
|
||||
'clear_working' => true,
|
||||
'is_multi' => false,
|
||||
'hook_extra' => array() //Pass any extra $hook_extra args here, this will be passed to any hooked filters.
|
||||
);
|
||||
|
||||
@@ -288,9 +277,7 @@ class WP_Upgrader {
|
||||
return $res;
|
||||
}
|
||||
|
||||
if ( !$is_multi ) // call $this->header separately if running multiple times
|
||||
$this->skin->header();
|
||||
|
||||
$this->skin->header();
|
||||
$this->skin->before();
|
||||
|
||||
//Download the package (Note, This just returns the filename of the file if the package is a local file)
|
||||
@@ -324,10 +311,7 @@ class WP_Upgrader {
|
||||
$this->skin->feedback('process_success');
|
||||
}
|
||||
$this->skin->after();
|
||||
|
||||
if ( !$is_multi )
|
||||
$this->skin->footer();
|
||||
|
||||
$this->skin->footer();
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -360,8 +344,6 @@ class WP_Upgrader {
|
||||
class Plugin_Upgrader extends WP_Upgrader {
|
||||
|
||||
var $result;
|
||||
var $bulk = false;
|
||||
var $show_before = '';
|
||||
|
||||
function upgrade_strings() {
|
||||
$this->strings['up_to_date'] = __('The plugin is at the latest version.');
|
||||
@@ -432,7 +414,7 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
)
|
||||
));
|
||||
|
||||
// Cleanup our hooks, incase something else does a upgrade on this connection.
|
||||
//Cleanup our hooks, incase something else does a upgrade on this connection.
|
||||
remove_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'));
|
||||
remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'));
|
||||
|
||||
@@ -443,76 +425,6 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
delete_transient('update_plugins');
|
||||
}
|
||||
|
||||
function bulk_upgrade($plugins) {
|
||||
|
||||
$this->init();
|
||||
$this->bulk = true;
|
||||
$this->upgrade_strings();
|
||||
|
||||
$current = get_transient( 'update_plugins' );
|
||||
|
||||
add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4);
|
||||
|
||||
$this->skin->header();
|
||||
|
||||
// Connect to the Filesystem first.
|
||||
$res = $this->fs_connect( array(WP_CONTENT_DIR, WP_PLUGIN_DIR) );
|
||||
if ( ! $res ) {
|
||||
$this->skin->footer();
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->maintenance_mode(true);
|
||||
|
||||
$all = count($plugins);
|
||||
$i = 1;
|
||||
foreach ( $plugins as $plugin ) {
|
||||
|
||||
$this->show_before = sprintf( '<h4>' . __('Updating plugin %1$d of %2$d...') . '</h4>', $i, $all );
|
||||
$i++;
|
||||
|
||||
if ( !isset( $current->response[ $plugin ] ) ) {
|
||||
$this->skin->set_result(false);
|
||||
$this->skin->error('up_to_date');
|
||||
$this->skin->after();
|
||||
$results[$plugin] = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get the URL to the zip file
|
||||
$r = $current->response[ $plugin ];
|
||||
|
||||
$this->skin->plugin_active = is_plugin_active($plugin);
|
||||
|
||||
$result = $this->run(array(
|
||||
'package' => $r->package,
|
||||
'destination' => WP_PLUGIN_DIR,
|
||||
'clear_destination' => true,
|
||||
'clear_working' => true,
|
||||
'is_multi' => true,
|
||||
'hook_extra' => array(
|
||||
'plugin' => $plugin
|
||||
)
|
||||
));
|
||||
|
||||
$results[$plugin] = $this->result;
|
||||
|
||||
// Prevent credentials auth screen from displaying multiple times
|
||||
if ( false === $result )
|
||||
break;
|
||||
}
|
||||
$this->maintenance_mode(false);
|
||||
$this->skin->footer();
|
||||
|
||||
// Cleanup our hooks, incase something else does a upgrade on this connection.
|
||||
remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'));
|
||||
|
||||
// Force refresh of plugin update information
|
||||
delete_transient('update_plugins');
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
//return plugin info.
|
||||
function plugin_info() {
|
||||
if ( ! is_array($this->result) )
|
||||
@@ -648,7 +560,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
$this->skin->after();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$r = $current->response[ $theme ];
|
||||
|
||||
add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2);
|
||||
@@ -908,15 +820,11 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||
}
|
||||
|
||||
function after() {
|
||||
if ( $this->upgrader->bulk )
|
||||
return;
|
||||
|
||||
$this->plugin = $this->upgrader->plugin_info();
|
||||
if( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ){
|
||||
show_message(__('Attempting reactivation of the plugin'));
|
||||
echo '<iframe style="border:0;overflow:hidden" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) .'"></iframe>';
|
||||
}
|
||||
|
||||
$update_actions = array(
|
||||
'activate_plugin' => '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>',
|
||||
'plugins_page' => '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Goto plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'
|
||||
@@ -930,13 +838,6 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||
if ( ! empty($update_actions) )
|
||||
$this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions));
|
||||
}
|
||||
|
||||
function before() {
|
||||
if ( $this->upgrader->show_before ) {
|
||||
echo $this->upgrader->show_before;
|
||||
$this->upgrader->show_before = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1095,10 +996,10 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||
$name = $theme_info['Name'];
|
||||
$stylesheet = $this->upgrader->result['destination_name'];
|
||||
$template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;
|
||||
|
||||
|
||||
$preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), trailingslashit(esc_url(get_option('home'))) ) );
|
||||
$activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
|
||||
|
||||
|
||||
$update_actions = array(
|
||||
'preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview “%s”'), $name)) . '">' . __('Preview') . '</a>',
|
||||
'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate “%s”'), $name ) ) . '">' . __('Activate') . '</a>',
|
||||
|
||||
@@ -34,12 +34,11 @@ function wp_dashboard_setup() {
|
||||
// Incoming Links Widget
|
||||
if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
|
||||
$update = true;
|
||||
$num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10;
|
||||
$widget_options['dashboard_incoming_links'] = array(
|
||||
'home' => get_option('home'),
|
||||
'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
|
||||
'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?scoring=d&ie=utf-8&num=' . $num_items . '&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
|
||||
'items' => $num_items,
|
||||
'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
|
||||
'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=20&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
|
||||
'items' => isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10,
|
||||
'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
|
||||
);
|
||||
}
|
||||
@@ -133,7 +132,7 @@ function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_
|
||||
function _wp_dashboard_control_callback( $dashboard, $meta_box ) {
|
||||
echo '<form action="" method="post" class="dashboard-widget-control-form">';
|
||||
wp_dashboard_trigger_widget_control( $meta_box['id'] );
|
||||
echo '<p class="submit"><input type="hidden" name="widget_id" value="' . esc_attr($meta_box['id']) . '" /><input type="submit" value="' . esc_attr__( 'Submit' ) . '" /></p>';
|
||||
echo "<p class='submit'><input type='hidden' name='widget_id' value='" . esc_attr($meta_box['id']) . "' /><input type='submit' value='" . esc_attr__( 'Submit' ) . "' /></p>";
|
||||
|
||||
echo '</form>';
|
||||
}
|
||||
@@ -164,7 +163,7 @@ function wp_dashboard() {
|
||||
$hide2 = $hide3 = $hide4 = 'display:none;';
|
||||
}
|
||||
?>
|
||||
<div id="dashboard-widgets" class="metabox-holder">
|
||||
<div id='dashboard-widgets' class='metabox-holder'>
|
||||
<?php
|
||||
echo "\t<div class='postbox-container' style='$width'>\n";
|
||||
do_meta_boxes( 'dashboard', 'normal', '' );
|
||||
@@ -180,7 +179,7 @@ function wp_dashboard() {
|
||||
?>
|
||||
</div></div>
|
||||
|
||||
<form style="display:none" method="get" action="">
|
||||
<form style='display: none' method='get' action=''>
|
||||
<p>
|
||||
<?php
|
||||
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
||||
@@ -237,7 +236,7 @@ function wp_dashboard_right_now() {
|
||||
*/
|
||||
|
||||
// Total Comments
|
||||
$num = '<span class="total-count">' . number_format_i18n($num_comm->total_comments) . '</span>';
|
||||
$num = number_format_i18n($num_comm->total_comments);
|
||||
$text = _n( 'Comment', 'Comments', $num_comm->total_comments );
|
||||
if ( current_user_can( 'moderate_comments' ) ) {
|
||||
$num = "<a href='edit-comments.php'>$num</a>";
|
||||
@@ -259,7 +258,7 @@ function wp_dashboard_right_now() {
|
||||
echo '<td class="t pages">' . $text . '</td>';
|
||||
|
||||
// Approved Comments
|
||||
$num = '<span class="approved-count">' . number_format_i18n($num_comm->approved) . '</span>';
|
||||
$num = number_format_i18n($num_comm->approved);
|
||||
$text = _nc( 'Approved|Right Now', 'Approved', $num_comm->approved );
|
||||
if ( current_user_can( 'moderate_comments' ) ) {
|
||||
$num = "<a href='edit-comments.php?comment_status=approved'>$num</a>";
|
||||
@@ -281,10 +280,10 @@ function wp_dashboard_right_now() {
|
||||
echo '<td class="t cats">' . $text . '</td>';
|
||||
|
||||
// Pending Comments
|
||||
$num = '<span class="pending-count">' . number_format_i18n($num_comm->moderated) . '</span>';
|
||||
$num = number_format_i18n($num_comm->moderated);
|
||||
$text = _n( 'Pending', 'Pending', $num_comm->moderated );
|
||||
if ( current_user_can( 'moderate_comments' ) ) {
|
||||
$num = "<a href='edit-comments.php?comment_status=moderated'>$num</a>";
|
||||
$num = "<a href='edit-comments.php?comment_status=moderated'><span class='pending-count'>$num</span></a>";
|
||||
$text = "<a class='waiting' href='edit-comments.php?comment_status=moderated'>$text</a>";
|
||||
}
|
||||
echo '<td class="b b-waiting">' . $num . '</td>';
|
||||
@@ -340,9 +339,9 @@ function wp_dashboard_right_now() {
|
||||
} else {
|
||||
if ( current_user_can( 'switch_themes' ) ) {
|
||||
echo '<a href="themes.php" class="button rbutton">' . __('Change Theme') . '</a>';
|
||||
printf( __('Theme <span class="b"><a href="themes.php">%1$s</a></span>'), $ct->title );
|
||||
printf('Theme <span class="b"><a href="themes.php">%1$s</a></span>', $ct->title);
|
||||
} else {
|
||||
printf( __('Theme <span class="b">%1$s</span>'), $ct->title );
|
||||
printf('Theme <span class="b">%1$s</span>', $ct->title);
|
||||
}
|
||||
}
|
||||
echo '</p>';
|
||||
@@ -448,7 +447,7 @@ function wp_dashboard_recent_drafts( $drafts = false ) {
|
||||
foreach ( $drafts as $draft ) {
|
||||
$url = get_edit_post_link( $draft->ID );
|
||||
$title = _draft_or_post_title( $draft->ID );
|
||||
$item = "<h4><a href='$url' title='" . sprintf( __( 'Edit “%s”' ), esc_attr( $title ) ) . "'>" . esc_html($title) . "</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
|
||||
$item = "<h4><a href='$url' title='" . sprintf( __( 'Edit “%s”' ), esc_attr( $title ) ) . "'>$title</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
|
||||
if ( $the_content = preg_split( '#\s#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) )
|
||||
$item .= '<p>' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '…' : '' ) . '</p>';
|
||||
$list[] = $item;
|
||||
@@ -481,7 +480,7 @@ function wp_dashboard_recent_comments() {
|
||||
$comments = array();
|
||||
$start = 0;
|
||||
|
||||
while ( count( $comments ) < 5 && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50" ) ) {
|
||||
while ( count( $comments ) < 5 && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments ORDER BY comment_date_gmt DESC LIMIT $start, 50" ) ) {
|
||||
|
||||
foreach ( $possible as $comment ) {
|
||||
if ( count( $comments ) >= 5 )
|
||||
@@ -510,7 +509,6 @@ function wp_dashboard_recent_comments() {
|
||||
<?php }
|
||||
|
||||
wp_comment_reply( -1, false, 'dashboard', false );
|
||||
wp_comment_trashnotice();
|
||||
|
||||
else :
|
||||
?>
|
||||
@@ -529,37 +527,24 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
|
||||
$comment_post_link = "<a href='$comment_post_url'>$comment_post_title</a>";
|
||||
$comment_link = '<a class="comment-link" href="' . esc_url(get_comment_link()) . '">#</a>';
|
||||
|
||||
$delete_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
|
||||
$approve_url = esc_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) );
|
||||
$unapprove_url = esc_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) );
|
||||
$spam_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
|
||||
|
||||
$actions = array();
|
||||
|
||||
$actions_string = '';
|
||||
if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
|
||||
// preorder it: Approve | Reply | Edit | Spam | Trash
|
||||
$actions = array(
|
||||
'approve' => '', 'unapprove' => '',
|
||||
'reply' => '',
|
||||
'edit' => '',
|
||||
'spam' => '',
|
||||
'trash' => '', 'delete' => ''
|
||||
);
|
||||
|
||||
$del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
|
||||
$approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
|
||||
|
||||
$approve_url = esc_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" );
|
||||
$unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" );
|
||||
$spam_url = esc_url( "comment.php?action=spamcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
|
||||
$trash_url = esc_url( "comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
|
||||
$delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
|
||||
|
||||
$actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
|
||||
$actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
|
||||
$actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
|
||||
//$actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
|
||||
$actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
|
||||
$actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
|
||||
if ( !EMPTY_TRASH_DAYS )
|
||||
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
|
||||
else
|
||||
$actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
|
||||
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
|
||||
|
||||
$actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
|
||||
$actions = apply_filters( 'comment_row_actions', $actions, $comment );
|
||||
|
||||
$i = 0;
|
||||
foreach ( $actions as $action => $link ) {
|
||||
@@ -582,7 +567,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
|
||||
<?php echo get_avatar( $comment, 50 ); ?>
|
||||
|
||||
<div class="dashboard-comment-wrap">
|
||||
<h4 class="comment-meta"><?php printf( __( 'From %1$s on %2$s%3$s' ), '<cite class="comment-author">' . get_comment_author_link() . '</cite>', $comment_post_link.' '.$comment_link, ' <span class="approve">' . __( '[Pending]' ) . '</span>' ); ?></h4>
|
||||
<h4 class="comment-meta"><?php printf( __( 'From %1$s on %2$s%3$s' ), '<cite class="comment-author">' . get_comment_author_link() . '</cite>', $comment_post_link." ".$comment_link, ' <span class="approve">' . __( '[Pending]' ) . '</span>' ); ?></h4>
|
||||
|
||||
<?php
|
||||
else :
|
||||
@@ -600,12 +585,20 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
|
||||
?>
|
||||
<div class="dashboard-comment-wrap">
|
||||
<?php /* translators: %1$s is type of comment, %2$s is link to the post */ ?>
|
||||
<h4 class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link." ".$comment_link ); ?></h4>
|
||||
<h4 class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link ); ?></h4>
|
||||
<p class="comment-author"><?php comment_author_link(); ?></p>
|
||||
|
||||
<?php endif; // comment_type ?>
|
||||
<blockquote><p><?php comment_excerpt(); ?></p></blockquote>
|
||||
<p class="row-actions"><?php echo $actions_string; ?></p>
|
||||
|
||||
<div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
|
||||
<textarea class="comment" rows="3" cols="10"><?php echo $comment->comment_content; ?></textarea>
|
||||
<div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
|
||||
<div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
|
||||
<div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
|
||||
<div class="comment_status"><?php echo $comment->comment_approved; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
@@ -636,8 +629,6 @@ function wp_dashboard_incoming_links_output() {
|
||||
|
||||
if ( !$rss->get_item_quantity() ) {
|
||||
echo '<p>' . __('This dashboard widget queries <a href="http://blogsearch.google.com/">Google Blog Search</a> so that when another blog links to your site it will show up here. It has found no incoming links… yet. It’s okay — there is no rush.') . "</p>\n";
|
||||
$rss->__destruct();
|
||||
unset($rss);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -691,8 +682,7 @@ function wp_dashboard_incoming_links_output() {
|
||||
}
|
||||
|
||||
echo "</ul>\n";
|
||||
$rss->__destruct();
|
||||
unset($rss);
|
||||
|
||||
}
|
||||
|
||||
function wp_dashboard_incoming_links_control() {
|
||||
@@ -716,7 +706,7 @@ function wp_dashboard_primary_control() {
|
||||
*/
|
||||
function wp_dashboard_rss_output( $widget_id ) {
|
||||
$widgets = get_option( 'dashboard_widget_options' );
|
||||
echo '<div class="rss-widget">';
|
||||
echo "<div class='rss-widget'>";
|
||||
wp_widget_rss_output( $widgets[$widget_id] );
|
||||
echo "</div>";
|
||||
}
|
||||
@@ -748,15 +738,11 @@ function wp_dashboard_secondary_output() {
|
||||
echo '</p></div>';
|
||||
}
|
||||
} elseif ( !$rss->get_item_quantity() ) {
|
||||
$rss->__destruct();
|
||||
unset($rss);
|
||||
return false;
|
||||
} else {
|
||||
echo '<div class="rss-widget">';
|
||||
wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] );
|
||||
echo '</div>';
|
||||
$rss->__destruct();
|
||||
unset($rss);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -839,9 +825,6 @@ function wp_dashboard_plugins_output() {
|
||||
echo "<h4>$label</h4>\n";
|
||||
echo "<h5><a href='$link'>$title</a></h5> <span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span>\n";
|
||||
echo "<p>$description</p>\n";
|
||||
|
||||
$$feed->__destruct();
|
||||
unset($$feed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -935,13 +918,10 @@ function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
|
||||
// title is optional. If black, fill it if possible
|
||||
if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) {
|
||||
$rss = fetch_feed($widget_options[$widget_id]['url']);
|
||||
if ( is_wp_error($rss) ) {
|
||||
if ( ! is_wp_error($rss) )
|
||||
$widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title()));
|
||||
else
|
||||
$widget_options[$widget_id]['title'] = htmlentities(__('Unknown Feed'));
|
||||
} else {
|
||||
$widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title()));
|
||||
$rss->__destruct();
|
||||
unset($rss);
|
||||
}
|
||||
}
|
||||
update_option( 'dashboard_widget_options', $widget_options );
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ define('WXR_VERSION', '1.0');
|
||||
* @param unknown_type $author
|
||||
*/
|
||||
function export_wp($author='') {
|
||||
global $wpdb, $post_ids, $post, $wp_taxonomies;
|
||||
global $wpdb, $post_ids, $post;
|
||||
|
||||
do_action('export_wp');
|
||||
|
||||
@@ -46,13 +46,6 @@ $post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_dat
|
||||
$categories = (array) get_categories('get=all');
|
||||
$tags = (array) get_tags('get=all');
|
||||
|
||||
$custom_taxonomies = $wp_taxonomies;
|
||||
unset($custom_taxonomies['category']);
|
||||
unset($custom_taxonomies['post_tag']);
|
||||
unset($custom_taxonomies['link_category']);
|
||||
$custom_taxonomies = array_keys($custom_taxonomies);
|
||||
$terms = (array) get_terms($custom_taxonomies, 'get=all');
|
||||
|
||||
/**
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
@@ -189,34 +182,6 @@ function wxr_tag_description($t) {
|
||||
echo '<wp:tag_description>' . wxr_cdata($t->description) . '</wp:tag_description>';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since unknown
|
||||
*
|
||||
* @param object $t Term Object
|
||||
*/
|
||||
function wxr_term_name($t) {
|
||||
if ( empty($t->name) )
|
||||
return;
|
||||
|
||||
echo '<wp:term_name>' . wxr_cdata($t->name) . '</wp:term_name>';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since unknown
|
||||
*
|
||||
* @param object $t Term Object
|
||||
*/
|
||||
function wxr_term_description($t) {
|
||||
if ( empty($t->description) )
|
||||
return;
|
||||
|
||||
echo '<wp:term_description>' . wxr_cdata($t->description) . '</wp:term_description>';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
@@ -256,7 +221,7 @@ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
|
||||
<!-- This file is not intended to serve as a complete backup of your blog. -->
|
||||
|
||||
<!-- To import this information into a WordPress blog follow these steps. -->
|
||||
<!-- 1. Log in to that blog as an administrator. -->
|
||||
<!-- 1. Log into that blog as an administrator. -->
|
||||
<!-- 2. Go to Tools: Import in the blog's admin panels (or Manage: Import in older versions of WordPress). -->
|
||||
<!-- 3. Choose "WordPress" from the list. -->
|
||||
<!-- 4. Upload this file using the form provided on that page. -->
|
||||
@@ -290,9 +255,6 @@ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
|
||||
<?php endforeach; endif; ?>
|
||||
<?php if ( $tags ) : foreach ( $tags as $t ) : ?>
|
||||
<wp:tag><wp:tag_slug><?php echo $t->slug; ?></wp:tag_slug><?php wxr_tag_name($t); ?><?php wxr_tag_description($t); ?></wp:tag>
|
||||
<?php endforeach; endif; ?>
|
||||
<?php if ( $terms ) : foreach ( $terms as $t ) : ?>
|
||||
<wp:term><wp:term_taxonomy><?php echo $t->taxonomy; ?></wp:term_taxonomy><wp:term_slug><?php echo $t->slug; ?></wp:term_slug><wp:term_parent><?php echo $t->parent ? $custom_taxonomies[$t->parent]->name : ''; ?></wp:term_parent><?php wxr_term_name($t); ?><?php wxr_term_description($t); ?></wp:term>
|
||||
<?php endforeach; endif; ?>
|
||||
<?php do_action('rss2_head'); ?>
|
||||
<?php if ($post_ids) {
|
||||
@@ -306,13 +268,7 @@ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
|
||||
// Don't export revisions. They bloat the export.
|
||||
if ( 'revision' == $post->post_type )
|
||||
continue;
|
||||
setup_postdata($post);
|
||||
|
||||
$is_sticky = 0;
|
||||
if ( is_sticky( $post->ID ) )
|
||||
$is_sticky = 1;
|
||||
|
||||
?>
|
||||
setup_postdata($post); ?>
|
||||
<item>
|
||||
<title><?php echo apply_filters('the_title_rss', $post->post_title); ?></title>
|
||||
<link><?php the_permalink_rss() ?></link>
|
||||
@@ -335,7 +291,6 @@ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
|
||||
<wp:menu_order><?php echo $post->menu_order; ?></wp:menu_order>
|
||||
<wp:post_type><?php echo $post->post_type; ?></wp:post_type>
|
||||
<wp:post_password><?php echo $post->post_password; ?></wp:post_password>
|
||||
<wp:is_sticky><?php echo $is_sticky; ?></wp:is_sticky>
|
||||
<?php
|
||||
if ($post->post_type == 'attachment') { ?>
|
||||
<wp:attachment_url><?php echo wp_get_attachment_url($post->ID); ?></wp:attachment_url>
|
||||
@@ -358,7 +313,7 @@ if ( $comments ) { foreach ( $comments as $c ) { ?>
|
||||
<wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
|
||||
<wp:comment_author><?php echo wxr_cdata($c->comment_author); ?></wp:comment_author>
|
||||
<wp:comment_author_email><?php echo $c->comment_author_email; ?></wp:comment_author_email>
|
||||
<wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>
|
||||
<wp:comment_author_url><?php echo $c->comment_author_url; ?></wp:comment_author_url>
|
||||
<wp:comment_author_IP><?php echo $c->comment_author_IP; ?></wp:comment_author_IP>
|
||||
<wp:comment_date><?php echo $c->comment_date; ?></wp:comment_date>
|
||||
<wp:comment_date_gmt><?php echo $c->comment_date_gmt; ?></wp:comment_date_gmt>
|
||||
|
||||
@@ -99,14 +99,13 @@ function get_real_file_to_edit( $file ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a listing of all files in the specified folder and all subdirectories up to 100 levels deep.
|
||||
* The depth of the recursiveness can be controlled by the $levels param.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.6.0
|
||||
* @since unknown
|
||||
*
|
||||
* @param string $folder Full path to folder
|
||||
* @param int $levels (optional) Levels of folders to follow, Default: 100 (PHP Loop limit).
|
||||
* @return bool|array False on failure, Else array of files
|
||||
* @param string $folder Optional. Full path to folder
|
||||
* @param int $levels Optional. Levels of folders to follow, Default: 100 (PHP Loop limit).
|
||||
* @return bool|array
|
||||
*/
|
||||
function list_files( $folder = '', $levels = 100 ) {
|
||||
if( empty($folder) )
|
||||
@@ -136,14 +135,11 @@ function list_files( $folder = '', $levels = 100 ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines a writable directory for temporary files.
|
||||
* Function's preference is to WP_CONTENT_DIR followed by the return value of <code>sys_get_temp_dir()</code>, before finally defaulting to /tmp/
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* In the event that this function does not find a writable location, It may be overridden by the <code>WP_TEMP_DIR</code> constant in your <code>wp-config.php</code> file.
|
||||
* @since unknown
|
||||
*
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @return string Writable temporary directory
|
||||
* @return unknown
|
||||
*/
|
||||
function get_temp_dir() {
|
||||
if ( defined('WP_TEMP_DIR') )
|
||||
@@ -160,17 +156,13 @@ function get_temp_dir() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a filename of a Temporary unique file.
|
||||
* Please note that the calling function must unlink() this itself.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* The filename is based off the passed parameter or defaults to the current unix timestamp,
|
||||
* while the directory can either be passed as well, or by leaving it blank, default to a writable temporary directory.
|
||||
* @since unknown
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param string $filename (optional) Filename to base the Unique file off
|
||||
* @param string $dir (optional) Directory to store the file in
|
||||
* @return string a writable filename
|
||||
* @param unknown_type $filename
|
||||
* @param unknown_type $dir
|
||||
* @return unknown
|
||||
*/
|
||||
function wp_tempnam($filename = '', $dir = ''){
|
||||
if ( empty($dir) )
|
||||
@@ -179,7 +171,6 @@ function wp_tempnam($filename = '', $dir = ''){
|
||||
if ( empty($filename) )
|
||||
$filename = time();
|
||||
|
||||
$filename = preg_replace('|\..*$|', '.tmp', $filename);
|
||||
$filename = $dir . wp_unique_filename($dir, $filename);
|
||||
touch($filename);
|
||||
return $filename;
|
||||
@@ -195,6 +186,8 @@ function wp_tempnam($filename = '', $dir = ''){
|
||||
* @return unknown
|
||||
*/
|
||||
function validate_file_to_edit( $file, $allowed_files = '' ) {
|
||||
$file = stripslashes( $file );
|
||||
|
||||
$code = validate_file( $file, $allowed_files );
|
||||
|
||||
if (!$code )
|
||||
@@ -204,8 +197,8 @@ function validate_file_to_edit( $file, $allowed_files = '' ) {
|
||||
case 1 :
|
||||
wp_die( __('Sorry, can’t edit files with “..” in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.' ));
|
||||
|
||||
//case 2 :
|
||||
// wp_die( __('Sorry, can’t call files with their real path.' ));
|
||||
case 2 :
|
||||
wp_die( __('Sorry, can’t call files with their real path.' ));
|
||||
|
||||
case 3 :
|
||||
wp_die( __('Sorry, that file cannot be edited.' ));
|
||||
@@ -229,15 +222,9 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) {
|
||||
}
|
||||
}
|
||||
|
||||
$file = apply_filters( 'wp_handle_upload_prefilter', $file );
|
||||
|
||||
// You may define your own function and pass the name in $overrides['upload_error_handler']
|
||||
$upload_error_handler = 'wp_handle_upload_error';
|
||||
|
||||
// You may have had one or more 'wp_handle_upload_prefilter' functions error out the file. Handle that gracefully.
|
||||
if ( isset( $file['error'] ) && !ctype_digit( $file['error'] ) && $file['error'] )
|
||||
return $upload_error_handler( $file, $file['error'] );
|
||||
|
||||
// You may define your own function and pass the name in $overrides['unique_filename_callback']
|
||||
$unique_filename_callback = null;
|
||||
|
||||
@@ -277,7 +264,7 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) {
|
||||
|
||||
// A non-empty file will pass this test.
|
||||
if ( $test_size && !($file['size'] > 0 ) )
|
||||
return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' ));
|
||||
return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.' ));
|
||||
|
||||
// A properly uploaded file will pass this test. There should be no reason to override this one.
|
||||
if (! @ is_uploaded_file( $file['tmp_name'] ) )
|
||||
@@ -437,10 +424,10 @@ function wp_handle_sideload( &$file, $overrides = false ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Downloads a url to a local temporary file using the WordPress HTTP Class.
|
||||
* Please note, That the calling function must unlink() the file.
|
||||
* Downloads a url to a local file using the Snoopy HTTP Class.
|
||||
*
|
||||
* @since 2.5.0
|
||||
* @since unknown
|
||||
* @todo Transition over to using the new HTTP Request API (jacob).
|
||||
*
|
||||
* @param string $url the URL of the file to download
|
||||
* @return mixed WP_Error on failure, string Filename on success.
|
||||
@@ -479,17 +466,13 @@ function download_url( $url ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Unzip's a specified ZIP file to a location on the Filesystem via the WordPress Filesystem Abstraction.
|
||||
* Assumes that WP_Filesystem() has already been called and set up.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* Attempts to increase the PHP Memory limit to 256M before uncompressing,
|
||||
* However, The most memory required shouldn't be much larger than the Archive itself.
|
||||
* @since unknown
|
||||
*
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @param string $file Full path and filename of zip archive
|
||||
* @param string $to Full path on the filesystem to extract archive to
|
||||
* @return mixed WP_Error on failure, True on success
|
||||
* @param unknown_type $file
|
||||
* @param unknown_type $to
|
||||
* @return unknown
|
||||
*/
|
||||
function unzip_file($file, $to) {
|
||||
global $wp_filesystem;
|
||||
@@ -497,7 +480,7 @@ function unzip_file($file, $to) {
|
||||
if ( ! $wp_filesystem || !is_object($wp_filesystem) )
|
||||
return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
|
||||
|
||||
// Unzip uses a lot of memory, but not this much hopefully
|
||||
// Unzip uses a lot of memory
|
||||
@ini_set('memory_limit', '256M');
|
||||
|
||||
$fs =& $wp_filesystem;
|
||||
@@ -555,14 +538,13 @@ function unzip_file($file, $to) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies a directory from one location to another via the WordPress Filesystem Abstraction.
|
||||
* Assumes that WP_Filesystem() has already been called and setup.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.5.0
|
||||
* @since unknown
|
||||
*
|
||||
* @param string $from source directory
|
||||
* @param string $to destination directory
|
||||
* @return mixed WP_Error on failure, True on success.
|
||||
* @param unknown_type $from
|
||||
* @param unknown_type $to
|
||||
* @return unknown
|
||||
*/
|
||||
function copy_dir($from, $to) {
|
||||
global $wp_filesystem;
|
||||
@@ -591,20 +573,15 @@ function copy_dir($from, $to) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialises and connects the WordPress Filesystem Abstraction classes.
|
||||
* This function will include the chosen transport and attempt connecting.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* Plugins may add extra transports, And force WordPress to use them by returning the filename via the 'filesystem_method_file' filter.
|
||||
* @since unknown
|
||||
*
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @param array $args (optional) Connection args, These are passed directly to the WP_Filesystem_*() classes.
|
||||
* @param string $context (optional) Context for get_filesystem_method(), See function declaration for more information.
|
||||
* @return boolean false on failure, true on success
|
||||
* @param unknown_type $args
|
||||
* @return unknown
|
||||
*/
|
||||
function WP_Filesystem( $args = false, $context = false ) {
|
||||
global $wp_filesystem;
|
||||
@@ -620,19 +597,13 @@ function WP_Filesystem( $args = false, $context = false ) {
|
||||
$abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method);
|
||||
if( ! file_exists($abstraction_file) )
|
||||
return;
|
||||
|
||||
|
||||
require_once($abstraction_file);
|
||||
}
|
||||
$method = "WP_Filesystem_$method";
|
||||
|
||||
$wp_filesystem = new $method($args);
|
||||
|
||||
//Define the timeouts for the connections. Only available after the construct is called to allow for per-transport overriding of the default.
|
||||
if ( ! defined('FS_CONNECT_TIMEOUT') )
|
||||
define('FS_CONNECT_TIMEOUT', 30);
|
||||
if ( ! defined('FS_TIMEOUT') )
|
||||
define('FS_TIMEOUT', 30);
|
||||
|
||||
if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() )
|
||||
return false;
|
||||
|
||||
@@ -649,20 +620,13 @@ function WP_Filesystem( $args = false, $context = false ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines which Filesystem Method to use.
|
||||
* The priority of the Transports are: Direct, SSH2, FTP PHP Extension, FTP Sockets (Via Sockets class, or fsoxkopen())
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* Note that the return value of this function can be overridden in 2 ways
|
||||
* - By defining FS_METHOD in your <code>wp-config.php</code> file
|
||||
* - By using the filesystem_method filter
|
||||
* Valid values for these are: 'direct', 'ssh', 'ftpext' or 'ftpsockets'
|
||||
* Plugins may also define a custom transport handler, See the WP_Filesystem function for more information.
|
||||
* @since unknown
|
||||
*
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @param array $args Connection details.
|
||||
* @param unknown_type $args
|
||||
* @param string $context Full path to the directory that is tested for being writable.
|
||||
* @return string The transport to use, see description for valid return values.
|
||||
* @return unknown
|
||||
*/
|
||||
function get_filesystem_method($args = array(), $context = false) {
|
||||
$method = defined('FS_METHOD') ? FS_METHOD : false; //Please ensure that this is either 'direct', 'ssh', 'ftpext' or 'ftpsockets'
|
||||
@@ -671,13 +635,13 @@ function get_filesystem_method($args = array(), $context = false) {
|
||||
if ( !$context )
|
||||
$context = WP_CONTENT_DIR;
|
||||
$context = trailingslashit($context);
|
||||
$temp_file_name = $context . 'temp-write-test-' . time();
|
||||
$temp_file_name = $context . '.write-test-' . time();
|
||||
$temp_handle = @fopen($temp_file_name, 'w');
|
||||
if ( $temp_handle ) {
|
||||
if ( getmyuid() == @fileowner($temp_file_name) )
|
||||
if ( getmyuid() == fileowner($temp_file_name) )
|
||||
$method = 'direct';
|
||||
@fclose($temp_handle);
|
||||
@unlink($temp_file_name);
|
||||
unlink($temp_file_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -688,20 +652,14 @@ function get_filesystem_method($args = array(), $context = false) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form to the user to request for their FTP/SSH details in order to connect to the filesystem.
|
||||
* All chosen/entered details are saved, Excluding the Password.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* Hostnames may be in the form of hostname:portnumber (eg: wordpress.org:2467) to specify an alternate FTP/SSH port.
|
||||
* @since unknown
|
||||
*
|
||||
* Plugins may override this form by returning true|false via the <code>request_filesystem_credentials</code> filter.
|
||||
*
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @param string $form_post the URL to post the form to
|
||||
* @param string $type the chosen Filesystem method in use
|
||||
* @param boolean $error if the current request has failed to connect
|
||||
* @param string $context The directory which is needed access to, The write-test will be performed on this directory by get_filesystem_method()
|
||||
* @return boolean False on failure. True on success.
|
||||
* @param unknown_type $form_post
|
||||
* @param unknown_type $type
|
||||
* @param unknown_type $error
|
||||
* @return unknown
|
||||
*/
|
||||
function request_filesystem_credentials($form_post, $type = '', $error = false, $context = false) {
|
||||
$req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error, $context);
|
||||
@@ -717,31 +675,28 @@ function request_filesystem_credentials($form_post, $type = '', $error = false,
|
||||
$credentials = get_option('ftp_credentials', array( 'hostname' => '', 'username' => ''));
|
||||
|
||||
// If defined, set it to that, Else, If POST'd, set it to that, If not, Set it to whatever it previously was(saved details in option)
|
||||
$credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? stripslashes($_POST['hostname']) : $credentials['hostname']);
|
||||
$credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? stripslashes($_POST['username']) : $credentials['username']);
|
||||
$credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? stripslashes($_POST['password']) : '');
|
||||
$credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? $_POST['hostname'] : $credentials['hostname']);
|
||||
$credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username'] : $credentials['username']);
|
||||
$credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password'] : '');
|
||||
|
||||
// Check to see if we are setting the public/private keys for ssh
|
||||
$credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? stripslashes($_POST['public_key']) : '');
|
||||
$credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? stripslashes($_POST['private_key']) : '');
|
||||
$credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? $_POST['public_key'] : '');
|
||||
$credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? $_POST['private_key'] : '');
|
||||
|
||||
//sanitize the hostname, Some people might pass in odd-data:
|
||||
$credentials['hostname'] = preg_replace('|\w+://|', '', $credentials['hostname']); //Strip any schemes off
|
||||
|
||||
if ( strpos($credentials['hostname'], ':') ) {
|
||||
if ( strpos($credentials['hostname'], ':') )
|
||||
list( $credentials['hostname'], $credentials['port'] ) = explode(':', $credentials['hostname'], 2);
|
||||
if ( ! is_numeric($credentials['port']) )
|
||||
unset($credentials['port']);
|
||||
} else {
|
||||
else
|
||||
unset($credentials['port']);
|
||||
}
|
||||
|
||||
if ( (defined('FTP_SSH') && FTP_SSH) || (defined('FS_METHOD') && 'ssh' == FS_METHOD) )
|
||||
if ( defined('FTP_SSH') || (defined('FS_METHOD') && 'ssh' == FS_METHOD) )
|
||||
$credentials['connection_type'] = 'ssh';
|
||||
else if ( (defined('FTP_SSL') && FTP_SSL) && 'ftpext' == $type ) //Only the FTP Extension understands SSL
|
||||
else if ( defined('FTP_SSL') && 'ftpext' == $type ) //Only the FTP Extension understands SSL
|
||||
$credentials['connection_type'] = 'ftps';
|
||||
else if ( !empty($_POST['connection_type']) )
|
||||
$credentials['connection_type'] = stripslashes($_POST['connection_type']);
|
||||
$credentials['connection_type'] = $_POST['connection_type'];
|
||||
else if ( !isset($credentials['connection_type']) ) //All else fails (And its not defaulted to something else saved), Default to FTP
|
||||
$credentials['connection_type'] = 'ftp';
|
||||
|
||||
@@ -770,17 +725,6 @@ function request_filesystem_credentials($form_post, $type = '', $error = false,
|
||||
$error_string = $error->get_error_message();
|
||||
echo '<div id="message" class="error"><p>' . $error_string . '</p></div>';
|
||||
}
|
||||
|
||||
$types = array();
|
||||
if ( extension_loaded('ftp') || extension_loaded('sockets') || function_exists('fsockopen') )
|
||||
$types[ 'ftp' ] = __('FTP');
|
||||
if ( extension_loaded('ftp') ) //Only this supports FTPS
|
||||
$types[ 'ftps' ] = __('FTPS (SSL)');
|
||||
if ( extension_loaded('ssh2') && function_exists('stream_get_contents') )
|
||||
$types[ 'ssh' ] = __('SSH2');
|
||||
|
||||
$types = apply_filters('fs_ftp_connection_types', $types, $credentials, $type, $error, $context);
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
@@ -817,7 +761,7 @@ jQuery(function($){
|
||||
<td><input name="password" type="password" id="password" value="<?php if ( defined('FTP_PASS') ) echo '*****'; ?>"<?php if ( defined('FTP_PASS') ) echo ' disabled="disabled"' ?> size="40" /></td>
|
||||
</tr>
|
||||
|
||||
<?php if ( isset($types['ssh']) ) : ?>
|
||||
<?php if ( extension_loaded('ssh2') && function_exists('stream_get_contents') ) : ?>
|
||||
<tr id="ssh_keys" valign="top" style="<?php if ( 'ssh' != $connection_type ) echo 'display:none' ?>">
|
||||
<th scope="row"><?php _e('Authentication Keys') ?>
|
||||
<div class="key-labels textright">
|
||||
@@ -833,26 +777,23 @@ jQuery(function($){
|
||||
<th scope="row"><?php _e('Connection Type') ?></th>
|
||||
<td>
|
||||
<fieldset><legend class="screen-reader-text"><span><?php _e('Connection Type') ?></span></legend>
|
||||
<?php
|
||||
|
||||
$disabled = (defined('FTP_SSL') && FTP_SSL) || (defined('FTP_SSH') && FTP_SSH) ? ' disabled="disabled"' : '';
|
||||
|
||||
foreach ( $types as $name => $text ) : ?>
|
||||
<label for="<?php echo esc_attr($name) ?>">
|
||||
<input type="radio" name="connection_type" id="<?php echo esc_attr($name) ?>" value="<?php echo esc_attr($name) ?>" <?php checked($name, $connection_type); echo $disabled; ?>/>
|
||||
<?php echo $text ?>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
<label><input id="ftp" name="connection_type" type="radio" value="ftp" <?php checked('ftp', $connection_type); if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled="disabled"'; ?>/> <?php _e('FTP') ?></label>
|
||||
<?php if ( 'ftpext' == $type ) : ?>
|
||||
<br /><label><input id="ftps" name="connection_type" type="radio" value="ftps" <?php checked('ftps', $connection_type); if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled="disabled"'; ?>/> <?php _e('FTPS (SSL)') ?></label>
|
||||
<?php endif; ?>
|
||||
<?php if ( extension_loaded('ssh2') && function_exists('stream_get_contents') ) : ?>
|
||||
<br /><label><input id="ssh" name="connection_type" type="radio" value="ssh" <?php checked('ssh', $connection_type); if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled="disabled"'; ?>/> <?php _e('SSH') ?></label>
|
||||
<?php endif; ?>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php if ( isset( $_POST['version'] ) ) : ?>
|
||||
<input type="hidden" name="version" value="<?php echo esc_attr(stripslashes($_POST['version'])) ?>" />
|
||||
<input type="hidden" name="version" value="<?php echo esc_attr($_POST['version']) ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ( isset( $_POST['locale'] ) ) : ?>
|
||||
<input type="hidden" name="locale" value="<?php echo esc_attr(stripslashes($_POST['locale'])) ?>" />
|
||||
<input type="hidden" name="locale" value="<?php echo esc_attr($_POST['locale']) ?>" />
|
||||
<?php endif; ?>
|
||||
<p class="submit">
|
||||
<input id="upgrade" name="upgrade" type="submit" class="button" value="<?php esc_attr_e('Proceed'); ?>" />
|
||||
|
||||
@@ -1,663 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* WordPress Image Editor
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
function wp_image_editor($post_id, $msg = false) {
|
||||
$nonce = wp_create_nonce("image_editor-$post_id");
|
||||
$meta = wp_get_attachment_metadata($post_id);
|
||||
$thumb = image_get_intermediate_size($post_id, 'thumbnail');
|
||||
$sub_sizes = isset($meta['sizes']) && is_array($meta['sizes']);
|
||||
$note = '';
|
||||
|
||||
if ( is_array($meta) && isset($meta['width']) )
|
||||
$big = max( $meta['width'], $meta['height'] );
|
||||
else
|
||||
die( __('Image data does not exist. Please re-upload the image.') );
|
||||
|
||||
$sizer = $big > 400 ? 400 / $big : 1;
|
||||
|
||||
$backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
|
||||
$can_restore = !empty($backup_sizes) && isset($backup_sizes['full-orig'])
|
||||
&& $backup_sizes['full-orig']['file'] != basename($meta['file']);
|
||||
|
||||
if ( $msg ) {
|
||||
if ( isset($msg->error) )
|
||||
$note = "<div class='error'><p>$msg->error</p></div>";
|
||||
elseif ( isset($msg->msg) )
|
||||
$note = "<div class='updated'><p>$msg->msg</p></div>";
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="imgedit-wrap">
|
||||
<?php echo $note; ?>
|
||||
<table id="imgedit-panel-<?php echo $post_id; ?>"><tbody>
|
||||
<tr><td>
|
||||
<div class="imgedit-menu">
|
||||
<div onclick="imageEdit.crop(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-crop disabled" title="<?php esc_attr_e( 'Crop' ); ?>"></div><?php
|
||||
|
||||
if ( function_exists('imagerotate') ) { ?>
|
||||
|
||||
<div onclick="imageEdit.rotate(90, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-rleft" title="<?php esc_attr_e( 'Rotate couter-clockwise' ); ?>"></div>
|
||||
<div onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-rright" title="<?php esc_attr_e( 'Rotate clockwise' ); ?>"></div><?php
|
||||
|
||||
} ?>
|
||||
|
||||
<div onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv" title="<?php esc_attr_e( 'Flip vertically' ); ?>"></div>
|
||||
<div onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph" title="<?php esc_attr_e( 'Flip horizontally' ); ?>"></div>
|
||||
|
||||
<div id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-undo disabled" title="<?php esc_attr_e( 'Undo' ); ?>"></div>
|
||||
<div id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-redo disabled" title="<?php esc_attr_e( 'Redo' ); ?>"></div>
|
||||
<br class="clear" />
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="imgedit-sizer-<?php echo $post_id; ?>" value="<?php echo $sizer; ?>" />
|
||||
<input type="hidden" id="imgedit-minthumb-<?php echo $post_id; ?>" value="<?php echo ( get_option('thumbnail_size_w') . ':' . get_option('thumbnail_size_h') ); ?>" />
|
||||
<input type="hidden" id="imgedit-history-<?php echo $post_id; ?>" value="" />
|
||||
<input type="hidden" id="imgedit-undone-<?php echo $post_id; ?>" value="0" />
|
||||
<input type="hidden" id="imgedit-selection-<?php echo $post_id; ?>" value="" />
|
||||
<input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo $meta['width']; ?>" />
|
||||
<input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo $meta['height']; ?>" />
|
||||
|
||||
<div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap">
|
||||
<img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url('admin-ajax.php'); ?>?action=imgedit-preview&_ajax_nonce=<?php echo $nonce; ?>&postid=<?php echo $post_id; ?>&rand=<?php echo rand(1, 99999); ?>" />
|
||||
</div>
|
||||
|
||||
<div class="imgedit-submit">
|
||||
<input type="button" onclick="imageEdit.close(<?php echo $post_id; ?>, 1)" class="button" value="<?php esc_attr_e( 'Cancel' ); ?>" />
|
||||
<input type="button" onclick="imageEdit.save(<?php echo "$post_id, '$nonce'"; ?>)" disabled="disabled" class="button-primary imgedit-submit-btn" value="<?php esc_attr_e( 'Save' ); ?>" />
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="imgedit-settings">
|
||||
<div class="imgedit-group">
|
||||
<div class="imgedit-group-top">
|
||||
<a class="imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" href="#"><strong><?php _e('Scale Image'); ?></strong></a>
|
||||
<div class="imgedit-help">
|
||||
<p><?php _e('You can proportionally scale the original image. For best results the scaling should be done before performing any other operations on it like crop, rotate, etc. Note that if you make the image larger it may become fuzzy.'); ?></p>
|
||||
<p><?php printf( __('Original dimensions %s'), $meta['width'] . '×' . $meta['height'] ); ?></p>
|
||||
<div class="imgedit-submit">
|
||||
<span class="nowrap"><input type="text" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" style="width:4em;" value="<?php echo $meta['width']; ?>" />×<input type="text" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" style="width:4em;" value="<?php echo $meta['height']; ?>" />
|
||||
<span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>">!</span></span>
|
||||
<input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button-primary" value="<?php esc_attr_e( 'Scale' ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ( $can_restore ) { ?>
|
||||
|
||||
<div class="imgedit-group-top">
|
||||
<a class="imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" href="#"><strong><?php _e('Restore Original Image'); ?></strong></a>
|
||||
<div class="imgedit-help">
|
||||
<p><?php _e('Discard any changes and restore the original image.');
|
||||
|
||||
if ( !defined('IMAGE_EDIT_OVERWRITE') || !IMAGE_EDIT_OVERWRITE )
|
||||
_e(' Previously edited copies of the image will not be deleted.');
|
||||
|
||||
?></p>
|
||||
<div class="imgedit-submit">
|
||||
<input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'restore')" class="button-primary" value="<?php esc_attr_e( 'Restore image' ); ?>" <?php echo $can_restore; ?> />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="imgedit-group">
|
||||
<div class="imgedit-group-top">
|
||||
<strong><?php _e('Image Crop'); ?></strong>
|
||||
<a class="imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" href="#"><?php _e('(help)'); ?></a>
|
||||
<div class="imgedit-help">
|
||||
<p><?php _e('The image can be cropped by clicking on it and dragging to select the desired part. While dragging the dimensions of the selection are displayed below.'); ?></p>
|
||||
<strong><?php _e('Keyboard shortcuts'); ?></strong>
|
||||
<ul>
|
||||
<li><?php _e('Arrow: move by 10px'); ?></li>
|
||||
<li><?php _e('Shift + arrow: move by 1px'); ?></li>
|
||||
<li><?php _e('Ctrl + arrow: resize by 10px'); ?></li>
|
||||
<li><?php _e('Ctrl + Shift + arrow: resize by 1px'); ?></li>
|
||||
<li><?php _e('Shift + drag: lock aspect ratio'); ?></li>
|
||||
</ul>
|
||||
|
||||
<p><strong><?php _e('Crop Aspect Ratio'); ?></strong><br />
|
||||
<?php _e('You can specify the crop selection aspect ratio then hold down the Shift key while dragging to lock it. The values can be 1:1 (square), 4:3, 16:9, etc. If there is a selection, specifying aspect ratio will set it immediately.'); ?></p>
|
||||
|
||||
<p><strong><?php _e('Crop Selection'); ?></strong><br />
|
||||
<?php _e('Once started, the selection can be adjusted by entering new values (in pixels). Note that these values are scaled to approximately match the original image dimensions. The minimum selection size equals the thumbnail size as set in the Media settings.'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<?php _e('Aspect ratio:'); ?>
|
||||
<span class="nowrap">
|
||||
<input type="text" id="imgedit-crop-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" style="width:3em;" />
|
||||
:
|
||||
<input type="text" id="imgedit-crop-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" style="width:3em;" />
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<p id="imgedit-crop-sel-<?php echo $post_id; ?>">
|
||||
<?php _e('Selection:'); ?>
|
||||
<span class="nowrap">
|
||||
<input type="text" id="imgedit-sel-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>)" style="width:4em;" />
|
||||
:
|
||||
<input type="text" id="imgedit-sel-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>)" style="width:4em;" />
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php if ( $thumb && $sub_sizes ) {
|
||||
$thumb_img = wp_constrain_dimensions( $thumb['width'], $thumb['height'], 160, 120 );
|
||||
?>
|
||||
|
||||
<div class="imgedit-group imgedit-applyto">
|
||||
<div class="imgedit-group-top">
|
||||
<strong><?php _e('Thumbnail Settings'); ?></strong>
|
||||
<a class="imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" href="#"><?php _e('(help)'); ?></a>
|
||||
<p class="imgedit-help"><?php _e('The thumbnail image can be cropped differently. For example it can be square or contain only a portion of the original image to showcase it better. Here you can select whether to apply changes to all image sizes or make the thumbnail different.'); ?></p>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<img src="<?php echo $thumb['url']; ?>" width="<?php echo $thumb_img[0]; ?>" height="<?php echo $thumb_img[1]; ?>" class="imgedit-size-preview" alt="" /><br /><?php _e('Current thumbnail'); ?>
|
||||
</p>
|
||||
|
||||
<p id="imgedit-save-target-<?php echo $post_id; ?>">
|
||||
<strong><?php _e('Apply changes to:'); ?></strong><br />
|
||||
|
||||
<label class="imgedit-label">
|
||||
<input type="radio" name="imgedit-target-<?php echo $post_id; ?>" value="all" checked="checked" />
|
||||
<?php _e('All image sizes'); ?></label>
|
||||
|
||||
<label class="imgedit-label">
|
||||
<input type="radio" name="imgedit-target-<?php echo $post_id; ?>" value="thumbnail" />
|
||||
<?php _e('Thumbnail'); ?></label>
|
||||
|
||||
<label class="imgedit-label">
|
||||
<input type="radio" name="imgedit-target-<?php echo $post_id; ?>" value="nothumb" />
|
||||
<?php _e('All sizes except thumbnail'); ?></label>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
<div class="imgedit-wait" id="imgedit-wait-<?php echo $post_id; ?>"></div>
|
||||
<script type="text/javascript">imageEdit.init(<?php echo $post_id; ?>);</script>
|
||||
<div class="hidden" id="imgedit-leaving-<?php echo $post_id; ?>"><?php _e("There are unsaved changes that will be lost. 'OK' to continue, 'Cancel' to return to the Image Editor."); ?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
function load_image_to_edit($post_id, $mime_type, $size = 'full') {
|
||||
$filepath = get_attached_file($post_id);
|
||||
|
||||
if ( $filepath && file_exists($filepath) ) {
|
||||
if ( 'full' != $size && ( $data = image_get_intermediate_size($post_id, $size) ) )
|
||||
$filepath = path_join( dirname($filepath), $data['file'] );
|
||||
} elseif ( WP_Http_Fopen::test() ) {
|
||||
$filepath = wp_get_attachment_url($post_id);
|
||||
}
|
||||
|
||||
$filepath = apply_filters('load_image_to_edit_path', $filepath, $post_id, $size);
|
||||
if ( empty($filepath) )
|
||||
return false;
|
||||
|
||||
switch ( $mime_type ) {
|
||||
case 'image/jpeg':
|
||||
$image = imagecreatefromjpeg($filepath);
|
||||
break;
|
||||
case 'image/png':
|
||||
$image = imagecreatefrompng($filepath);
|
||||
break;
|
||||
case 'image/gif':
|
||||
$image = imagecreatefromgif($filepath);
|
||||
break;
|
||||
default:
|
||||
$image = false;
|
||||
break;
|
||||
}
|
||||
if ( is_resource($image) ) {
|
||||
$image = apply_filters('load_image_to_edit', $image, $post_id, $size);
|
||||
if ( function_exists('imagealphablending') && function_exists('imagesavealpha') ) {
|
||||
imagealphablending($image, false);
|
||||
imagesavealpha($image, true);
|
||||
}
|
||||
}
|
||||
return $image;
|
||||
}
|
||||
|
||||
function wp_stream_image($image, $mime_type, $post_id) {
|
||||
$image = apply_filters('image_save_pre', $image, $post_id);
|
||||
|
||||
switch ( $mime_type ) {
|
||||
case 'image/jpeg':
|
||||
header('Content-Type: image/jpeg');
|
||||
return imagejpeg($image, null, 90);
|
||||
case 'image/png':
|
||||
header('Content-Type: image/png');
|
||||
return imagepng($image);
|
||||
case 'image/gif':
|
||||
header('Content-Type: image/gif');
|
||||
return imagegif($image);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function wp_save_image_file($filename, $image, $mime_type, $post_id) {
|
||||
$image = apply_filters('image_save_pre', $image, $post_id);
|
||||
$saved = apply_filters('wp_save_image_file', null, $filename, $image, $mime_type, $post_id);
|
||||
if ( null !== $saved )
|
||||
return $saved;
|
||||
|
||||
switch ( $mime_type ) {
|
||||
case 'image/jpeg':
|
||||
return imagejpeg( $image, $filename, apply_filters( 'jpeg_quality', 90, 'edit_image' ) );
|
||||
case 'image/png':
|
||||
return imagepng($image, $filename);
|
||||
case 'image/gif':
|
||||
return imagegif($image, $filename);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function _image_get_preview_ratio($w, $h) {
|
||||
$max = max($w, $h);
|
||||
return $max > 400 ? (400 / $max) : 1;
|
||||
}
|
||||
|
||||
function _rotate_image_resource($img, $angle) {
|
||||
if ( function_exists('imagerotate') ) {
|
||||
$rotated = imagerotate($img, $angle, 0);
|
||||
if ( is_resource($rotated) ) {
|
||||
imagedestroy($img);
|
||||
$img = $rotated;
|
||||
}
|
||||
}
|
||||
return $img;
|
||||
}
|
||||
|
||||
|
||||
function _flip_image_resource($img, $horz, $vert) {
|
||||
$w = imagesx($img);
|
||||
$h = imagesy($img);
|
||||
$dst = wp_imagecreatetruecolor($w, $h);
|
||||
if ( is_resource($dst) ) {
|
||||
$sx = $vert ? ($w - 1) : 0;
|
||||
$sy = $horz ? ($h - 1) : 0;
|
||||
$sw = $vert ? -$w : $w;
|
||||
$sh = $horz ? -$h : $h;
|
||||
|
||||
if ( imagecopyresampled($dst, $img, 0, 0, $sx, $sy, $w, $h, $sw, $sh) ) {
|
||||
imagedestroy($img);
|
||||
$img = $dst;
|
||||
}
|
||||
}
|
||||
return $img;
|
||||
}
|
||||
|
||||
function _crop_image_resource($img, $x, $y, $w, $h) {
|
||||
$dst = wp_imagecreatetruecolor($w, $h);
|
||||
if ( is_resource($dst) ) {
|
||||
if ( imagecopy($dst, $img, 0, 0, $x, $y, $w, $h) ) {
|
||||
imagedestroy($img);
|
||||
$img = $dst;
|
||||
}
|
||||
}
|
||||
return $img;
|
||||
}
|
||||
|
||||
function image_edit_apply_changes($img, $changes) {
|
||||
|
||||
if ( !is_array($changes) )
|
||||
return $img;
|
||||
|
||||
// expand change operations
|
||||
foreach ( $changes as $key => $obj ) {
|
||||
if ( isset($obj->r) ) {
|
||||
$obj->type = 'rotate';
|
||||
$obj->angle = $obj->r;
|
||||
unset($obj->r);
|
||||
} elseif ( isset($obj->f) ) {
|
||||
$obj->type = 'flip';
|
||||
$obj->axis = $obj->f;
|
||||
unset($obj->f);
|
||||
} elseif ( isset($obj->c) ) {
|
||||
$obj->type = 'crop';
|
||||
$obj->sel = $obj->c;
|
||||
unset($obj->c);
|
||||
}
|
||||
$changes[$key] = $obj;
|
||||
}
|
||||
|
||||
// combine operations
|
||||
if ( count($changes) > 1 ) {
|
||||
$filtered = array($changes[0]);
|
||||
for ( $i = 0, $j = 1; $j < count($changes); $j++ ) {
|
||||
$combined = false;
|
||||
if ( $filtered[$i]->type == $changes[$j]->type ) {
|
||||
switch ( $filtered[$i]->type ) {
|
||||
case 'rotate':
|
||||
$filtered[$i]->angle += $changes[$j]->angle;
|
||||
$combined = true;
|
||||
break;
|
||||
case 'flip':
|
||||
$filtered[$i]->axis ^= $changes[$j]->axis;
|
||||
$combined = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( !$combined )
|
||||
$filtered[++$i] = $changes[$j];
|
||||
}
|
||||
$changes = $filtered;
|
||||
unset($filtered);
|
||||
}
|
||||
|
||||
// image resource before applying the changes
|
||||
$img = apply_filters('image_edit_before_change', $img, $changes);
|
||||
|
||||
foreach ( $changes as $operation ) {
|
||||
switch ( $operation->type ) {
|
||||
case 'rotate':
|
||||
if ( $operation->angle != 0 )
|
||||
$img = _rotate_image_resource($img, $operation->angle);
|
||||
break;
|
||||
case 'flip':
|
||||
if ( $operation->axis != 0 )
|
||||
$img = _flip_image_resource($img, ($operation->axis & 1) != 0, ($operation->axis & 2) != 0);
|
||||
break;
|
||||
case 'crop':
|
||||
$sel = $operation->sel;
|
||||
$scale = 1 / _image_get_preview_ratio( imagesx($img), imagesy($img) ); // discard preview scaling
|
||||
$img = _crop_image_resource($img, $sel->x * $scale, $sel->y * $scale, $sel->w * $scale, $sel->h * $scale);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $img;
|
||||
}
|
||||
|
||||
function stream_preview_image($post_id) {
|
||||
$post = get_post($post_id);
|
||||
@ini_set('memory_limit', '256M');
|
||||
$img = load_image_to_edit( $post_id, $post->post_mime_type, array(400, 400) );
|
||||
|
||||
if ( !is_resource($img) )
|
||||
return false;
|
||||
|
||||
$changes = !empty($_REQUEST['history']) ? json_decode( stripslashes($_REQUEST['history']) ) : null;
|
||||
if ( $changes )
|
||||
$img = image_edit_apply_changes($img, $changes);
|
||||
|
||||
// scale the image
|
||||
$w = imagesx($img);
|
||||
$h = imagesy($img);
|
||||
$ratio = _image_get_preview_ratio($w, $h);
|
||||
$w2 = $w * $ratio;
|
||||
$h2 = $h * $ratio;
|
||||
|
||||
$preview = wp_imagecreatetruecolor($w2, $h2);
|
||||
imagecopyresampled( $preview, $img, 0, 0, 0, 0, $w2, $h2, $w, $h );
|
||||
wp_stream_image($preview, $post->post_mime_type, $post_id);
|
||||
|
||||
imagedestroy($preview);
|
||||
imagedestroy($img);
|
||||
return true;
|
||||
}
|
||||
|
||||
function wp_restore_image($post_id) {
|
||||
$meta = wp_get_attachment_metadata($post_id);
|
||||
$file = get_attached_file($post_id);
|
||||
$backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
|
||||
$restored = false;
|
||||
$msg = '';
|
||||
|
||||
if ( !is_array($backup_sizes) ) {
|
||||
$msg->error = __('Cannot load image metadata.');
|
||||
return $msg;
|
||||
}
|
||||
|
||||
$parts = pathinfo($file);
|
||||
$suffix = time() . rand(100, 999);
|
||||
$default_sizes = apply_filters( 'intermediate_image_sizes', array('large', 'medium', 'thumbnail') );
|
||||
|
||||
if ( isset($backup_sizes['full-orig']) && is_array($backup_sizes['full-orig']) ) {
|
||||
$data = $backup_sizes['full-orig'];
|
||||
|
||||
if ( $parts['basename'] != $data['file'] ) {
|
||||
if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE ) {
|
||||
// delete only if it's edited image
|
||||
if ( preg_match('/-e[0-9]{13}\./', $parts['basename']) ) {
|
||||
$delpath = apply_filters('wp_delete_file', $file);
|
||||
@unlink($delpath);
|
||||
}
|
||||
} else {
|
||||
$backup_sizes["full-$suffix"] = array('width' => $meta['width'], 'height' => $meta['height'], 'file' => $parts['basename']);
|
||||
}
|
||||
}
|
||||
|
||||
$restored_file = path_join($parts['dirname'], $data['file']);
|
||||
$restored = update_attached_file($post_id, $restored_file);
|
||||
|
||||
$meta['file'] = _wp_relative_upload_path( $restored_file );
|
||||
$meta['width'] = $data['width'];
|
||||
$meta['height'] = $data['height'];
|
||||
list ( $uwidth, $uheight ) = wp_shrink_dimensions($meta['width'], $meta['height']);
|
||||
$meta['hwstring_small'] = "height='$uheight' width='$uwidth'";
|
||||
}
|
||||
|
||||
foreach ( $default_sizes as $default_size ) {
|
||||
if ( isset($backup_sizes["$default_size-orig"]) ) {
|
||||
$data = $backup_sizes["$default_size-orig"];
|
||||
if ( isset($meta['sizes'][$default_size]) && $meta['sizes'][$default_size]['file'] != $data['file'] ) {
|
||||
if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE ) {
|
||||
// delete only if it's edited image
|
||||
if ( preg_match('/-e[0-9]{13}-/', $meta['sizes'][$default_size]['file']) ) {
|
||||
$delpath = apply_filters( 'wp_delete_file', path_join($parts['dirname'], $meta['sizes'][$default_size]['file']) );
|
||||
@unlink($delpath);
|
||||
}
|
||||
} else {
|
||||
$backup_sizes["$default_size-{$suffix}"] = $meta['sizes'][$default_size];
|
||||
}
|
||||
}
|
||||
|
||||
$meta['sizes'][$default_size] = $data;
|
||||
} else {
|
||||
unset($meta['sizes'][$default_size]);
|
||||
}
|
||||
}
|
||||
|
||||
if ( !wp_update_attachment_metadata($post_id, $meta) || !update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes) ) {
|
||||
$msg->error = __('Cannot save image metadata.');
|
||||
return $msg;
|
||||
}
|
||||
|
||||
if ( !$restored )
|
||||
$msg->error = __('Image metadata is inconsistent.');
|
||||
else
|
||||
$msg->msg = __('Image restored successfully.');
|
||||
|
||||
return $msg;
|
||||
}
|
||||
|
||||
function wp_save_image($post_id) {
|
||||
$return = '';
|
||||
$success = $delete = $scaled = $nocrop = false;
|
||||
$post = get_post($post_id);
|
||||
@ini_set('memory_limit', '256M');
|
||||
$img = load_image_to_edit($post_id, $post->post_mime_type);
|
||||
|
||||
if ( !is_resource($img) ) {
|
||||
$return->error = esc_js( __('Unable to create new image.') );
|
||||
return $return;
|
||||
}
|
||||
|
||||
$fwidth = !empty($_REQUEST['fwidth']) ? intval($_REQUEST['fwidth']) : 0;
|
||||
$fheight = !empty($_REQUEST['fheight']) ? intval($_REQUEST['fheight']) : 0;
|
||||
$target = !empty($_REQUEST['target']) ? preg_replace('/[^a-z0-9_-]+/i', '', $_REQUEST['target']) : '';
|
||||
$scale = !empty($_REQUEST['do']) && 'scale' == $_REQUEST['do'];
|
||||
|
||||
if ( $scale && $fwidth > 0 && $fheight > 0 ) {
|
||||
$sX = imagesx($img);
|
||||
$sY = imagesy($img);
|
||||
|
||||
// check if it has roughly the same w / h ratio
|
||||
$diff = round($sX / $sY, 2) - round($fwidth / $fheight, 2);
|
||||
if ( -0.1 < $diff && $diff < 0.1 ) {
|
||||
// scale the full size image
|
||||
$dst = wp_imagecreatetruecolor($fwidth, $fheight);
|
||||
if ( imagecopyresampled( $dst, $img, 0, 0, 0, 0, $fwidth, $fheight, $sX, $sY ) ) {
|
||||
imagedestroy($img);
|
||||
$img = $dst;
|
||||
$scaled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !$scaled ) {
|
||||
$return->error = esc_js( __('Error while saving the scaled image. Please reload the page and try again.') );
|
||||
return $return;
|
||||
}
|
||||
} elseif ( !empty($_REQUEST['history']) ) {
|
||||
$changes = json_decode( stripslashes($_REQUEST['history']) );
|
||||
if ( $changes )
|
||||
$img = image_edit_apply_changes($img, $changes);
|
||||
} else {
|
||||
$return->error = esc_js( __('Nothing to save, the image has not changed.') );
|
||||
return $return;
|
||||
}
|
||||
|
||||
$meta = wp_get_attachment_metadata($post_id);
|
||||
$backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true );
|
||||
|
||||
if ( !is_array($meta) ) {
|
||||
$return->error = esc_js( __('Image data does not exist. Please re-upload the image.') );
|
||||
return $return;
|
||||
}
|
||||
|
||||
if ( !is_array($backup_sizes) )
|
||||
$backup_sizes = array();
|
||||
|
||||
// generate new filename
|
||||
$path = get_attached_file($post_id);
|
||||
$path_parts = pathinfo52( $path );
|
||||
$filename = $path_parts['filename'];
|
||||
$suffix = time() . rand(100, 999);
|
||||
|
||||
if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE &&
|
||||
isset($backup_sizes['full-orig']) && $backup_sizes['full-orig']['file'] != $path_parts['basename'] ) {
|
||||
|
||||
if ( 'thumbnail' == $target )
|
||||
$new_path = "{$path_parts['dirname']}/{$filename}-temp.{$path_parts['extension']}";
|
||||
else
|
||||
$new_path = $path;
|
||||
} else {
|
||||
while( true ) {
|
||||
$filename = preg_replace( '/-e([0-9]+)$/', '', $filename );
|
||||
$filename .= "-e{$suffix}";
|
||||
$new_filename = "{$filename}.{$path_parts['extension']}";
|
||||
$new_path = "{$path_parts['dirname']}/$new_filename";
|
||||
if ( file_exists($new_path) )
|
||||
$suffix++;
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// save the full-size file, also needed to create sub-sizes
|
||||
if ( !wp_save_image_file($new_path, $img, $post->post_mime_type, $post_id) ) {
|
||||
$return->error = esc_js( __('Unable to save the image.') );
|
||||
return $return;
|
||||
}
|
||||
|
||||
if ( 'nothumb' == $target || 'all' == $target || 'full' == $target || $scaled ) {
|
||||
$tag = false;
|
||||
if ( isset($backup_sizes['full-orig']) ) {
|
||||
if ( ( !defined('IMAGE_EDIT_OVERWRITE') || !IMAGE_EDIT_OVERWRITE ) && $backup_sizes['full-orig']['file'] != $path_parts['basename'] )
|
||||
$tag = "full-$suffix";
|
||||
} else {
|
||||
$tag = 'full-orig';
|
||||
}
|
||||
|
||||
if ( $tag )
|
||||
$backup_sizes[$tag] = array('width' => $meta['width'], 'height' => $meta['height'], 'file' => $path_parts['basename']);
|
||||
|
||||
$success = update_attached_file($post_id, $new_path);
|
||||
|
||||
$meta['file'] = _wp_relative_upload_path($new_path);
|
||||
$meta['width'] = imagesx($img);
|
||||
$meta['height'] = imagesy($img);
|
||||
|
||||
list ( $uwidth, $uheight ) = wp_shrink_dimensions($meta['width'], $meta['height']);
|
||||
$meta['hwstring_small'] = "height='$uheight' width='$uwidth'";
|
||||
|
||||
if ( $success && ('nothumb' == $target || 'all' == $target) ) {
|
||||
$sizes = apply_filters( 'intermediate_image_sizes', array('large', 'medium', 'thumbnail') );
|
||||
if ( 'nothumb' == $target )
|
||||
$sizes = array_diff( $sizes, array('thumbnail') );
|
||||
}
|
||||
|
||||
$return->fw = $meta['width'];
|
||||
$return->fh = $meta['height'];
|
||||
} elseif ( 'thumbnail' == $target ) {
|
||||
$sizes = array( 'thumbnail' );
|
||||
$success = $delete = $nocrop = true;
|
||||
}
|
||||
|
||||
if ( isset($sizes) ) {
|
||||
foreach ( $sizes as $size ) {
|
||||
$tag = false;
|
||||
if ( isset($meta['sizes'][$size]) ) {
|
||||
if ( isset($backup_sizes["$size-orig"]) ) {
|
||||
if ( ( !defined('IMAGE_EDIT_OVERWRITE') || !IMAGE_EDIT_OVERWRITE ) && $backup_sizes["$size-orig"]['file'] != $meta['sizes'][$size]['file'] )
|
||||
$tag = "$size-$suffix";
|
||||
} else {
|
||||
$tag = "$size-orig";
|
||||
}
|
||||
|
||||
if ( $tag )
|
||||
$backup_sizes[$tag] = $meta['sizes'][$size];
|
||||
}
|
||||
|
||||
$crop = $nocrop ? false : get_option("{$size}_crop");
|
||||
$resized = image_make_intermediate_size($new_path, get_option("{$size}_size_w"), get_option("{$size}_size_h"), $crop );
|
||||
|
||||
if ( $resized )
|
||||
$meta['sizes'][$size] = $resized;
|
||||
else
|
||||
unset($meta['sizes'][$size]);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $success ) {
|
||||
wp_update_attachment_metadata($post_id, $meta);
|
||||
update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes);
|
||||
|
||||
if ( $target == 'thumbnail' || $target == 'all' || $target == 'full' ) {
|
||||
$file_url = wp_get_attachment_url($post_id);
|
||||
if ( $thumb = $meta['sizes']['thumbnail'] )
|
||||
$return->thumbnail = path_join( dirname($file_url), $thumb['file'] );
|
||||
else
|
||||
$return->thumbnail = "$file_url?w=128&h=128";
|
||||
}
|
||||
} else {
|
||||
$delete = true;
|
||||
}
|
||||
|
||||
if ( $delete ) {
|
||||
$delpath = apply_filters('wp_delete_file', $new_path);
|
||||
@unlink($delpath);
|
||||
}
|
||||
|
||||
imagedestroy($img);
|
||||
|
||||
$return->msg = esc_js( __('Image saved') );
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_
|
||||
if ( !is_resource( $src ))
|
||||
return $src;
|
||||
|
||||
$dst = wp_imagecreatetruecolor( $dst_w, $dst_h );
|
||||
$dst = imagecreatetruecolor( $dst_w, $dst_h );
|
||||
|
||||
if ( $src_abs ) {
|
||||
$src_w -= $src_x;
|
||||
@@ -75,7 +75,7 @@ function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate post thumbnail attachment meta data.
|
||||
* Generate post image attachment meta data.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*
|
||||
@@ -88,55 +88,40 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
|
||||
|
||||
$metadata = array();
|
||||
if ( preg_match('!^image/!', get_post_mime_type( $attachment )) && file_is_displayable_image($file) ) {
|
||||
$imagesize = getimagesize( $file );
|
||||
$full_path_file = $file;
|
||||
$imagesize = getimagesize( $full_path_file );
|
||||
$metadata['width'] = $imagesize[0];
|
||||
$metadata['height'] = $imagesize[1];
|
||||
list($uwidth, $uheight) = wp_shrink_dimensions($metadata['width'], $metadata['height']);
|
||||
$metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
|
||||
|
||||
// Make the file path relative to the upload dir
|
||||
$metadata['file'] = _wp_relative_upload_path($file);
|
||||
if ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) { // Get upload directory
|
||||
if ( 0 === strpos($file, $uploads['basedir']) ) {// Check that the upload base exists in the file path
|
||||
$file = str_replace($uploads['basedir'], '', $file); // Remove upload dir from the file path
|
||||
$file = ltrim($file, '/');
|
||||
}
|
||||
}
|
||||
$metadata['file'] = $file;
|
||||
|
||||
// make thumbnails and other intermediate sizes
|
||||
global $_wp_additional_image_sizes;
|
||||
$temp_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes
|
||||
if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) )
|
||||
$temp_sizes = array_merge( $temp_sizes, array_keys( $_wp_additional_image_sizes ) );
|
||||
$sizes = array('thumbnail', 'medium', 'large');
|
||||
$sizes = apply_filters('intermediate_image_sizes', $sizes);
|
||||
|
||||
$temp_sizes = apply_filters( 'intermediate_image_sizes', $temp_sizes );
|
||||
|
||||
foreach ( $temp_sizes as $s ) {
|
||||
$sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => FALSE );
|
||||
if ( isset( $_wp_additional_image_sizes[$s]['width'] ) )
|
||||
$sizes[$s]['width'] = intval( $_wp_additional_image_sizes[$s]['width'] ); // For theme-added sizes
|
||||
else
|
||||
$sizes[$s]['width'] = get_option( "{$s}_size_w" ); // For default sizes set in options
|
||||
if ( isset( $_wp_additional_image_sizes[$s]['height'] ) )
|
||||
$sizes[$s]['height'] = intval( $_wp_additional_image_sizes[$s]['height'] ); // For theme-added sizes
|
||||
else
|
||||
$sizes[$s]['height'] = get_option( "{$s}_size_h" ); // For default sizes set in options
|
||||
if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) )
|
||||
$sizes[$s]['crop'] = intval( $_wp_additional_image_sizes[$s]['crop'] ); // For theme-added sizes
|
||||
else
|
||||
$sizes[$s]['crop'] = get_option( "{$s}_crop" ); // For default sizes set in options
|
||||
}
|
||||
|
||||
$sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
|
||||
|
||||
foreach ($sizes as $size => $size_data ) {
|
||||
$resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
|
||||
foreach ($sizes as $size) {
|
||||
$resized = image_make_intermediate_size( $full_path_file, get_option("{$size}_size_w"), get_option("{$size}_size_h"), get_option("{$size}_crop") );
|
||||
if ( $resized )
|
||||
$metadata['sizes'][$size] = $resized;
|
||||
}
|
||||
|
||||
// fetch additional metadata from exif/iptc
|
||||
$image_meta = wp_read_image_metadata( $file );
|
||||
if ( $image_meta )
|
||||
$image_meta = wp_read_image_metadata( $full_path_file );
|
||||
if ($image_meta)
|
||||
$metadata['image_meta'] = $image_meta;
|
||||
|
||||
}
|
||||
|
||||
return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
|
||||
return apply_filters( 'wp_generate_attachment_metadata', $metadata );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -341,3 +326,5 @@ function file_is_displayable_image($path) {
|
||||
|
||||
return apply_filters('file_is_displayable_image', $result, $path);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -59,11 +59,6 @@ function wp_import_cleanup( $id ) {
|
||||
* @return array
|
||||
*/
|
||||
function wp_import_handle_upload() {
|
||||
if ( !isset($_FILES['import']) ) {
|
||||
$file['error'] = __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' );
|
||||
return $file;
|
||||
}
|
||||
|
||||
$overrides = array( 'test_form' => false, 'test_type' => false );
|
||||
$_FILES['import']['name'] .= '.txt';
|
||||
$file = wp_handle_upload( $_FILES['import'], $overrides );
|
||||
|
||||
@@ -40,10 +40,8 @@ function update_gallery_tab($tabs) {
|
||||
return $tabs;
|
||||
}
|
||||
|
||||
$post_id = intval($_REQUEST['post_id']);
|
||||
|
||||
if ( $post_id )
|
||||
$attachments = intval( $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent = %d", $post_id ) ) );
|
||||
if ( intval($_REQUEST['post_id']) )
|
||||
$attachments = intval($wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = %d", $_REQUEST['post_id'])));
|
||||
|
||||
if ( empty($attachments) ) {
|
||||
unset($tabs['gallery']);
|
||||
@@ -100,16 +98,18 @@ function the_media_upload_tabs() {
|
||||
* @param unknown_type $size
|
||||
* @return unknown
|
||||
*/
|
||||
function get_image_send_to_editor($id, $caption, $title, $align, $url='', $rel = false, $size='medium', $alt = '') {
|
||||
function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = false, $size='medium') {
|
||||
|
||||
$html = get_image_tag($id, $alt, $title, $align, $size);
|
||||
$htmlalt = ( empty($alt) ) ? $title : $alt;
|
||||
|
||||
$html = get_image_tag($id, $htmlalt, $title, $align, $size);
|
||||
|
||||
$rel = $rel ? ' rel="attachment wp-att-' . esc_attr($id).'"' : '';
|
||||
|
||||
if ( $url )
|
||||
$html = '<a href="' . esc_attr($url) . "\"$rel>$html</a>";
|
||||
$html = '<a href="' . esc_url($url) . "\"$rel>$html</a>";
|
||||
|
||||
$html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt );
|
||||
$html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size );
|
||||
|
||||
return $html;
|
||||
}
|
||||
@@ -128,14 +128,15 @@ function get_image_send_to_editor($id, $caption, $title, $align, $url='', $rel =
|
||||
* @param unknown_type $size
|
||||
* @return unknown
|
||||
*/
|
||||
function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ) {
|
||||
function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) {
|
||||
|
||||
if ( empty($caption) || apply_filters( 'disable_captions', '' ) )
|
||||
if ( empty($alt) || apply_filters( 'disable_captions', '' ) )
|
||||
return $html;
|
||||
|
||||
$id = ( 0 < (int) $id ) ? 'attachment_' . $id : '';
|
||||
|
||||
if ( ! preg_match( '/width="([0-9]+)/', $html, $matches ) )
|
||||
preg_match( '/width="([0-9]+)/', $html, $matches );
|
||||
if ( ! isset($matches[1]) )
|
||||
return $html;
|
||||
|
||||
$width = $matches[1];
|
||||
@@ -144,12 +145,14 @@ function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $
|
||||
if ( empty($align) )
|
||||
$align = 'none';
|
||||
|
||||
$alt = ! empty($alt) ? addslashes($alt) : '';
|
||||
|
||||
$shcode = '[caption id="' . $id . '" align="align' . $align
|
||||
. '" width="' . $width . '" caption="' . addslashes($caption) . '"]' . $html . '[/caption]';
|
||||
. '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/caption]';
|
||||
|
||||
return apply_filters( 'image_add_caption_shortcode', $shcode, $html );
|
||||
}
|
||||
add_filter( 'image_send_to_editor', 'image_add_caption', 20, 8 );
|
||||
add_filter( 'image_send_to_editor', 'image_add_caption', 20, 7 );
|
||||
|
||||
/**
|
||||
* {@internal Missing Short Description}}
|
||||
@@ -166,7 +169,7 @@ var win = window.dialogArguments || opener || parent || top;
|
||||
win.send_to_editor('<?php echo addslashes($html); ?>');
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php
|
||||
<?php
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -246,8 +249,8 @@ function media_handle_upload($file_id, $post_id, $post_data = array()) {
|
||||
*/
|
||||
function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = array()) {
|
||||
$overrides = array('test_form'=>false);
|
||||
|
||||
$file = wp_handle_sideload($file_array, $overrides);
|
||||
|
||||
if ( isset($file['error']) )
|
||||
return new WP_Error( 'upload_error', $file['error'] );
|
||||
|
||||
@@ -276,7 +279,7 @@ function media_handle_sideload($file_array, $post_id, $desc = null, $post_data =
|
||||
'post_content' => $content,
|
||||
), $post_data );
|
||||
|
||||
// Save the attachment metadata
|
||||
// Save the data
|
||||
$id = wp_insert_attachment($attachment, $file, $post_id);
|
||||
if ( !is_wp_error($id) ) {
|
||||
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
|
||||
@@ -313,19 +316,13 @@ wp_enqueue_style( 'ie' );
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
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();}}};
|
||||
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(); ?>'};
|
||||
var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup';
|
||||
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() ?>'};
|
||||
//]]>
|
||||
</script>
|
||||
<?php
|
||||
do_action('admin_enqueue_scripts', 'media-upload-popup');
|
||||
do_action('admin_print_styles-media-upload-popup');
|
||||
do_action('admin_print_styles');
|
||||
do_action('admin_print_scripts-media-upload-popup');
|
||||
do_action('admin_print_scripts');
|
||||
do_action('admin_head-media-upload-popup');
|
||||
do_action('admin_head');
|
||||
|
||||
if ( is_string($content_func) )
|
||||
do_action( "admin_head_{$content_func}" );
|
||||
?>
|
||||
@@ -408,15 +405,6 @@ function media_upload_form_handler() {
|
||||
|
||||
$post = apply_filters('attachment_fields_to_save', $post, $attachment);
|
||||
|
||||
if ( isset($attachment['image_alt']) && !empty($attachment['image_alt']) ) {
|
||||
$image_alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true);
|
||||
if ( $image_alt != stripslashes($attachment['image_alt']) ) {
|
||||
$image_alt = wp_strip_all_tags( stripslashes($attachment['image_alt']), true );
|
||||
// update_meta expects slashed
|
||||
update_post_meta( $attachment_id, '_wp_attachment_image_alt', addslashes($image_alt) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($post['errors']) ) {
|
||||
$errors[$attachment_id] = $post['errors'];
|
||||
unset($post['errors']);
|
||||
@@ -425,10 +413,9 @@ function media_upload_form_handler() {
|
||||
if ( $post != $_post )
|
||||
wp_update_post($post);
|
||||
|
||||
foreach ( get_attachment_taxonomies($post) as $t ) {
|
||||
foreach ( get_attachment_taxonomies($post) as $t )
|
||||
if ( isset($attachment[$t]) )
|
||||
wp_set_object_terms($attachment_id, array_map('trim', preg_split('/,+/', $attachment[$t])), $t, false);
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($_POST['insert-gallery']) || isset($_POST['update-gallery']) ) { ?>
|
||||
@@ -481,8 +468,6 @@ function media_upload_image() {
|
||||
}
|
||||
|
||||
if ( !empty($_POST['insertonlybutton']) ) {
|
||||
$alt = $align = '';
|
||||
|
||||
$src = $_POST['insertonly']['src'];
|
||||
if ( !empty($src) && !strpos($src, '://') )
|
||||
$src = "http://$src";
|
||||
@@ -492,9 +477,8 @@ function media_upload_image() {
|
||||
$class = " class='align$align'";
|
||||
}
|
||||
if ( !empty($src) )
|
||||
$html = "<img src='" . esc_url($src) . "' alt='$alt'$class />";
|
||||
|
||||
$html = apply_filters('image_send_to_editor_url', $html, esc_url_raw($src), $alt, $align);
|
||||
$html = "<img src='$src' alt='$alt'$class />";
|
||||
$html = apply_filters('image_send_to_editor_url', $html, $src, $alt, $align);
|
||||
return media_send_to_editor($html);
|
||||
}
|
||||
|
||||
@@ -530,33 +514,25 @@ function media_upload_image() {
|
||||
*/
|
||||
function media_sideload_image($file, $post_id, $desc = null) {
|
||||
if (!empty($file) ) {
|
||||
// Download file to temp location
|
||||
$file_array['name'] = basename($file);
|
||||
$tmp = download_url($file);
|
||||
|
||||
// Set variables for storage
|
||||
// fix file filename for query strings
|
||||
preg_match('/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $file, $matches);
|
||||
$file_array['name'] = basename($matches[0]);
|
||||
$file_array['tmp_name'] = $tmp;
|
||||
$desc = @$desc;
|
||||
|
||||
// If error storing temporarily, unlink
|
||||
if ( is_wp_error($tmp) ) {
|
||||
@unlink($file_array['tmp_name']);
|
||||
$file_array['tmp_name'] = '';
|
||||
}
|
||||
|
||||
// do the validation and storage stuff
|
||||
$id = media_handle_sideload($file_array, $post_id, @$desc);
|
||||
$id = media_handle_sideload($file_array, $post_id, $desc);
|
||||
$src = $id;
|
||||
|
||||
// If error storing permanently, unlink
|
||||
if ( is_wp_error($id) ) {
|
||||
@unlink($file_array['tmp_name']);
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
|
||||
// Finally check to make sure the file has been saved, then return the html
|
||||
if ( !empty($src) ) {
|
||||
$alt = @$desc;
|
||||
$html = "<img src='$src' alt='$alt' />";
|
||||
@@ -589,16 +565,12 @@ function media_upload_audio() {
|
||||
$href = $_POST['insertonly']['href'];
|
||||
if ( !empty($href) && !strpos($href, '://') )
|
||||
$href = "http://$href";
|
||||
|
||||
$title = esc_attr($_POST['insertonly']['title']);
|
||||
if ( empty($title) )
|
||||
$title = esc_attr( basename($href) );
|
||||
|
||||
$title = basename($href);
|
||||
if ( !empty($title) && !empty($href) )
|
||||
$html = "<a href='" . esc_url($href) . "' >$title</a>";
|
||||
|
||||
$html = "<a href='$href' >$title</a>";
|
||||
$html = apply_filters('audio_send_to_editor_url', $html, $href, $title);
|
||||
|
||||
return media_send_to_editor($html);
|
||||
}
|
||||
|
||||
@@ -647,16 +619,12 @@ function media_upload_video() {
|
||||
$href = $_POST['insertonly']['href'];
|
||||
if ( !empty($href) && !strpos($href, '://') )
|
||||
$href = "http://$href";
|
||||
|
||||
$title = esc_attr($_POST['insertonly']['title']);
|
||||
if ( empty($title) )
|
||||
$title = esc_attr( basename($href) );
|
||||
|
||||
if ( empty($title) )
|
||||
$title = basename($href);
|
||||
if ( !empty($title) && !empty($href) )
|
||||
$html = "<a href='" . esc_url($href) . "' >$title</a>";
|
||||
|
||||
$html = "<a href='$href' >$title</a>";
|
||||
$html = apply_filters('video_send_to_editor_url', $html, $href, $title);
|
||||
|
||||
return media_send_to_editor($html);
|
||||
}
|
||||
|
||||
@@ -705,13 +673,12 @@ function media_upload_file() {
|
||||
$href = $_POST['insertonly']['href'];
|
||||
if ( !empty($href) && !strpos($href, '://') )
|
||||
$href = "http://$href";
|
||||
|
||||
$title = esc_attr($_POST['insertonly']['title']);
|
||||
if ( empty($title) )
|
||||
$title = basename($href);
|
||||
if ( !empty($title) && !empty($href) )
|
||||
$html = "<a href='" . esc_url($href) . "' >$title</a>";
|
||||
$html = apply_filters('file_send_to_editor_url', $html, esc_url_raw($href), $title);
|
||||
$html = "<a href='$href' >$title</a>";
|
||||
$html = apply_filters('file_send_to_editor_url', $html, $href, $title);
|
||||
return media_send_to_editor($html);
|
||||
}
|
||||
|
||||
@@ -790,19 +757,16 @@ function media_upload_library() {
|
||||
*/
|
||||
function image_align_input_fields( $post, $checked = '' ) {
|
||||
|
||||
if ( empty($checked) )
|
||||
$checked = get_user_setting('align', 'none');
|
||||
|
||||
$alignments = array('none' => __('None'), 'left' => __('Left'), 'center' => __('Center'), 'right' => __('Right'));
|
||||
if ( !array_key_exists( (string) $checked, $alignments ) )
|
||||
$checked = 'none';
|
||||
|
||||
$out = array();
|
||||
foreach ( $alignments as $name => $label ) {
|
||||
foreach ($alignments as $name => $label) {
|
||||
$name = esc_attr($name);
|
||||
$out[] = "<input type='radio' name='attachments[{$post->ID}][align]' id='image-align-{$name}-{$post->ID}' value='$name'".
|
||||
( $checked == $name ? " checked='checked'" : "" ) .
|
||||
" /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>$label</label>";
|
||||
" /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>" . $label . "</label>";
|
||||
}
|
||||
return join("\n", $out);
|
||||
}
|
||||
@@ -816,36 +780,27 @@ function image_align_input_fields( $post, $checked = '' ) {
|
||||
* @param unknown_type $checked
|
||||
* @return unknown
|
||||
*/
|
||||
function image_size_input_fields( $post, $check = '' ) {
|
||||
function image_size_input_fields( $post, $checked = '' ) {
|
||||
|
||||
// get a list of the actual pixel dimensions of each possible intermediate version of this image
|
||||
$size_names = array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full size'));
|
||||
|
||||
if ( empty($check) )
|
||||
$check = get_user_setting('imgsize', 'medium');
|
||||
|
||||
foreach ( $size_names as $size => $label ) {
|
||||
foreach ( $size_names as $size => $name ) {
|
||||
$downsize = image_downsize($post->ID, $size);
|
||||
$checked = '';
|
||||
|
||||
// is this size selectable?
|
||||
$enabled = ( $downsize[3] || 'full' == $size );
|
||||
$css_id = "image-size-{$size}-{$post->ID}";
|
||||
// if this size is the default but that's not available, don't select it
|
||||
if ( $size == $check ) {
|
||||
if ( $enabled )
|
||||
$checked = " checked='checked'";
|
||||
else
|
||||
$check = '';
|
||||
} elseif ( !$check && $enabled && 'thumbnail' != $size ) {
|
||||
// if $check is not enabled, default to the first available size that's bigger than a thumbnail
|
||||
$check = $size;
|
||||
$checked = " checked='checked'";
|
||||
}
|
||||
if ( $checked && !$enabled )
|
||||
$checked = '';
|
||||
// if $checked was not specified, default to the first available size that's bigger than a thumbnail
|
||||
if ( !$checked && $enabled && 'thumbnail' != $size )
|
||||
$checked = $size;
|
||||
|
||||
$html = "<div class='image-size-item'><input type='radio' " . ( $enabled ? '' : "disabled='disabled' " ) . "name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'$checked />";
|
||||
$html = "<div class='image-size-item'><input type='radio' ".( $enabled ? '' : "disabled='disabled'")."name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'".( $checked == $size ? " checked='checked'" : '') ." />";
|
||||
|
||||
$html .= "<label for='{$css_id}'>$label</label>";
|
||||
$html .= "<label for='{$css_id}'>" . __($name). "</label>";
|
||||
// only show the dimensions if that choice is available
|
||||
if ( $enabled )
|
||||
$html .= " <label for='{$css_id}' class='help'>" . sprintf( __("(%d × %d)"), $downsize[1], $downsize[2] ). "</label>";
|
||||
@@ -871,25 +826,21 @@ function image_size_input_fields( $post, $check = '' ) {
|
||||
* @param unknown_type $url_type
|
||||
* @return unknown
|
||||
*/
|
||||
function image_link_input_fields($post, $url_type = '') {
|
||||
function image_link_input_fields($post, $url_type='') {
|
||||
|
||||
$file = wp_get_attachment_url($post->ID);
|
||||
$link = get_attachment_link($post->ID);
|
||||
|
||||
if ( empty($url_type) )
|
||||
$url_type = get_user_setting('urlbutton', 'post');
|
||||
|
||||
$url = '';
|
||||
if ( $url_type == 'file' )
|
||||
$url = $file;
|
||||
elseif ( $url_type == 'post' )
|
||||
$url = $link;
|
||||
|
||||
return "
|
||||
<input type='text' class='text urlfield' name='attachments[$post->ID][url]' value='" . esc_attr($url) . "' /><br />
|
||||
<button type='button' class='button urlnone' title=''>" . __('None') . "</button>
|
||||
<button type='button' class='button urlfile' title='" . esc_attr($file) . "'>" . __('File URL') . "</button>
|
||||
<button type='button' class='button urlpost' title='" . esc_attr($link) . "'>" . __('Post URL') . "</button>
|
||||
return "<input type='text' class='urlfield' name='attachments[$post->ID][url]' value='" . esc_attr($url) . "' /><br />
|
||||
<button type='button' class='button urlnone' title=''>" . __('None') . "</button>
|
||||
<button type='button' class='button urlfile' title='" . esc_attr($file) . "'>" . __('File URL') . "</button>
|
||||
<button type='button' class='button urlpost' title='" . esc_attr($link) . "'>" . __('Post URL') . "</button>
|
||||
";
|
||||
}
|
||||
|
||||
@@ -904,17 +855,15 @@ function image_link_input_fields($post, $url_type = '') {
|
||||
*/
|
||||
function image_attachment_fields_to_edit($form_fields, $post) {
|
||||
if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
|
||||
$alt = get_post_meta($post->ID, '_wp_attachment_image_alt', true);
|
||||
if ( empty($alt) )
|
||||
$alt = '';
|
||||
|
||||
$form_fields['post_title']['required'] = true;
|
||||
$file = wp_get_attachment_url($post->ID);
|
||||
|
||||
$form_fields['image_alt'] = array(
|
||||
'value' => $alt,
|
||||
'label' => __('Alternate text'),
|
||||
'helps' => __('Alt text for the image, e.g. “The Mona Lisa”')
|
||||
);
|
||||
$form_fields['image_url']['value'] = $file;
|
||||
|
||||
$form_fields['post_excerpt']['label'] = __('Caption');
|
||||
$form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image');
|
||||
|
||||
$form_fields['post_content']['label'] = __('Description');
|
||||
|
||||
$form_fields['align'] = array(
|
||||
'label' => __('Alignment'),
|
||||
@@ -922,10 +871,7 @@ function image_attachment_fields_to_edit($form_fields, $post) {
|
||||
'html' => image_align_input_fields($post, get_option('image_default_align')),
|
||||
);
|
||||
|
||||
$form_fields['image-size'] = image_size_input_fields( $post, get_option('image_default_size', 'medium') );
|
||||
|
||||
} else {
|
||||
unset( $form_fields['image_alt'] );
|
||||
$form_fields['image-size'] = image_size_input_fields($post, get_option('image_default_size'));
|
||||
}
|
||||
return $form_fields;
|
||||
}
|
||||
@@ -987,12 +933,20 @@ function image_media_send_to_editor($html, $attachment_id, $attachment) {
|
||||
$post =& get_post($attachment_id);
|
||||
if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
|
||||
$url = $attachment['url'];
|
||||
$align = !empty($attachment['align']) ? $attachment['align'] : 'none';
|
||||
$size = !empty($attachment['image-size']) ? $attachment['image-size'] : 'medium';
|
||||
$alt = !empty($attachment['image_alt']) ? $attachment['image_alt'] : '';
|
||||
|
||||
if ( isset($attachment['align']) )
|
||||
$align = $attachment['align'];
|
||||
else
|
||||
$align = 'none';
|
||||
|
||||
if ( !empty($attachment['image-size']) )
|
||||
$size = $attachment['image-size'];
|
||||
else
|
||||
$size = 'medium';
|
||||
|
||||
$rel = ( $url == get_attachment_link($attachment_id) );
|
||||
|
||||
return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size, $alt);
|
||||
return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size);
|
||||
}
|
||||
|
||||
return $html;
|
||||
@@ -1022,23 +976,22 @@ function get_attachment_fields_to_edit($post, $errors = null) {
|
||||
$form_fields = array(
|
||||
'post_title' => array(
|
||||
'label' => __('Title'),
|
||||
'value' => $edit_post->post_title
|
||||
'value' => $edit_post->post_title,
|
||||
),
|
||||
'image_alt' => array(),
|
||||
'post_excerpt' => array(
|
||||
'label' => __('Caption'),
|
||||
'value' => $edit_post->post_excerpt
|
||||
'value' => $edit_post->post_excerpt,
|
||||
),
|
||||
'post_content' => array(
|
||||
'label' => __('Description'),
|
||||
'value' => $edit_post->post_content,
|
||||
'input' => 'textarea'
|
||||
'input' => 'textarea',
|
||||
),
|
||||
'url' => array(
|
||||
'label' => __('Link URL'),
|
||||
'input' => 'html',
|
||||
'html' => image_link_input_fields($post, get_option('image_default_link_type')),
|
||||
'helps' => __('Enter a link URL or click above for presets.')
|
||||
'helps' => __('Enter a link URL or click above for presets.'),
|
||||
),
|
||||
'menu_order' => array(
|
||||
'label' => __('Order'),
|
||||
@@ -1047,9 +1000,9 @@ function get_attachment_fields_to_edit($post, $errors = null) {
|
||||
'image_url' => array(
|
||||
'label' => __('File URL'),
|
||||
'input' => 'html',
|
||||
'html' => "<input type='text' class='text urlfield' readonly='readonly' name='attachments[$post->ID][url]' value='" . esc_attr($image_url) . "' /><br />",
|
||||
'value' => wp_get_attachment_url($post->ID),
|
||||
'helps' => __('Location of the uploaded file.')
|
||||
'html' => "<input type='text' class='urlfield' readonly='readonly' name='attachments[$post->ID][url]' value='" . esc_attr($image_url) . "' /><br />",
|
||||
'value' => isset($edit_post->post_url) ? $edit_post->post_url : '',
|
||||
'helps' => __('Location of the uploaded file.'),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1109,12 +1062,9 @@ function get_media_items( $post_id, $errors ) {
|
||||
}
|
||||
|
||||
$output = '';
|
||||
foreach ( (array) $attachments as $id => $attachment ) {
|
||||
if ( $attachment->post_status == 'trash' )
|
||||
continue;
|
||||
foreach ( (array) $attachments as $id => $attachment )
|
||||
if ( $item = get_media_item( $id, array( 'errors' => isset($errors[$id]) ? $errors[$id] : null) ) )
|
||||
$output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div class='progress'><div class='bar'></div></div><div id='media-upload-error-$id'></div><div class='filename'></div>$item\n</div>";
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
@@ -1131,15 +1081,16 @@ function get_media_items( $post_id, $errors ) {
|
||||
function get_media_item( $attachment_id, $args = null ) {
|
||||
global $redir_tab;
|
||||
|
||||
$default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true );
|
||||
$args = wp_parse_args( $args, $default_args );
|
||||
extract( $args, EXTR_SKIP );
|
||||
|
||||
global $post_mime_types;
|
||||
if ( ( $attachment_id = intval($attachment_id) ) && $thumb_url = get_attachment_icon_src( $attachment_id ) )
|
||||
$thumb_url = $thumb_url[0];
|
||||
else
|
||||
return false;
|
||||
|
||||
$default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true );
|
||||
$args = wp_parse_args( $args, $default_args );
|
||||
extract( $args, EXTR_SKIP );
|
||||
|
||||
$toggle_on = __('Show');
|
||||
$toggle_off = __('Hide');
|
||||
|
||||
@@ -1154,10 +1105,12 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||
$tags = esc_attr(join(', ', $tags));
|
||||
}
|
||||
|
||||
$post_mime_types = get_post_mime_types();
|
||||
$keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type));
|
||||
$type = array_shift($keys);
|
||||
$type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />";
|
||||
$type = '';
|
||||
if ( isset($post_mime_types) ) {
|
||||
$keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type));
|
||||
$type = array_shift($keys);
|
||||
$type = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />";
|
||||
}
|
||||
|
||||
$form_fields = get_attachment_fields_to_edit($post, $errors);
|
||||
|
||||
@@ -1172,7 +1125,7 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||
}
|
||||
|
||||
$display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
|
||||
$display_title = $show_title ? "<div class='filename new'><span class='title'>" . wp_html_excerpt($display_title, 60) . "</span></div>" : '';
|
||||
$display_title = $show_title ? "<div class='filename new'>" . wp_html_excerpt($display_title, 60) . "</div>" : '';
|
||||
|
||||
$gallery = ( (isset($_REQUEST['tab']) && 'gallery' == $_REQUEST['tab']) || (isset($redir_tab) && 'gallery' == $redir_tab) ) ? true : false;
|
||||
$order = '';
|
||||
@@ -1189,41 +1142,22 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||
}
|
||||
}
|
||||
|
||||
$media_dims = '';
|
||||
$meta = wp_get_attachment_metadata($post->ID);
|
||||
if ( is_array($meta) && array_key_exists('width', $meta) && array_key_exists('height', $meta) )
|
||||
$media_dims .= "<span id='media-dims-{$post->ID}'>{$meta['width']} × {$meta['height']}</span> ";
|
||||
$media_dims = apply_filters('media_meta', $media_dims, $post);
|
||||
|
||||
$image_edit_button = '';
|
||||
if ( gd_edit_image_support($post->post_mime_type) ) {
|
||||
$nonce = wp_create_nonce("image_editor-$post->ID");
|
||||
$image_edit_button = "<input type='button' id='imgedit-open-btn-{$post->ID}' onclick='imageEdit.open($post->ID, \"$nonce\")' class='button' value='" . esc_attr__( 'Edit image' ) . "' /> <img src='images/wpspin_light.gif' class='imgedit-wait-spin' alt='' />";
|
||||
}
|
||||
|
||||
$item = "
|
||||
$type_html
|
||||
$type
|
||||
$toggle_links
|
||||
$order
|
||||
$display_title
|
||||
<table class='slidetoggle describe $class'>
|
||||
<thead class='media-item-info' id='media-head-$post->ID'>
|
||||
<thead class='media-item-info'>
|
||||
<tr>
|
||||
<td class='A1B1' id='thumbnail-head-$post->ID' rowspan='5'><img class='thumbnail' src='$thumb_url' alt='' /></td>
|
||||
<td><strong>" . __('File name:') . "</strong> $filename</td>
|
||||
<td class='A1B1' rowspan='4'><img class='thumbnail' src='$thumb_url' alt='' /></td>
|
||||
<td>$filename</td>
|
||||
</tr>
|
||||
<tr><td><strong>" . __('File type:') . "</strong> $post->post_mime_type</td></tr>
|
||||
<tr><td><strong>" . __('Upload date:') . "</strong> " . mysql2date( get_option('date_format'), $post->post_date ) . "</td></tr>\n";
|
||||
|
||||
if ( !empty($media_dims) )
|
||||
$item .= "<tr><td><strong>" . __('Dimensions:') . "</strong> $media_dims</td></tr>\n";
|
||||
|
||||
$item .= "
|
||||
<tr><td class='A1B1'>$image_edit_button</td></tr>
|
||||
<tr><td>$post->post_mime_type</td></tr>
|
||||
<tr><td>" . mysql2date($post->post_date, get_option('time_format')) . "</td></tr>
|
||||
<tr><td>" . apply_filters('media_meta', '', $post) . "</td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td colspan='2' class='imgedit-response' id='imgedit-response-$post->ID'></td></tr>
|
||||
<tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-$post->ID'></td></tr>\n";
|
||||
<tbody>\n";
|
||||
|
||||
$defaults = array(
|
||||
'input' => 'text',
|
||||
@@ -1232,31 +1166,15 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||
'extra_rows' => array(),
|
||||
);
|
||||
|
||||
$delete_href = wp_nonce_url("post.php?action=delete-post&post=$attachment_id", 'delete-post_' . $attachment_id);
|
||||
if ( $send )
|
||||
$send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . esc_attr__( 'Insert into Post' ) . "' />";
|
||||
if ( $delete && current_user_can('delete_post', $attachment_id) ) {
|
||||
if ( !EMPTY_TRASH_DAYS ) {
|
||||
$delete = "<a href=\"" . wp_nonce_url("post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id) . "\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Delete Permanently') . "</a>";
|
||||
} elseif ( !MEDIA_TRASH ) {
|
||||
$delete = "<a href=\"#\" class=\"del-link\" onclick=\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\">" . __('Delete') . "</a> <div id=\"del_attachment_$attachment_id\" class=\"del-attachment\" style=\"display:none;\">" . sprintf(__("You are about to delete <strong>%s</strong>."), $filename) . " <a href=\"" . wp_nonce_url("post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id) . "\" id=\"del[$attachment_id]\" class=\"button\">" . __('Continue') . "</a> <a href=\"#\" class=\"button\" onclick=\"this.parentNode.style.display='none';return false;\">" . __('Cancel') . "</a></div>";
|
||||
} else {
|
||||
$delete = "<a href=\"" . wp_nonce_url("post.php?action=trash&post=$attachment_id", 'trash-post_' . $attachment_id) . "\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Move to Trash') . "</a> <a href=\"" . wp_nonce_url("post.php?action=untrash&post=$attachment_id", 'untrash-post_' . $attachment_id) . "\" id=\"undo[$attachment_id]\" class=\"undo hidden\">" . __('Undo') . "</a>";
|
||||
}
|
||||
} else {
|
||||
$delete = '';
|
||||
}
|
||||
|
||||
$thumbnail = '';
|
||||
$calling_post_id = 0;
|
||||
if ( isset( $_GET['post_id'] ) )
|
||||
$calling_post_id = $_GET['post_id'];
|
||||
elseif ( isset( $_POST ) && count( $_POST ) ) // Like for async-upload where $_GET['post_id'] isn't set
|
||||
$calling_post_id = $post->post_parent;
|
||||
if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id )
|
||||
$thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as thumbnail" ) . "</a>";
|
||||
|
||||
if ( ( $send || $thumbnail || $delete ) && !isset($form_fields['buttons']) )
|
||||
$form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $thumbnail $delete</td></tr>\n");
|
||||
if ( $delete )
|
||||
$delete = "<a href=\"#\" class=\"del-link\" onclick=\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\">" . __('Delete') . "</a>";
|
||||
if ( ( $send || $delete ) && !isset($form_fields['buttons']) )
|
||||
$form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $delete
|
||||
<div id=\"del_attachment_$attachment_id\" class=\"del-attachment\" style=\"display:none;\">" . sprintf(__("You are about to delete <strong>%s</strong>."), $filename) . " <a href=\"$delete_href\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Continue') . "</a>
|
||||
<a href=\"#\" class=\"del-link\" onclick=\"this.parentNode.style.display='none';return false;\">" . __('Cancel') . "</a></div></td></tr>\n");
|
||||
|
||||
$hidden_fields = array();
|
||||
|
||||
@@ -1288,7 +1206,7 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||
elseif ( $field['input'] == 'textarea' ) {
|
||||
$item .= "<textarea type='text' id='$name' name='$name'" . $aria_required . ">" . esc_html( $field['value'] ) . "</textarea>";
|
||||
} else {
|
||||
$item .= "<input type='text' class='text' id='$name' name='$name' value='" . esc_attr( $field['value'] ) . "'" . $aria_required . "/>";
|
||||
$item .= "<input type='text' id='$name' name='$name' value='" . esc_attr( $field['value'] ) . "'" . $aria_required . "/>";
|
||||
}
|
||||
if ( !empty($field['helps']) )
|
||||
$item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique((array) $field['helps']) ) . '</p>';
|
||||
@@ -1406,7 +1324,6 @@ SWFUpload.onload = function() {
|
||||
post_params : {
|
||||
"post_id" : "<?php echo $post_id; ?>",
|
||||
"auth_cookie" : "<?php if ( is_ssl() ) echo $_COOKIE[SECURE_AUTH_COOKIE]; else echo $_COOKIE[AUTH_COOKIE]; ?>",
|
||||
"logged_in_cookie": "<?php echo $_COOKIE[LOGGED_IN_COOKIE]; ?>",
|
||||
"_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>",
|
||||
"type" : "<?php echo $type; ?>",
|
||||
"tab" : "<?php echo $tab; ?>",
|
||||
@@ -1452,7 +1369,7 @@ SWFUpload.onload = function() {
|
||||
<?php do_action('pre-html-upload-ui'); ?>
|
||||
<p id="async-upload-wrap">
|
||||
<label class="screen-reader-text" for="async-upload"><?php _e('Upload'); ?></label>
|
||||
<input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php esc_attr_e('Upload'); ?>" /> <a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e('Cancel'); ?></a>
|
||||
<input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php esc_attr_e('Upload'); ?>" /> <a href="#" onclick="return top.tb_remove();"><?php _e('Cancel'); ?></a>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
<?php if ( is_lighttpd_before_150() ): ?>
|
||||
@@ -1483,7 +1400,6 @@ function media_upload_type_form($type = 'file', $errors = null, $id = null) {
|
||||
?>
|
||||
|
||||
<form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form type-form validate" id="<?php echo $type; ?>-form">
|
||||
<input type="submit" class="hidden" name="save" value="" />
|
||||
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
|
||||
<?php wp_nonce_field('media-form'); ?>
|
||||
|
||||
@@ -1558,23 +1474,21 @@ var addExtImage = {
|
||||
align : 'alignnone',
|
||||
|
||||
insert : function() {
|
||||
var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = '';
|
||||
var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = null;
|
||||
|
||||
if ( '' == f.src.value || '' == t.width )
|
||||
return false;
|
||||
if ( '' == f.src.value || '' == t.width ) return false;
|
||||
|
||||
if ( f.title.value ) {
|
||||
title = f.title.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
||||
title = f.title.value.replace(/['"<>]+/g, '');
|
||||
title = ' title="'+title+'"';
|
||||
}
|
||||
|
||||
if ( f.alt.value )
|
||||
alt = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
||||
|
||||
if ( f.alt.value ) {
|
||||
alt = f.alt.value.replace(/['"<>]+/g, '');
|
||||
<?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?>
|
||||
if ( f.caption.value )
|
||||
caption = f.caption.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
||||
caption = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
||||
<?php } ?>
|
||||
}
|
||||
|
||||
cls = caption ? '' : ' class="'+t.align+'"';
|
||||
|
||||
@@ -1588,7 +1502,6 @@ var addExtImage = {
|
||||
|
||||
var win = window.dialogArguments || opener || parent || top;
|
||||
win.send_to_editor(html);
|
||||
return false;
|
||||
},
|
||||
|
||||
resetImageData : function() {
|
||||
@@ -1597,8 +1510,8 @@ var addExtImage = {
|
||||
t.width = t.height = '';
|
||||
document.getElementById('go_button').style.color = '#bbb';
|
||||
if ( ! document.forms[0].src.value )
|
||||
document.getElementById('status_img').innerHTML = '*';
|
||||
else document.getElementById('status_img').innerHTML = '<img src="images/no.png" alt="" />';
|
||||
document.getElementById('status_img').src = 'images/required.gif';
|
||||
else document.getElementById('status_img').src = 'images/no.png';
|
||||
},
|
||||
|
||||
updateImageData : function() {
|
||||
@@ -1607,7 +1520,7 @@ var addExtImage = {
|
||||
t.width = t.preloadImg.width;
|
||||
t.height = t.preloadImg.height;
|
||||
document.getElementById('go_button').style.color = '#333';
|
||||
document.getElementById('status_img').innerHTML = '<img src="images/yes.png" alt="" />';
|
||||
document.getElementById('status_img').src = 'images/yes.png';
|
||||
},
|
||||
|
||||
getImageData : function() {
|
||||
@@ -1617,7 +1530,7 @@ var addExtImage = {
|
||||
t.resetImageData();
|
||||
return false;
|
||||
}
|
||||
document.getElementById('status_img').innerHTML = '<img src="images/wpspin_light.gif" alt="" />';
|
||||
document.getElementById('status_img').src = 'images/wpspin_light.gif';
|
||||
t.preloadImg = new Image();
|
||||
t.preloadImg.onload = t.updateImageData;
|
||||
t.preloadImg.onerror = t.resetImageData;
|
||||
@@ -1647,14 +1560,13 @@ var addExtImage = {
|
||||
* @param unknown_type $errors
|
||||
*/
|
||||
function media_upload_gallery_form($errors) {
|
||||
global $redir_tab, $type;
|
||||
global $redir_tab;
|
||||
|
||||
$redir_tab = 'gallery';
|
||||
media_upload_header();
|
||||
|
||||
$post_id = intval($_REQUEST['post_id']);
|
||||
$form_action_url = admin_url("media-upload.php?type=$type&tab=gallery&post_id=$post_id");
|
||||
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
|
||||
$form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=gallery&post_id=$post_id");
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -1677,7 +1589,7 @@ jQuery(function($){
|
||||
<?php _e('Sort Order:'); ?>
|
||||
<a href="#" id="asc"><?php _e('Ascending'); ?></a> |
|
||||
<a href="#" id="desc"><?php _e('Descending'); ?></a> |
|
||||
<a href="#" id="clear"><?php echo _x('Clear', 'verb'); ?></a>
|
||||
<a href="#" id="clear"><?php _e('Clear'); ?></a>
|
||||
</div>
|
||||
<form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form validate" id="gallery-form">
|
||||
<?php wp_nonce_field('media-form'); ?>
|
||||
@@ -1686,7 +1598,6 @@ jQuery(function($){
|
||||
<thead><tr>
|
||||
<th><?php _e('Media'); ?></th>
|
||||
<th class="order-head"><?php _e('Order'); ?></th>
|
||||
<th class="actions-head"><?php _e('Actions'); ?></th>
|
||||
</tr></thead>
|
||||
</table>
|
||||
<div id="media-items">
|
||||
@@ -1794,8 +1705,7 @@ function media_upload_library_form($errors) {
|
||||
|
||||
$post_id = intval($_REQUEST['post_id']);
|
||||
|
||||
$form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id");
|
||||
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
|
||||
$form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=library&post_id=$post_id");
|
||||
|
||||
$_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0;
|
||||
if ( $_GET['paged'] < 1 )
|
||||
@@ -1892,7 +1802,7 @@ foreach ($arc_result as $arc_row) {
|
||||
continue;
|
||||
$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
|
||||
|
||||
if ( isset($_GET['m']) && ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] ) )
|
||||
if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] )
|
||||
$default = ' selected="selected"';
|
||||
else
|
||||
$default = '';
|
||||
@@ -1951,17 +1861,12 @@ jQuery(function($){
|
||||
*/
|
||||
function type_url_form_image() {
|
||||
|
||||
if ( !apply_filters( 'disable_captions', '' ) ) {
|
||||
$caption = '
|
||||
<tr>
|
||||
<th valign="top" scope="row" class="label">
|
||||
<span class="alignleft"><label for="caption">' . __('Image Caption') . '</label></span>
|
||||
</th>
|
||||
<td class="field"><input id="caption" name="caption" value="" type="text" /></td>
|
||||
</tr>
|
||||
';
|
||||
if ( apply_filters( 'disable_captions', '' ) ) {
|
||||
$alt = __('Alternate Text');
|
||||
$alt_help = __('Alt text for the image, e.g. “The Mona Lisa”');
|
||||
} else {
|
||||
$caption = '';
|
||||
$alt = __('Image Caption');
|
||||
$alt_help = __('Also used as alternate text for the image');
|
||||
}
|
||||
|
||||
$default_align = get_option('image_default_align');
|
||||
@@ -1969,12 +1874,11 @@ function type_url_form_image() {
|
||||
$default_align = 'none';
|
||||
|
||||
return '
|
||||
<h4 class="media-sub-title">' . __('Insert an image from another web site') . '</h4>
|
||||
<table class="describe"><tbody>
|
||||
<tr>
|
||||
<th valign="top" scope="row" class="label" style="width:130px;">
|
||||
<th valign="top" scope="row" class="label" style="width:120px;">
|
||||
<span class="alignleft"><label for="src">' . __('Image URL') . '</label></span>
|
||||
<span class="alignright"><abbr id="status_img" title="required" class="required">*</abbr></span>
|
||||
<span class="alignright"><img id="status_img" src="images/required.gif" title="required" alt="required" /></span>
|
||||
</th>
|
||||
<td class="field"><input id="src" name="src" value="" type="text" aria-required="true" onblur="addExtImage.getImageData()" /></td>
|
||||
</tr>
|
||||
@@ -1984,17 +1888,17 @@ function type_url_form_image() {
|
||||
<span class="alignleft"><label for="title">' . __('Image Title') . '</label></span>
|
||||
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
|
||||
</th>
|
||||
<td class="field"><input id="title" name="title" value="" type="text" aria-required="true" /></td>
|
||||
<td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th valign="top" scope="row" class="label">
|
||||
<span class="alignleft"><label for="alt">' . __('Alternate Text') . '</label></span>
|
||||
<span class="alignleft"><label for="alt">' . $alt . '</label></span>
|
||||
</th>
|
||||
<td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" />
|
||||
<p class="help">' . __('Alt text for the image, e.g. “The Mona Lisa”') . '</p></td>
|
||||
<p class="help">' . $alt_help . '</p></td>
|
||||
</tr>
|
||||
' . $caption . '
|
||||
|
||||
<tr class="align">
|
||||
<th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th>
|
||||
<td class="field">
|
||||
@@ -2216,3 +2120,4 @@ add_filter('media_upload_gallery', 'media_upload_gallery');
|
||||
|
||||
add_filter('media_upload_library', 'media_upload_library');
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,826 +0,0 @@
|
||||
<?php
|
||||
|
||||
// -- Post related Meta Boxes
|
||||
|
||||
/**
|
||||
* Display post submit form fields.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_submit_meta_box($post) {
|
||||
global $action;
|
||||
|
||||
$post_type = $post->post_type;
|
||||
$can_publish = current_user_can("publish_${post_type}s");
|
||||
?>
|
||||
<div class="submitbox" id="submitpost">
|
||||
|
||||
<div id="minor-publishing">
|
||||
|
||||
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
|
||||
<div style="display:none;">
|
||||
<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
|
||||
</div>
|
||||
|
||||
<div id="minor-publishing-actions">
|
||||
<div id="save-action">
|
||||
<?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
|
||||
<input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" tabindex="4" class="button button-highlighted" />
|
||||
<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
|
||||
<input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="preview-action">
|
||||
<?php
|
||||
if ( 'publish' == $post->post_status ) {
|
||||
$preview_link = esc_url(get_permalink($post->ID));
|
||||
$preview_button = __('Preview Changes');
|
||||
} else {
|
||||
$preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
|
||||
$preview_button = __('Preview');
|
||||
}
|
||||
?>
|
||||
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a>
|
||||
<input type="hidden" name="wp-preview" id="wp-preview" value="" />
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div><?php // /minor-publishing-actions ?>
|
||||
|
||||
<div id="misc-publishing-actions">
|
||||
|
||||
<div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label>
|
||||
<span id="post-status-display">
|
||||
<?php
|
||||
switch ( $post->post_status ) {
|
||||
case 'private':
|
||||
_e('Privately Published');
|
||||
break;
|
||||
case 'publish':
|
||||
_e('Published');
|
||||
break;
|
||||
case 'future':
|
||||
_e('Scheduled');
|
||||
break;
|
||||
case 'pending':
|
||||
_e('Pending Review');
|
||||
break;
|
||||
case 'draft':
|
||||
_e('Draft');
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
|
||||
<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
|
||||
|
||||
<div id="post-status-select" class="hide-if-js">
|
||||
<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr($post->post_status); ?>" />
|
||||
<select name='post_status' id='post_status' tabindex='4'>
|
||||
<?php if ( 'publish' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
|
||||
<?php elseif ( 'private' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
|
||||
<?php elseif ( 'future' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
|
||||
<?php endif; ?>
|
||||
<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
|
||||
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
|
||||
</select>
|
||||
<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
</div><?php // /misc-pub-section ?>
|
||||
|
||||
<div class="misc-pub-section " id="visibility">
|
||||
<?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php
|
||||
|
||||
if ( 'private' == $post->post_status ) {
|
||||
$post->post_password = '';
|
||||
$visibility = 'private';
|
||||
$visibility_trans = __('Private');
|
||||
} elseif ( !empty( $post->post_password ) ) {
|
||||
$visibility = 'password';
|
||||
$visibility_trans = __('Password protected');
|
||||
} elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) {
|
||||
$visibility = 'public';
|
||||
$visibility_trans = __('Public, Sticky');
|
||||
} else {
|
||||
$visibility = 'public';
|
||||
$visibility_trans = __('Public');
|
||||
}
|
||||
|
||||
echo esc_html( $visibility_trans ); ?></span>
|
||||
<?php if ( $can_publish ) { ?>
|
||||
<a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
|
||||
|
||||
<div id="post-visibility-select" class="hide-if-js">
|
||||
<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
|
||||
<?php if ($post_type == 'post'): ?>
|
||||
<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID)); ?> />
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
|
||||
|
||||
|
||||
<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
|
||||
<?php if ($post_type == 'post'): ?>
|
||||
<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID)); ?> tabindex="4" /> <label for="sticky" class="selectit"><?php _e('Stick this post to the front page') ?></label><br /></span>
|
||||
<?php endif; ?>
|
||||
<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
|
||||
<span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>" /><br /></span>
|
||||
<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
|
||||
|
||||
<p>
|
||||
<a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div><?php // /misc-pub-section ?>
|
||||
|
||||
|
||||
<?php
|
||||
// translators: Publish box date formt, see http://php.net/date
|
||||
$datef = __( 'M j, Y @ G:i' );
|
||||
if ( 0 != $post->ID ) {
|
||||
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
|
||||
$stamp = __('Scheduled for: <b>%1$s</b>');
|
||||
} else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
|
||||
$stamp = __('Published on: <b>%1$s</b>');
|
||||
} else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
|
||||
$stamp = __('Publish <b>immediately</b>');
|
||||
} else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
|
||||
$stamp = __('Schedule for: <b>%1$s</b>');
|
||||
} else { // draft, 1 or more saves, date specified
|
||||
$stamp = __('Publish on: <b>%1$s</b>');
|
||||
}
|
||||
$date = date_i18n( $datef, strtotime( $post->post_date ) );
|
||||
} else { // draft (no saves, and thus no date specified)
|
||||
$stamp = __('Publish <b>immediately</b>');
|
||||
$date = date_i18n( $datef, strtotime( current_time('mysql') ) );
|
||||
}
|
||||
|
||||
if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
|
||||
<div class="misc-pub-section curtime misc-pub-section-last">
|
||||
<span id="timestamp">
|
||||
<?php printf($stamp, $date); ?></span>
|
||||
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
|
||||
<div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
|
||||
</div><?php // /misc-pub-section ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action('post_submitbox_misc_actions'); ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="major-publishing-actions">
|
||||
<?php do_action('post_submitbox_start'); ?>
|
||||
<div id="delete-action">
|
||||
<?php
|
||||
if ( current_user_can( "delete_${post_type}", $post->ID ) ) {
|
||||
if ( !EMPTY_TRASH_DAYS ) {
|
||||
$delete_url = wp_nonce_url( add_query_arg( array('action' => 'delete', 'post' => $post->ID) ), "delete-${post_type}_{$post->ID}" );
|
||||
$delete_text = __('Delete Permanently');
|
||||
} else {
|
||||
$delete_url = wp_nonce_url( add_query_arg( array('action' => 'trash', 'post' => $post->ID) ), "trash-${post_type}_{$post->ID}" );
|
||||
$delete_text = __('Move to Trash');
|
||||
} ?>
|
||||
<a class="submitdelete deletion<?php if ( 'edit' != $action ) { echo " hidden"; } ?>" href="<?php echo $delete_url; ?>"><?php echo $delete_text; ?></a><?php
|
||||
} ?>
|
||||
</div>
|
||||
|
||||
<div id="publishing-action">
|
||||
<img src="images/wpspin_light.gif" id="ajax-loading" style="visibility:hidden;" alt="" />
|
||||
<?php
|
||||
if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
|
||||
if ( $can_publish ) :
|
||||
if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Schedule') ?>" />
|
||||
<?php else : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Publish') ?>" />
|
||||
<?php endif;
|
||||
else : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Submit for Review') ?>" />
|
||||
<?php
|
||||
endif;
|
||||
} else { ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
|
||||
<input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Update') ?>" />
|
||||
<?php
|
||||
} ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display post tags form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_tags_meta_box($post, $box) {
|
||||
$tax_name = esc_attr(substr($box['id'], 8));
|
||||
$taxonomy = get_taxonomy($tax_name);
|
||||
$helps = isset($taxonomy->helps) ? esc_attr($taxonomy->helps) : __('Separate tags with commas.');
|
||||
?>
|
||||
<div class="tagsdiv" id="<?php echo $tax_name; ?>">
|
||||
<div class="jaxtag">
|
||||
<div class="nojs-tags hide-if-js">
|
||||
<p><?php _e('Add or remove tags'); ?></p>
|
||||
<textarea name="<?php echo "tax_input[$tax_name]"; ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]"><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div>
|
||||
|
||||
<div class="ajaxtag hide-if-no-js">
|
||||
<label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
|
||||
<div class="taghint"><?php _e('Add new tag'); ?></div>
|
||||
<input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
|
||||
<input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" />
|
||||
</div></div>
|
||||
<p class="howto"><?php echo $helps; ?></p>
|
||||
<div class="tagchecklist"></div>
|
||||
</div>
|
||||
<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php printf( __('Choose from the most used tags in %s'), $box['title'] ); ?></a></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display post categories form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_categories_meta_box($post) {
|
||||
?>
|
||||
<ul id="category-tabs">
|
||||
<li class="tabs"><a href="#categories-all" tabindex="3"><?php _e( 'All Categories' ); ?></a></li>
|
||||
<li class="hide-if-no-js"><a href="#categories-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>
|
||||
</ul>
|
||||
|
||||
<div id="categories-pop" class="tabs-panel" style="display: none;">
|
||||
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
|
||||
<?php $popular_ids = wp_popular_terms_checklist('category'); ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="categories-all" class="tabs-panel">
|
||||
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
|
||||
<?php wp_category_checklist($post->ID, false, false, $popular_ids) ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php if ( current_user_can('manage_categories') ) : ?>
|
||||
<div id="category-adder" class="wp-hidden-children">
|
||||
<h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
|
||||
<p id="category-add" class="wp-hidden-child">
|
||||
<label class="screen-reader-text" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
|
||||
<label class="screen-reader-text" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category') ) ); ?>
|
||||
<input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php esc_attr_e( 'Add' ); ?>" tabindex="3" />
|
||||
<?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
|
||||
<span id="category-ajax-response"></span></p>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display post excerpt form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_excerpt_meta_box($post) {
|
||||
?>
|
||||
<label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
|
||||
<p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="http://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display trackback links form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_trackback_meta_box($post) {
|
||||
$form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" tabindex="7" value="'. esc_attr( str_replace("\n", ' ', $post->to_ping) ) .'" />';
|
||||
if ('' != $post->pinged) {
|
||||
$pings = '<p>'. __('Already pinged:') . '</p><ul>';
|
||||
$already_pinged = explode("\n", trim($post->pinged));
|
||||
foreach ($already_pinged as $pinged_url) {
|
||||
$pings .= "\n\t<li>" . esc_html($pinged_url) . "</li>";
|
||||
}
|
||||
$pings .= '</ul>';
|
||||
}
|
||||
|
||||
?>
|
||||
<p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
|
||||
<p><?php _e('Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress blogs they’ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
|
||||
<?php
|
||||
if ( ! empty($pings) )
|
||||
echo $pings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display custom fields form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_custom_meta_box($post) {
|
||||
?>
|
||||
<div id="postcustomstuff">
|
||||
<div id="ajax-response"></div>
|
||||
<?php
|
||||
$metadata = has_meta($post->ID);
|
||||
list_meta($metadata);
|
||||
meta_form(); ?>
|
||||
</div>
|
||||
<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display comments status form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_comment_status_meta_box($post) {
|
||||
?>
|
||||
<input name="advanced_view" type="hidden" value="1" />
|
||||
<p class="meta-options">
|
||||
<label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /><?php _e('Allow Comments.') ?></label><br />
|
||||
<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /><?php printf( __('Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.'),_x('http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments','Url to codex article on Managing Comments')); ?></label>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display comments for post.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_comment_meta_box($post) {
|
||||
global $wpdb, $post_ID;
|
||||
|
||||
$total = $wpdb->get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID));
|
||||
|
||||
if ( 1 > $total ) {
|
||||
echo '<p>' . __('No comments yet.') . '</p>';
|
||||
return;
|
||||
}
|
||||
|
||||
wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
|
||||
?>
|
||||
|
||||
<table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
|
||||
<thead><tr>
|
||||
<th scope="col" class="column-author"><?php _e('Author') ?></th>
|
||||
<th scope="col" class="column-comment">
|
||||
<?php /* translators: field name in comment form */ echo _x('Comment', 'noun'); ?></th>
|
||||
</tr></thead>
|
||||
<tbody id="the-comment-list" class="list:comment"></tbody>
|
||||
</table>
|
||||
<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="images/wpspin_light.gif" alt="" /></p>
|
||||
<?php
|
||||
$hidden = get_hidden_meta_boxes('post');
|
||||
if ( ! in_array('commentsdiv', $hidden) ) { ?>
|
||||
<script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
|
||||
<?php
|
||||
}
|
||||
wp_comment_trashnotice();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display slug form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_slug_meta_box($post) {
|
||||
?>
|
||||
<label class="screen-reader-text" for="post_name"><?php _e('Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( $post->post_name ); ?>" />
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display form field with list of authors.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_author_meta_box($post) {
|
||||
global $current_user, $user_ID;
|
||||
$authors = get_editable_user_ids( $current_user->id, true, $post->post_type ); // TODO: ROLE SYSTEM
|
||||
if ( $post->post_author && !in_array($post->post_author, $authors) )
|
||||
$authors[] = $post->post_author;
|
||||
?>
|
||||
<label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display list of revisions.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_revisions_meta_box($post) {
|
||||
wp_list_post_revisions();
|
||||
}
|
||||
|
||||
|
||||
// -- Page related Meta Boxes
|
||||
|
||||
/**
|
||||
* Display page attributes form fields.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_attributes_meta_box($post){
|
||||
?>
|
||||
<h5><?php _e('Parent') ?></h5>
|
||||
<label class="screen-reader-text" for="parent_id"><?php _e('Page Parent') ?></label>
|
||||
<?php wp_dropdown_pages(array('exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?>
|
||||
<p><?php _e('You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
|
||||
<?php
|
||||
if ( 0 != count( get_page_templates() ) ) { ?>
|
||||
<h5><?php _e('Template') ?></h5>
|
||||
<label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
|
||||
<option value='default'><?php _e('Default Template'); ?></option>
|
||||
<?php page_template_dropdown($post->page_template); ?>
|
||||
</select>
|
||||
<p><?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them above.'); ?></p>
|
||||
<?php
|
||||
} ?>
|
||||
<h5><?php _e('Order') ?></h5>
|
||||
<p><label class="screen-reader-text" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p>
|
||||
<p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
// -- Link related Meta Boxes
|
||||
|
||||
/**
|
||||
* Display link create form fields.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_submit_meta_box($link) {
|
||||
?>
|
||||
<div class="submitbox" id="submitlink">
|
||||
|
||||
<div id="minor-publishing">
|
||||
|
||||
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
|
||||
<div style="display:none;">
|
||||
<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
|
||||
</div>
|
||||
|
||||
<div id="minor-publishing-actions">
|
||||
<div id="preview-action">
|
||||
<?php if ( !empty($link->link_id) ) { ?>
|
||||
<a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank" tabindex="4"><?php _e('Visit Link'); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="misc-publishing-actions">
|
||||
<div class="misc-pub-section misc-pub-section-last">
|
||||
<label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="major-publishing-actions">
|
||||
<?php do_action('post_submitbox_start'); ?>
|
||||
<div id="delete-action">
|
||||
<?php
|
||||
if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>
|
||||
<a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="publishing-action">
|
||||
<?php if ( !empty($link->link_id) ) { ?>
|
||||
<input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php esc_attr_e('Update Link') ?>" />
|
||||
<?php } else { ?>
|
||||
<input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php esc_attr_e('Add Link') ?>" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php do_action('submitlink_box'); ?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display link categories form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_categories_meta_box($link) { ?>
|
||||
<ul id="category-tabs">
|
||||
<li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
|
||||
<li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
|
||||
</ul>
|
||||
|
||||
<div id="categories-all" class="tabs-panel">
|
||||
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
|
||||
<?php
|
||||
if ( isset($link->link_id) )
|
||||
wp_link_category_checklist($link->link_id);
|
||||
else
|
||||
wp_link_category_checklist();
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="categories-pop" class="tabs-panel" style="display: none;">
|
||||
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
|
||||
<?php wp_popular_terms_checklist('link_category'); ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="category-adder" class="wp-hidden-children">
|
||||
<h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
|
||||
<p id="link-category-add" class="wp-hidden-child">
|
||||
<label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
|
||||
<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
|
||||
<input type="button" id="category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php esc_attr_e( 'Add' ); ?>" />
|
||||
<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
|
||||
<span id="category-ajax-response"></span>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display form fields for changing link target.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_target_meta_box($link) { ?>
|
||||
<fieldset><legend class="screen-reader-text"><span><?php _e('Target') ?></span></legend>
|
||||
<p><label for="link_target_blank" class="selectit">
|
||||
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
|
||||
<?php _e('<code>_blank</code> - new window or tab.'); ?></label></p>
|
||||
<p><label for="link_target_top" class="selectit">
|
||||
<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
|
||||
<?php _e('<code>_top</code> - current window or tab, with no frames.'); ?></label></p>
|
||||
<p><label for="link_target_none" class="selectit">
|
||||
<input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> />
|
||||
<?php _e('<code>_none</code> - same window or tab.'); ?></label></p>
|
||||
</fieldset>
|
||||
<p><?php _e('Choose the target frame for your link.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display checked checkboxes attribute for xfn microformat options.
|
||||
*
|
||||
* @since 1.0.1
|
||||
*
|
||||
* @param string $class
|
||||
* @param string $value
|
||||
* @param mixed $deprecated Not used.
|
||||
*/
|
||||
function xfn_check($class, $value = '', $deprecated = '') {
|
||||
global $link;
|
||||
|
||||
$link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
|
||||
$rels = preg_split('/\s+/', $link_rel);
|
||||
|
||||
if ('' != $value && in_array($value, $rels) ) {
|
||||
echo ' checked="checked"';
|
||||
}
|
||||
|
||||
if ('' == $value) {
|
||||
if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"';
|
||||
if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
|
||||
if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
|
||||
if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display xfn form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_xfn_meta_box($link) {
|
||||
?>
|
||||
<table class="editform" style="width: 100%;" cellspacing="2" cellpadding="5">
|
||||
<tr>
|
||||
<th style="width: 20%;" scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?></label></th>
|
||||
<td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo ( isset( $link->link_rel ) ? esc_attr($link->link_rel) : ''); ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table cellpadding="3" cellspacing="5" class="form-table">
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?> </span></legend>
|
||||
<label for="me">
|
||||
<input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
|
||||
<?php _e('another web address of mine') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </span></legend>
|
||||
<label for="contact">
|
||||
<input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?></label>
|
||||
<label for="acquaintance">
|
||||
<input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?></label>
|
||||
<label for="friend">
|
||||
<input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?></label>
|
||||
<label for="friendship">
|
||||
<input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </span></legend>
|
||||
<label for="met">
|
||||
<input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('met') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </span></legend>
|
||||
<label for="co-worker">
|
||||
<input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-worker') ?></label>
|
||||
<label for="colleague">
|
||||
<input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('colleague') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </span></legend>
|
||||
<label for="co-resident">
|
||||
<input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-resident') ?></label>
|
||||
<label for="neighbor">
|
||||
<input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('neighbor') ?></label>
|
||||
<label for="geographical">
|
||||
<input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </span></legend>
|
||||
<label for="child">
|
||||
<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('child') ?></label>
|
||||
<label for="kin">
|
||||
<input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('kin') ?></label>
|
||||
<label for="parent">
|
||||
<input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('parent') ?></label>
|
||||
<label for="sibling">
|
||||
<input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sibling') ?></label>
|
||||
<label for="spouse">
|
||||
<input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('spouse') ?></label>
|
||||
<label for="family">
|
||||
<input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </span></legend>
|
||||
<label for="muse">
|
||||
<input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('muse') ?></label>
|
||||
<label for="crush">
|
||||
<input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('crush') ?></label>
|
||||
<label for="date">
|
||||
<input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('date') ?></label>
|
||||
<label for="romantic">
|
||||
<input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
|
||||
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sweetheart') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display advanced link options form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_advanced_meta_box($link) {
|
||||
?>
|
||||
<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
|
||||
<tr class="form-field">
|
||||
<th valign="top" scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
|
||||
<td><input type="text" name="link_image" class="code" id="link_image" size="50" value="<?php echo ( isset( $link->link_image ) ? esc_attr($link->link_image) : ''); ?>" style="width: 95%" /></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th valign="top" scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>
|
||||
<td><input name="link_rss" class="code" type="text" id="rss_uri" value="<?php echo ( isset( $link->link_rss ) ? esc_attr($link->link_rss) : ''); ?>" size="50" style="width: 95%" /></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th valign="top" scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
|
||||
<td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); ?></textarea></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th valign="top" scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>
|
||||
<td><select name="link_rating" id="link_rating" size="1">
|
||||
<?php
|
||||
for ($r = 0; $r <= 10; $r++) {
|
||||
echo(' <option value="'. esc_attr($r) .'" ');
|
||||
if ( isset($link->link_rating) && $link->link_rating == $r)
|
||||
echo 'selected="selected"';
|
||||
echo('>'.$r.'</option>');
|
||||
}
|
||||
?></select> <?php _e('(Leave at 0 for no rating.)') ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Display post thumbnail meta box.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
function post_thumbnail_meta_box() {
|
||||
global $post;
|
||||
$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
|
||||
echo _wp_post_thumbnail_html( $thumbnail_id );
|
||||
}
|
||||
@@ -154,7 +154,7 @@ function iis7_save_url_rewrite_rules(){
|
||||
// Using win_is_writable() instead of is_writable() because of a bug in Windows PHP
|
||||
if ( ( ! file_exists($web_config_file) && win_is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable($web_config_file) ) {
|
||||
if ( iis7_supports_permalinks() ) {
|
||||
$rule = $wp_rewrite->iis7_url_rewrite_rules(false, '', '');
|
||||
$rule = $wp_rewrite->iis7_url_rewrite_rules();
|
||||
if ( ! empty($rule) ) {
|
||||
return iis7_add_rewrite_rule($web_config_file, $rule);
|
||||
} else {
|
||||
@@ -587,7 +587,6 @@ function iis7_add_rewrite_rule($filename, $rewrite_rule) {
|
||||
$rule_fragment->appendXML($rewrite_rule);
|
||||
$rules_node->appendChild($rule_fragment);
|
||||
|
||||
$doc->encoding = "UTF-8";
|
||||
$doc->formatOutput = true;
|
||||
saveDomDocument($doc, $filename);
|
||||
|
||||
|
||||
@@ -66,25 +66,38 @@
|
||||
* @return array See above for description.
|
||||
*/
|
||||
function get_plugin_data( $plugin_file, $markup = true, $translate = true ) {
|
||||
// We don't need to write to the file, so just open for reading.
|
||||
$fp = fopen($plugin_file, 'r');
|
||||
|
||||
$default_headers = array(
|
||||
'Name' => 'Plugin Name',
|
||||
'PluginURI' => 'Plugin URI',
|
||||
'Version' => 'Version',
|
||||
'Description' => 'Description',
|
||||
'Author' => 'Author',
|
||||
'AuthorURI' => 'Author URI',
|
||||
'TextDomain' => 'Text Domain',
|
||||
'DomainPath' => 'Domain Path'
|
||||
);
|
||||
// Pull only the first 8kiB of the file in.
|
||||
$plugin_data = fread( $fp, 8192 );
|
||||
|
||||
$plugin_data = get_file_data( $plugin_file, $default_headers, 'plugin' );
|
||||
// PHP will close file handle, but we are good citizens.
|
||||
fclose($fp);
|
||||
|
||||
//For backward compatibility by default Title is the same as Name.
|
||||
$plugin_data['Title'] = $plugin_data['Name'];
|
||||
preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $name );
|
||||
preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $uri );
|
||||
preg_match( '|Version:(.*)|i', $plugin_data, $version );
|
||||
preg_match( '|Description:(.*)$|mi', $plugin_data, $description );
|
||||
preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
|
||||
preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri );
|
||||
preg_match( '|Text Domain:(.*)$|mi', $plugin_data, $text_domain );
|
||||
preg_match( '|Domain Path:(.*)$|mi', $plugin_data, $domain_path );
|
||||
|
||||
foreach ( array( 'name', 'uri', 'version', 'description', 'author_name', 'author_uri', 'text_domain', 'domain_path' ) as $field ) {
|
||||
if ( !empty( ${$field} ) )
|
||||
${$field} = _cleanup_header_comment(${$field}[1]);
|
||||
else
|
||||
${$field} = '';
|
||||
}
|
||||
|
||||
$plugin_data = array(
|
||||
'Name' => $name, 'Title' => $name, 'PluginURI' => $uri, 'Description' => $description,
|
||||
'Author' => $author_name, 'AuthorURI' => $author_uri, 'Version' => $version,
|
||||
'TextDomain' => $text_domain, 'DomainPath' => $domain_path
|
||||
);
|
||||
if ( $markup || $translate )
|
||||
$plugin_data = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup, $translate );
|
||||
$plugin_data = _get_plugin_data_markup_translate($plugin_file, $plugin_data, $markup, $translate);
|
||||
|
||||
return $plugin_data;
|
||||
}
|
||||
@@ -94,9 +107,9 @@ function _get_plugin_data_markup_translate($plugin_file, $plugin_data, $markup =
|
||||
//Translate fields
|
||||
if( $translate && ! empty($plugin_data['TextDomain']) ) {
|
||||
if( ! empty( $plugin_data['DomainPath'] ) )
|
||||
load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file). $plugin_data['DomainPath']);
|
||||
load_plugin_textdomain($plugin_data['TextDomain'], dirname($plugin_file). $plugin_data['DomainPath']);
|
||||
else
|
||||
load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file));
|
||||
load_plugin_textdomain($plugin_data['TextDomain'], dirname($plugin_file));
|
||||
|
||||
foreach ( array('Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version') as $field )
|
||||
$plugin_data[ $field ] = translate($plugin_data[ $field ], $plugin_data['TextDomain']);
|
||||
@@ -259,7 +272,7 @@ function get_plugins($plugin_folder = '') {
|
||||
* @return bool True, if in the active plugins list. False, not in the list.
|
||||
*/
|
||||
function is_plugin_active($plugin) {
|
||||
return in_array( $plugin, apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
|
||||
return in_array($plugin, get_option('active_plugins'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -301,10 +314,8 @@ function activate_plugin($plugin, $redirect = '') {
|
||||
@include(WP_PLUGIN_DIR . '/' . $plugin);
|
||||
$current[] = $plugin;
|
||||
sort($current);
|
||||
do_action( 'activate_plugin', trim( $plugin) );
|
||||
update_option('active_plugins', $current);
|
||||
do_action( 'activate_' . trim( $plugin ) );
|
||||
do_action( 'activated_plugin', trim( $plugin) );
|
||||
do_action('activate_' . $plugin);
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
@@ -332,19 +343,9 @@ function deactivate_plugins($plugins, $silent= false) {
|
||||
$plugin = plugin_basename($plugin);
|
||||
if( ! is_plugin_active($plugin) )
|
||||
continue;
|
||||
if ( ! $silent )
|
||||
do_action( 'deactivate_plugin', trim( $plugin ) );
|
||||
|
||||
$key = array_search( $plugin, (array) $current );
|
||||
|
||||
if ( false !== $key )
|
||||
array_splice( $current, $key, 1 );
|
||||
|
||||
//Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output.
|
||||
if ( ! $silent ) {
|
||||
do_action( 'deactivate_' . trim( $plugin ) );
|
||||
do_action( 'deactivated_plugin', trim( $plugin ) );
|
||||
}
|
||||
array_splice($current, array_search( $plugin, $current), 1 ); // Fixed Array-fu!
|
||||
if ( ! $silent ) //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output.
|
||||
do_action('deactivate_' . trim( $plugin ));
|
||||
}
|
||||
|
||||
update_option('active_plugins', $current);
|
||||
@@ -476,7 +477,7 @@ function delete_plugins($plugins, $redirect = '' ) {
|
||||
}
|
||||
|
||||
function validate_active_plugins() {
|
||||
$check_plugins = apply_filters( 'active_plugins', get_option('active_plugins') );
|
||||
$check_plugins = get_option('active_plugins');
|
||||
|
||||
// Sanity check. If the active plugin list is not an array, make it an
|
||||
// empty array.
|
||||
@@ -583,7 +584,7 @@ function uninstall_plugin($plugin) {
|
||||
// Menu
|
||||
//
|
||||
|
||||
function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '', $position = NULL ) {
|
||||
function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '' ) {
|
||||
global $menu, $admin_page_hooks, $_registered_pages;
|
||||
|
||||
$file = plugin_basename( $file );
|
||||
@@ -594,19 +595,12 @@ function add_menu_page( $page_title, $menu_title, $access_level, $file, $functio
|
||||
if (!empty ( $function ) && !empty ( $hookname ))
|
||||
add_action( $hookname, $function );
|
||||
|
||||
if ( empty($icon_url) ) {
|
||||
if ( empty($icon_url) )
|
||||
$icon_url = 'images/generic.png';
|
||||
} elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') ) {
|
||||
elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') )
|
||||
$icon_url = 'https://' . substr($icon_url, 7);
|
||||
}
|
||||
|
||||
$new_menu = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
|
||||
|
||||
if ( NULL === $position ) {
|
||||
$menu[] = $new_menu;
|
||||
} else {
|
||||
$menu[$position] = $new_menu;
|
||||
}
|
||||
$menu[] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
|
||||
|
||||
$_registered_pages[$hookname] = true;
|
||||
|
||||
@@ -614,19 +608,51 @@ function add_menu_page( $page_title, $menu_title, $access_level, $file, $functio
|
||||
}
|
||||
|
||||
function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
|
||||
global $_wp_last_object_menu;
|
||||
global $menu, $admin_page_hooks, $_wp_last_object_menu, $_registered_pages;
|
||||
|
||||
$file = plugin_basename( $file );
|
||||
|
||||
$admin_page_hooks[$file] = sanitize_title( $menu_title );
|
||||
|
||||
$hookname = get_plugin_page_hookname( $file, '' );
|
||||
if (!empty ( $function ) && !empty ( $hookname ))
|
||||
add_action( $hookname, $function );
|
||||
|
||||
if ( empty($icon_url) )
|
||||
$icon_url = 'images/generic.png';
|
||||
|
||||
$_wp_last_object_menu++;
|
||||
|
||||
return add_menu_page($page_title, $menu_title, $access_level, $file, $function, $icon_url, $_wp_last_object_menu);
|
||||
$menu[$_wp_last_object_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
|
||||
|
||||
$_registered_pages[$hookname] = true;
|
||||
|
||||
return $hookname;
|
||||
}
|
||||
|
||||
function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
|
||||
global $_wp_last_utility_menu;
|
||||
global $menu, $admin_page_hooks, $_wp_last_utility_menu, $_registered_pages;
|
||||
|
||||
$file = plugin_basename( $file );
|
||||
|
||||
$admin_page_hooks[$file] = sanitize_title( $menu_title );
|
||||
|
||||
$hookname = get_plugin_page_hookname( $file, '' );
|
||||
if (!empty ( $function ) && !empty ( $hookname ))
|
||||
add_action( $hookname, $function );
|
||||
|
||||
if ( empty($icon_url) )
|
||||
$icon_url = 'images/generic.png';
|
||||
elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') )
|
||||
$icon_url = 'https://' . substr($icon_url, 7);
|
||||
|
||||
$_wp_last_utility_menu++;
|
||||
|
||||
return add_menu_page($page_title, $menu_title, $access_level, $file, $function, $icon_url, $_wp_last_utility_menu);
|
||||
$menu[$_wp_last_utility_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
|
||||
|
||||
$_registered_pages[$hookname] = true;
|
||||
|
||||
return $hookname;
|
||||
}
|
||||
|
||||
function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function = '' ) {
|
||||
@@ -666,7 +692,7 @@ function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $fi
|
||||
|
||||
$_registered_pages[$hookname] = true;
|
||||
// backwards-compatibility for plugins using add_management page. See wp-admin/admin.php for redirect from edit.php to tools.php
|
||||
if ( 'tools.php' == $parent )
|
||||
if ( 'tools.php' == $parent )
|
||||
$_registered_pages[get_plugin_page_hookname( $file, 'edit.php')] = true;
|
||||
|
||||
return $hookname;
|
||||
@@ -977,8 +1003,7 @@ function user_can_access_admin_page() {
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param string $option_group A settings group name. Should correspond to a whitelisted option key name.
|
||||
* Default whitelisted option key names include "general," "discussion," and "reading," among others.
|
||||
* @param string $option_group A settings group name. Can be anything.
|
||||
* @param string $option_name The name of an option to sanitize and save.
|
||||
* @param unknown_type $sanitize_callback A callback function that sanitizes the option's value.
|
||||
* @return unknown
|
||||
|
||||
@@ -236,14 +236,6 @@ function bulk_edit_posts( $post_data = null ) {
|
||||
wp_die( __('You are not allowed to edit posts.') );
|
||||
}
|
||||
|
||||
if ( -1 == $post_data['_status'] ) {
|
||||
$post_data['post_status'] = null;
|
||||
unset($post_data['post_status']);
|
||||
} else {
|
||||
$post_data['post_status'] = $post_data['_status'];
|
||||
}
|
||||
unset($post_data['_status']);
|
||||
|
||||
$post_IDs = array_map( 'intval', (array) $post_data['post'] );
|
||||
|
||||
$reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private', 'tags_input', 'post_category', 'sticky' );
|
||||
@@ -254,7 +246,7 @@ function bulk_edit_posts( $post_data = null ) {
|
||||
|
||||
if ( isset($post_data['post_category']) ) {
|
||||
if ( is_array($post_data['post_category']) && ! empty($post_data['post_category']) )
|
||||
$new_cats = array_map( 'absint', $post_data['post_category'] );
|
||||
$new_cats = array_map( absint, $post_data['post_category'] );
|
||||
else
|
||||
unset($post_data['post_category']);
|
||||
}
|
||||
@@ -306,7 +298,7 @@ function bulk_edit_posts( $post_data = null ) {
|
||||
$post_data['ID'] = $post_ID;
|
||||
$updated[] = wp_update_post( $post_data );
|
||||
|
||||
if ( isset( $post_data['sticky'] ) && current_user_can( 'edit_others_posts' ) ) {
|
||||
if ( current_user_can( 'edit_others_posts' ) && isset( $post_data['sticky'] ) ) {
|
||||
if ( 'sticky' == $post_data['sticky'] )
|
||||
stick_post( $post_ID );
|
||||
else
|
||||
@@ -326,18 +318,29 @@ function bulk_edit_posts( $post_data = null ) {
|
||||
* @return unknown
|
||||
*/
|
||||
function get_default_post_to_edit() {
|
||||
|
||||
$post_title = '';
|
||||
if ( !empty( $_REQUEST['post_title'] ) )
|
||||
$post_title = esc_html( stripslashes( $_REQUEST['post_title'] ));
|
||||
else if ( !empty( $_REQUEST['popuptitle'] ) ) {
|
||||
$post_title = esc_html( stripslashes( $_REQUEST['popuptitle'] ));
|
||||
$post_title = funky_javascript_fix( $post_title );
|
||||
} else {
|
||||
$post_title = '';
|
||||
}
|
||||
|
||||
$post_content = '';
|
||||
if ( !empty( $_REQUEST['content'] ) )
|
||||
$post_content = esc_html( stripslashes( $_REQUEST['content'] ));
|
||||
else if ( !empty( $post_title ) ) {
|
||||
$text = esc_html( stripslashes( urldecode( $_REQUEST['text'] ) ) );
|
||||
$text = funky_javascript_fix( $text);
|
||||
$popupurl = esc_url($_REQUEST['popupurl']);
|
||||
$post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text";
|
||||
}
|
||||
|
||||
$post_excerpt = '';
|
||||
if ( !empty( $_REQUEST['excerpt'] ) )
|
||||
$post_excerpt = esc_html( stripslashes( $_REQUEST['excerpt'] ));
|
||||
else
|
||||
$post_excerpt = '';
|
||||
|
||||
$post->ID = 0;
|
||||
$post->post_name = '';
|
||||
@@ -559,9 +562,7 @@ function add_meta( $post_ID ) {
|
||||
|
||||
$metakeyselect = isset($_POST['metakeyselect']) ? stripslashes( trim( $_POST['metakeyselect'] ) ) : '';
|
||||
$metakeyinput = isset($_POST['metakeyinput']) ? stripslashes( trim( $_POST['metakeyinput'] ) ) : '';
|
||||
$metavalue = isset($_POST['metavalue']) ? maybe_serialize( stripslashes_deep( $_POST['metavalue'] ) ) : '';
|
||||
if ( is_string($metavalue) )
|
||||
$metavalue = trim( $metavalue );
|
||||
$metavalue = isset($_POST['metavalue']) ? maybe_serialize( stripslashes( trim( $_POST['metavalue'] ) ) ) : '';
|
||||
|
||||
if ( ('0' === $metavalue || !empty ( $metavalue ) ) && ((('#NONE#' != $metakeyselect) && !empty ( $metakeyselect) ) || !empty ( $metakeyinput) ) ) {
|
||||
// We have a key/value pair. If both the select and the
|
||||
@@ -579,8 +580,6 @@ function add_meta( $post_ID ) {
|
||||
wp_cache_delete($post_ID, 'post_meta');
|
||||
|
||||
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->postmeta (post_id,meta_key,meta_value ) VALUES (%s, %s, %s)", $post_ID, $metakey, $metavalue) );
|
||||
do_action( 'added_postmeta', $wpdb->insert_id, $post_ID, $metakey, $metavalue );
|
||||
|
||||
return $wpdb->insert_id;
|
||||
}
|
||||
return false;
|
||||
@@ -599,13 +598,9 @@ function delete_meta( $mid ) {
|
||||
$mid = (int) $mid;
|
||||
|
||||
$post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
|
||||
|
||||
do_action( 'delete_postmeta', $mid );
|
||||
wp_cache_delete($post_id, 'post_meta');
|
||||
$rval = $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
|
||||
do_action( 'deleted_postmeta', $mid );
|
||||
|
||||
return $rval;
|
||||
return $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -686,19 +681,15 @@ function update_meta( $meta_id, $meta_key, $meta_value ) {
|
||||
return false;
|
||||
|
||||
$post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $meta_id) );
|
||||
wp_cache_delete($post_id, 'post_meta');
|
||||
|
||||
$meta_value = maybe_serialize( stripslashes_deep( $meta_value ) );
|
||||
$meta_value = maybe_serialize( stripslashes( $meta_value ) );
|
||||
$meta_id = (int) $meta_id;
|
||||
|
||||
$data = compact( 'meta_key', 'meta_value' );
|
||||
$where = compact( 'meta_id' );
|
||||
|
||||
do_action( 'update_postmeta', $meta_id, $post_id, $meta_key, $meta_value );
|
||||
$rval = $wpdb->update( $wpdb->postmeta, $data, $where );
|
||||
wp_cache_delete($post_id, 'post_meta');
|
||||
do_action( 'updated_postmeta', $meta_id, $post_id, $meta_key, $meta_value );
|
||||
|
||||
return $rval;
|
||||
return $wpdb->update( $wpdb->postmeta, $data, $where );
|
||||
}
|
||||
|
||||
//
|
||||
@@ -715,7 +706,6 @@ function update_meta( $meta_id, $meta_key, $meta_value ) {
|
||||
* @return unknown
|
||||
*/
|
||||
function _fix_attachment_links( $post_ID ) {
|
||||
global $_fix_attachment_link_id;
|
||||
|
||||
$post = & get_post( $post_ID, ARRAY_A );
|
||||
|
||||
@@ -743,8 +733,7 @@ function _fix_attachment_links( $post_ID ) {
|
||||
}
|
||||
|
||||
$post_search[$i] = $anchor;
|
||||
$_fix_attachment_link_id = $id;
|
||||
$post_replace[$i] = preg_replace_callback( "#href=(\"|')[^'\"]*\\1#", '_fix_attachment_links_replace_cb', $anchor );
|
||||
$post_replace[$i] = preg_replace( "#href=(\"|')[^'\"]*\\1#e", "stripslashes( 'href=\\1' ).get_attachment_link( $id ).stripslashes( '\\1' )", $anchor );
|
||||
++$i;
|
||||
}
|
||||
|
||||
@@ -756,11 +745,6 @@ function _fix_attachment_links( $post_ID ) {
|
||||
return wp_update_post( $post);
|
||||
}
|
||||
|
||||
function _fix_attachment_links_replace_cb($match) {
|
||||
global $_fix_attachment_link_id;
|
||||
return stripslashes( 'href='.$match[1] ).get_attachment_link( $_fix_attachment_link_id ).stripslashes( $match[1] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Move child posts to a new parent.
|
||||
*
|
||||
@@ -775,17 +759,7 @@ function _relocate_children( $old_ID, $new_ID ) {
|
||||
global $wpdb;
|
||||
$old_ID = (int) $old_ID;
|
||||
$new_ID = (int) $new_ID;
|
||||
|
||||
$children = $wpdb->get_col( $wpdb->prepare("
|
||||
SELECT post_id
|
||||
FROM $wpdb->postmeta
|
||||
WHERE meta_key = '_wp_attachment_temp_parent'
|
||||
AND meta_value = %d", $old_ID) );
|
||||
|
||||
foreach ( $children as $child_id ) {
|
||||
$wpdb->update($wpdb->posts, array('post_parent' => $new_ID), array('ID' => $child_id) );
|
||||
delete_post_meta($child_id, '_wp_attachment_temp_parent');
|
||||
}
|
||||
return $wpdb->update($wpdb->posts, array('post_parent' => $new_ID), array('post_parent' => $old_ID) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -821,7 +795,6 @@ function wp_edit_posts_query( $q = false ) {
|
||||
'pending' => array(_x('Pending Review', 'post'), __('Pending posts'), _n_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>')),
|
||||
'draft' => array(_x('Draft', 'post'), _x('Drafts', 'manage posts header'), _n_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>')),
|
||||
'private' => array(_x('Private', 'post'), __('Private posts'), _n_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>')),
|
||||
'trash' => array(_x('Trash', 'post'), __('Trash posts'), _n_noop('Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>')),
|
||||
);
|
||||
|
||||
$post_stati = apply_filters('post_stati', $post_stati);
|
||||
@@ -845,33 +818,16 @@ function wp_edit_posts_query( $q = false ) {
|
||||
$orderby = 'date';
|
||||
}
|
||||
|
||||
$posts_per_page = (int) get_user_option( 'edit_per_page', 0, false );
|
||||
if ( empty( $posts_per_page ) || $posts_per_page < 1 )
|
||||
$posts_per_page = get_user_option('edit_per_page');
|
||||
if ( empty($posts_per_page) )
|
||||
$posts_per_page = 15;
|
||||
$posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page );
|
||||
$posts_per_page = apply_filters('edit_posts_per_page', $posts_per_page);
|
||||
|
||||
wp("post_type=post&$post_status_q&posts_per_page=$posts_per_page&order=$order&orderby=$orderby");
|
||||
|
||||
return array($post_stati, $avail_post_stati);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get default post mime types
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_post_mime_types() {
|
||||
$post_mime_types = array( // array( adj, noun )
|
||||
'image' => array(__('Images'), __('Manage Images'), _n_noop('Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>')),
|
||||
'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>')),
|
||||
'video' => array(__('Video'), __('Manage Video'), _n_noop('Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>')),
|
||||
);
|
||||
|
||||
return apply_filters('post_mime_types', $post_mime_types);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
@@ -902,13 +858,18 @@ function wp_edit_attachments_query( $q = false ) {
|
||||
$q['m'] = isset( $q['m'] ) ? (int) $q['m'] : 0;
|
||||
$q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
|
||||
$q['post_type'] = 'attachment';
|
||||
$q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : 'inherit';
|
||||
$media_per_page = (int) get_user_option( 'upload_per_page', 0, false );
|
||||
if ( empty( $media_per_page ) || $media_per_page < 1 )
|
||||
$q['post_status'] = 'any';
|
||||
$media_per_page = get_user_option('upload_per_page');
|
||||
if ( empty($media_per_page) )
|
||||
$media_per_page = 20;
|
||||
$q['posts_per_page'] = apply_filters( 'upload_per_page', $media_per_page );
|
||||
$q['posts_per_page'] = $media_per_page;
|
||||
$post_mime_types = array( // array( adj, noun )
|
||||
'image' => array(__('Images'), __('Manage Images'), _n_noop('Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>')),
|
||||
'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>')),
|
||||
'video' => array(__('Video'), __('Manage Video'), _n_noop('Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>')),
|
||||
);
|
||||
$post_mime_types = apply_filters('post_mime_types', $post_mime_types);
|
||||
|
||||
$post_mime_types = get_post_mime_types();
|
||||
$avail_post_mime_types = get_available_post_mime_types('attachment');
|
||||
|
||||
if ( isset($q['post_mime_type']) && !array_intersect( (array) $q['post_mime_type'], array_keys($post_mime_types) ) )
|
||||
@@ -945,12 +906,12 @@ function postbox_classes( $id, $page ) {
|
||||
*
|
||||
* @since unknown
|
||||
*
|
||||
* @param int|object $id Post ID or post object.
|
||||
* @param string $title (optional) Title
|
||||
* @param string $name (optional) Name
|
||||
* @return array With two entries of type string
|
||||
* @param unknown_type $id
|
||||
* @param unknown_type $title
|
||||
* @param unknown_type $name
|
||||
* @return unknown
|
||||
*/
|
||||
function get_sample_permalink($id, $title = null, $name = null) {
|
||||
function get_sample_permalink($id, $title=null, $name = null) {
|
||||
$post = &get_post($id);
|
||||
if (!$post->ID) {
|
||||
return array('', '');
|
||||
@@ -963,7 +924,7 @@ function get_sample_permalink($id, $title = null, $name = null) {
|
||||
// drafts, so we will fake, that our post is published
|
||||
if (in_array($post->post_status, array('draft', 'pending'))) {
|
||||
$post->post_status = 'publish';
|
||||
$post->post_name = sanitize_title($post->post_name ? $post->post_name : $post->post_title, $post->ID);
|
||||
$post->post_name = sanitize_title($post->post_name? $post->post_name : $post->post_title, $post->ID);
|
||||
}
|
||||
|
||||
$post->post_name = wp_unique_post_slug($post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent);
|
||||
@@ -971,7 +932,7 @@ function get_sample_permalink($id, $title = null, $name = null) {
|
||||
// If the user wants to set a new name -- override the current one
|
||||
// Note: if empty name is supplied -- use the title instead, see #6072
|
||||
if (!is_null($name)) {
|
||||
$post->post_name = sanitize_title($name ? $name : $title, $post->ID);
|
||||
$post->post_name = sanitize_title($name? $name : $title, $post->ID);
|
||||
}
|
||||
|
||||
$post->filter = 'sample';
|
||||
@@ -999,48 +960,40 @@ function get_sample_permalink($id, $title = null, $name = null) {
|
||||
}
|
||||
|
||||
/**
|
||||
* sample permalink html
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor.
|
||||
*
|
||||
* @since unknown
|
||||
*
|
||||
* @param int|object $id Post ID or post object.
|
||||
* @param string $new_title (optional) New title
|
||||
* @param string $new_slug (optional) New slug
|
||||
* @return string intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor.
|
||||
* @param unknown_type $id
|
||||
* @param unknown_type $new_title
|
||||
* @param unknown_type $new_slug
|
||||
* @return unknown
|
||||
*/
|
||||
function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
$post = &get_post($id);
|
||||
list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
|
||||
|
||||
if ( 'publish' == $post->post_status ) {
|
||||
if ( 'publish' == $post->post_status )
|
||||
$view_post = 'post' == $post->post_type ? __('View Post') : __('View Page');
|
||||
$title = __('Click to edit this part of the permalink');
|
||||
} else {
|
||||
$title = __('Temporary permalink. Click to edit this part.');
|
||||
}
|
||||
|
||||
if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) {
|
||||
$return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $permalink . "</span>\n";
|
||||
if ( current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) )
|
||||
if ( current_user_can( 'manage_options' ) )
|
||||
$return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
|
||||
if ( isset($view_post) )
|
||||
$return .= "<span id='view-post-btn'><a href='$permalink' class='button' target='_blank'>$view_post</a></span>\n";
|
||||
|
||||
$return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
if ( function_exists('mb_strlen') ) {
|
||||
if ( mb_strlen($post_name) > 30 ) {
|
||||
$title = __('Click to edit this part of the permalink');
|
||||
if (function_exists('mb_strlen')) {
|
||||
if (mb_strlen($post_name) > 30) {
|
||||
$post_name_abridged = mb_substr($post_name, 0, 14). '…' . mb_substr($post_name, -14);
|
||||
} else {
|
||||
$post_name_abridged = $post_name;
|
||||
}
|
||||
} else {
|
||||
if ( strlen($post_name) > 30 ) {
|
||||
if (strlen($post_name) > 30) {
|
||||
$post_name_abridged = substr($post_name, 0, 14). '…' . substr($post_name, -14);
|
||||
} else {
|
||||
$post_name_abridged = $post_name;
|
||||
@@ -1051,51 +1004,20 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
$display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink);
|
||||
$view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink);
|
||||
$return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $display_link . "</span>\n";
|
||||
$return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n";
|
||||
$return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button hide-if-no-js" onclick="edit_permalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n";
|
||||
$return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
|
||||
if ( isset($view_post) )
|
||||
$return .= "<span id='view-post-btn'><a href='$view_link' class='button' target='_blank'>$view_post</a></span>\n";
|
||||
|
||||
$return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output HTML for the post thumbnail meta-box.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.9.0
|
||||
* @since unknown
|
||||
*
|
||||
* @param int $thumbnail_id ID of the attachment used for thumbnail
|
||||
* @return string html
|
||||
*/
|
||||
function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
|
||||
global $content_width, $_wp_additional_image_sizes;
|
||||
$content = '<p class="hide-if-no-js"><a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . esc_html__( 'Set thumbnail' ) . '</a></p>';
|
||||
|
||||
if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
|
||||
$old_content_width = $content_width;
|
||||
$content_width = 266;
|
||||
if ( !isset( $_wp_additional_image_sizes['post-thumbnail'] ) )
|
||||
$thumbnail_html = wp_get_attachment_image( $thumbnail_id, array( $content_width, $content_width ) );
|
||||
else
|
||||
$thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' );
|
||||
if ( !empty( $thumbnail_html ) ) {
|
||||
$content = '<a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . $thumbnail_html . '</a>';
|
||||
$content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail();return false;">' . esc_html__( 'Remove thumbnail' ) . '</a></p>';
|
||||
}
|
||||
$content_width = $old_content_width;
|
||||
}
|
||||
|
||||
return apply_filters( 'admin_post_thumbnail_html', $content );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if the post is currently being edited by another user.
|
||||
*
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @param int $post_id ID of the post to check for editing
|
||||
* @param unknown_type $post_id
|
||||
* @return bool|int False: not locked or locked by current user. Int: user ID of user with lock.
|
||||
*/
|
||||
function wp_check_post_lock( $post_id ) {
|
||||
@@ -1115,12 +1037,12 @@ function wp_check_post_lock( $post_id ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark the post as currently being edited by the current user
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.5.0
|
||||
* @since unknown
|
||||
*
|
||||
* @param int $post_id ID of the post to being edited
|
||||
* @return bool Returns false if the post doesn't exist of there is no current user
|
||||
* @param unknown_type $post_id
|
||||
* @return unknown
|
||||
*/
|
||||
function wp_set_post_lock( $post_id ) {
|
||||
global $current_user;
|
||||
@@ -1137,32 +1059,6 @@ function wp_set_post_lock( $post_id ) {
|
||||
update_post_meta( $post->ID, '_edit_last', $current_user->ID );
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the notice message to say that someone else is editing this post at the moment.
|
||||
*
|
||||
* @since 2.8.5
|
||||
* @return none
|
||||
*/
|
||||
function _admin_notice_post_locked() {
|
||||
global $post;
|
||||
$last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) );
|
||||
$last_user_name = $last_user ? $last_user->display_name : __('Somebody');
|
||||
|
||||
switch ($post->post_type) {
|
||||
case 'post':
|
||||
$message = __( 'Warning: %s is currently editing this post' );
|
||||
break;
|
||||
case 'page':
|
||||
$message = __( 'Warning: %s is currently editing this page' );
|
||||
break;
|
||||
default:
|
||||
$message = __( 'Warning: %s is currently editing this.' );
|
||||
}
|
||||
|
||||
$message = sprintf( $message, esc_html( $last_user_name ) );
|
||||
echo "<div class='error'><p>$message</p></div>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates autosave data for the specified post from $_POST data.
|
||||
*
|
||||
@@ -1182,8 +1078,6 @@ function wp_create_post_autosave( $post_id ) {
|
||||
if ( $old_autosave = wp_get_post_autosave( $post_id ) ) {
|
||||
$new_autosave = _wp_post_revision_fields( $_POST, true );
|
||||
$new_autosave['ID'] = $old_autosave->ID;
|
||||
$current_user = wp_get_current_user();
|
||||
$new_autosave['post_author'] = $current_user->ID;
|
||||
return wp_update_post( $new_autosave );
|
||||
}
|
||||
|
||||
@@ -1267,9 +1161,8 @@ function post_preview() {
|
||||
* to the URL when queueing them with the mce_external_plugins filter.
|
||||
*
|
||||
* @param bool $teeny optional Output a trimmed down version used in Press This.
|
||||
* @param mixed $settings optional An array that can add to or overwrite the default TinyMCE settings.
|
||||
*/
|
||||
function wp_tiny_mce( $teeny = false, $settings = false ) {
|
||||
function wp_tiny_mce( $teeny = false ) {
|
||||
global $concatenate_scripts, $compress_scripts, $tinymce_version;
|
||||
|
||||
if ( ! user_can_richedit() )
|
||||
@@ -1288,7 +1181,7 @@ function wp_tiny_mce( $teeny = false, $settings = false ) {
|
||||
$mce_spellchecker_languages = apply_filters('mce_spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv');
|
||||
|
||||
if ( $teeny ) {
|
||||
$plugins = apply_filters( 'teeny_mce_plugins', array('safari', 'inlinepopups', 'media', 'fullscreen', 'wordpress') );
|
||||
$plugins = apply_filters( 'teeny_mce_plugins', array('safari', 'inlinepopups', 'media', 'autosave', 'fullscreen') );
|
||||
$ext_plugins = '';
|
||||
} else {
|
||||
$plugins = array( 'safari', 'inlinepopups', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage', 'wpgallery', 'tabfocus' );
|
||||
@@ -1422,9 +1315,7 @@ function wp_tiny_mce( $teeny = false, $settings = false ) {
|
||||
'accessibility_focus' => true,
|
||||
'tabfocus_elements' => 'major-publishing-actions',
|
||||
'media_strict' => false,
|
||||
'paste_remove_styles' => true,
|
||||
'paste_remove_spans' => true,
|
||||
'paste_strip_class_attributes' => 'all',
|
||||
'save_callback' => 'switchEditors.saveCallback',
|
||||
'wpeditimage_disable_captions' => $no_captions,
|
||||
'plugins' => "$plugins"
|
||||
);
|
||||
@@ -1434,9 +1325,6 @@ function wp_tiny_mce( $teeny = false, $settings = false ) {
|
||||
if ( ! empty($mce_css) )
|
||||
$initArray['content_css'] = "$mce_css";
|
||||
|
||||
if ( is_array($settings) )
|
||||
$initArray = array_merge($initArray, $settings);
|
||||
|
||||
// For people who really REALLY know what they're doing with TinyMCE
|
||||
// You can modify initArray to add, remove, change elements of the config before tinyMCE.init
|
||||
// Setting "valid_elements", "invalid_elements" and "extended_valid_elements" can be done through "tiny_mce_before_init".
|
||||
|
||||
@@ -19,10 +19,12 @@ $charset_collate = '';
|
||||
// Declare these as global in case schema.php is included from a function.
|
||||
global $wpdb, $wp_queries;
|
||||
|
||||
if ( ! empty($wpdb->charset) )
|
||||
$charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
|
||||
if ( ! empty($wpdb->collate) )
|
||||
$charset_collate .= " COLLATE $wpdb->collate";
|
||||
if ( $wpdb->has_cap( 'collation' ) ) {
|
||||
if ( ! empty($wpdb->charset) )
|
||||
$charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
|
||||
if ( ! empty($wpdb->collate) )
|
||||
$charset_collate .= " COLLATE $wpdb->collate";
|
||||
}
|
||||
|
||||
/** Create WordPress database tables SQL */
|
||||
$wp_queries = "CREATE TABLE $wpdb->terms (
|
||||
@@ -52,15 +54,6 @@ CREATE TABLE $wpdb->term_relationships (
|
||||
PRIMARY KEY (object_id,term_taxonomy_id),
|
||||
KEY term_taxonomy_id (term_taxonomy_id)
|
||||
) $charset_collate;
|
||||
CREATE TABLE $wpdb->commentmeta (
|
||||
meta_id bigint(20) unsigned NOT NULL auto_increment,
|
||||
comment_id bigint(20) unsigned NOT NULL default '0',
|
||||
meta_key varchar(255) default NULL,
|
||||
meta_value longtext,
|
||||
PRIMARY KEY (meta_id),
|
||||
KEY comment_id (comment_id),
|
||||
KEY meta_key (meta_key)
|
||||
) $charset_collate;
|
||||
CREATE TABLE $wpdb->comments (
|
||||
comment_ID bigint(20) unsigned NOT NULL auto_increment,
|
||||
comment_post_ID bigint(20) unsigned NOT NULL default '0',
|
||||
@@ -106,8 +99,8 @@ CREATE TABLE $wpdb->options (
|
||||
option_name varchar(64) NOT NULL default '',
|
||||
option_value longtext NOT NULL,
|
||||
autoload varchar(20) NOT NULL default 'yes',
|
||||
PRIMARY KEY (option_id),
|
||||
UNIQUE KEY option_name (option_name)
|
||||
PRIMARY KEY (option_id,blog_id,option_name),
|
||||
KEY option_name (option_name)
|
||||
) $charset_collate;
|
||||
CREATE TABLE $wpdb->postmeta (
|
||||
meta_id bigint(20) unsigned NOT NULL auto_increment,
|
||||
@@ -187,10 +180,12 @@ function populate_options() {
|
||||
do_action('populate_options');
|
||||
|
||||
if ( ini_get('safe_mode') ) {
|
||||
// Safe mode can break mkdir() so use a flat structure by default.
|
||||
// Safe mode screws up mkdir(), so we must use a flat structure.
|
||||
$uploads_use_yearmonth_folders = 0;
|
||||
$upload_path = WP_CONTENT_DIR;
|
||||
} else {
|
||||
$uploads_use_yearmonth_folders = 1;
|
||||
$upload_path = WP_CONTENT_DIR . '/uploads';
|
||||
}
|
||||
|
||||
$options = array(
|
||||
@@ -205,6 +200,7 @@ function populate_options() {
|
||||
'require_name_email' => 1,
|
||||
'comments_notify' => 1,
|
||||
'posts_per_rss' => 10,
|
||||
'rss_excerpt_length' => 50,
|
||||
'rss_use_excerpt' => 0,
|
||||
'mailserver_url' => 'mail.example.com',
|
||||
'mailserver_login' => 'login@example.com',
|
||||
@@ -261,7 +257,7 @@ function populate_options() {
|
||||
|
||||
// 2.0.1
|
||||
'uploads_use_yearmonth_folders' => $uploads_use_yearmonth_folders,
|
||||
'upload_path' => '',
|
||||
'upload_path' => $upload_path,
|
||||
|
||||
// 2.0.3
|
||||
'secret' => wp_generate_password(64),
|
||||
@@ -309,12 +305,7 @@ function populate_options() {
|
||||
'widget_rss' => array(),
|
||||
|
||||
// 2.8
|
||||
'timezone_string' => '',
|
||||
|
||||
// 2.9
|
||||
'embed_autourls' => 1,
|
||||
'embed_size_w' => '',
|
||||
'embed_size_h' => 600,
|
||||
'timezone_string' => ''
|
||||
);
|
||||
|
||||
// Set autoload to no for these options
|
||||
@@ -348,12 +339,9 @@ function populate_options() {
|
||||
|
||||
// Delete unused options
|
||||
$unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts',
|
||||
'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length');
|
||||
'page_uris', 'rewrite_rules', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed');
|
||||
foreach ($unusedoptions as $option)
|
||||
delete_option($option);
|
||||
|
||||
// delete obsolete magpie stuff
|
||||
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?$'");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -177,14 +177,14 @@ function _cat_row( $category, $level, $name_override = false ) {
|
||||
$output .= "<td $attributes>$edit";
|
||||
$output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
|
||||
$output .= '<div class="name">' . $qe_data->name . '</div>';
|
||||
$output .= '<div class="slug">' . apply_filters('editable_slug', $qe_data->slug) . '</div>';
|
||||
$output .= '<div class="slug">' . $qe_data->slug . '</div>';
|
||||
$output .= '<div class="cat_parent">' . $qe_data->parent . '</div></div></td>';
|
||||
break;
|
||||
case 'description':
|
||||
$output .= "<td $attributes>$category->description</td>";
|
||||
break;
|
||||
case 'slug':
|
||||
$output .= "<td $attributes>" . apply_filters('editable_slug', $category->slug) . "</td>";
|
||||
$output .= "<td $attributes>$category->slug</td>";
|
||||
break;
|
||||
case 'posts':
|
||||
$attributes = 'class="posts column-posts num"' . $style;
|
||||
@@ -347,14 +347,14 @@ function link_cat_row( $category, $name_override = false ) {
|
||||
$output .= "<td $attributes>$edit";
|
||||
$output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
|
||||
$output .= '<div class="name">' . $qe_data->name . '</div>';
|
||||
$output .= '<div class="slug">' . apply_filters('editable_slug', $qe_data->slug) . '</div>';
|
||||
$output .= '<div class="slug">' . $qe_data->slug . '</div>';
|
||||
$output .= '<div class="cat_parent">' . $qe_data->parent . '</div></div></td>';
|
||||
break;
|
||||
case 'description':
|
||||
$output .= "<td $attributes>$category->description</td>";
|
||||
break;
|
||||
case 'slug':
|
||||
$output .= "<td $attributes>" . apply_filters('editable_slug', $category->slug) . "</td>";
|
||||
$output .= "<td $attributes>$category->slug</td>";
|
||||
break;
|
||||
case 'links':
|
||||
$attributes = 'class="links column-links num"' . $style;
|
||||
@@ -376,7 +376,7 @@ function link_cat_row( $category, $name_override = false ) {
|
||||
*
|
||||
* Compares the first two arguments and if identical marks as checked
|
||||
*
|
||||
* @since 1.0
|
||||
* @since 2.8
|
||||
*
|
||||
* @param any $checked One of the values to compare
|
||||
* @param any $current (true) The other value to compare if not just true
|
||||
@@ -391,7 +391,7 @@ function checked( $checked, $current = true, $echo = true) {
|
||||
*
|
||||
* Compares the first two arguments and if identical marks as selected
|
||||
*
|
||||
* @since 1.0
|
||||
* @since 2.8
|
||||
*
|
||||
* @param any selected One of the values to compare
|
||||
* @param any $current (true) The other value to compare if not just true
|
||||
@@ -415,7 +415,7 @@ function selected( $selected, $current = true, $echo = true) {
|
||||
* @param string $type The type of checked|selected we are doing.
|
||||
*/
|
||||
function __checked_selected_helper( $helper, $current, $echo, $type) {
|
||||
if ( (string) $helper === (string) $current)
|
||||
if ( $helper == $current)
|
||||
$result = " $type='$type'";
|
||||
else
|
||||
$result = '';
|
||||
@@ -487,7 +487,7 @@ class Walker_Category_Checklist extends Walker {
|
||||
* @param unknown_type $selected_cats
|
||||
* @param unknown_type $popular_cats
|
||||
*/
|
||||
function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
|
||||
function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null ) {
|
||||
if ( empty($walker) || !is_a($walker, 'Walker') )
|
||||
$walker = new Walker_Category_Checklist;
|
||||
|
||||
@@ -515,21 +515,19 @@ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $select
|
||||
$categories = get_categories('get=all');
|
||||
}
|
||||
|
||||
if ( $checked_ontop ) {
|
||||
// Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
|
||||
$checked_categories = array();
|
||||
$keys = array_keys( $categories );
|
||||
// Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
|
||||
$checked_categories = array();
|
||||
$keys = array_keys( $categories );
|
||||
|
||||
foreach( $keys as $k ) {
|
||||
if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) {
|
||||
$checked_categories[] = $categories[$k];
|
||||
unset( $categories[$k] );
|
||||
}
|
||||
foreach( $keys as $k ) {
|
||||
if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) {
|
||||
$checked_categories[] = $categories[$k];
|
||||
unset( $categories[$k] );
|
||||
}
|
||||
|
||||
// Put checked cats on top
|
||||
echo call_user_func_array(array(&$walker, 'walk'), array($checked_categories, 0, $args));
|
||||
}
|
||||
|
||||
// Put checked cats on top
|
||||
echo call_user_func_array(array(&$walker, 'walk'), array($checked_categories, 0, $args));
|
||||
// Then the rest of them
|
||||
echo call_user_func_array(array(&$walker, 'walk'), array($categories, 0, $args));
|
||||
}
|
||||
@@ -547,12 +545,10 @@ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $select
|
||||
*/
|
||||
function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) {
|
||||
global $post_ID;
|
||||
|
||||
if ( $post_ID )
|
||||
$checked_categories = wp_get_post_categories($post_ID);
|
||||
else
|
||||
$checked_categories = array();
|
||||
|
||||
$categories = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) );
|
||||
|
||||
$popular_ids = array();
|
||||
@@ -561,12 +557,11 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $ech
|
||||
if ( !$echo ) // hack for AJAX use
|
||||
continue;
|
||||
$id = "popular-category-$category->term_id";
|
||||
$checked = in_array( $category->term_id, $checked_categories ) ? 'checked="checked"' : '';
|
||||
?>
|
||||
|
||||
<li id="<?php echo $id; ?>" class="popular-category">
|
||||
<label class="selectit">
|
||||
<input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $category->term_id; ?>" />
|
||||
<input id="in-<?php echo $id; ?>" type="checkbox" value="<?php echo (int) $category->term_id; ?>" />
|
||||
<?php echo esc_html( apply_filters( 'the_category', $category->name ) ); ?>
|
||||
</label>
|
||||
</li>
|
||||
@@ -668,7 +663,7 @@ function _tag_row( $tag, $class = '', $taxonomy = 'post_tag' ) {
|
||||
$actions = array();
|
||||
$actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
|
||||
$actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
|
||||
$actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url("edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "'>" . __('Delete') . "</a>";
|
||||
$actions['delete'] = "<a class='delete:the-list:tag-$tag->term_id submitdelete' href='" . wp_nonce_url("edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "'>" . __('Delete') . "</a>";
|
||||
$actions = apply_filters('tag_row_actions', $actions, $tag);
|
||||
$action_count = count($actions);
|
||||
$i = 0;
|
||||
@@ -681,13 +676,13 @@ function _tag_row( $tag, $class = '', $taxonomy = 'post_tag' ) {
|
||||
$out .= '</div>';
|
||||
$out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
|
||||
$out .= '<div class="name">' . $qe_data->name . '</div>';
|
||||
$out .= '<div class="slug">' . apply_filters('editable_slug', $qe_data->slug) . '</div></div></td>';
|
||||
$out .= '<div class="slug">' . $qe_data->slug . '</div></div></td>';
|
||||
break;
|
||||
case 'description':
|
||||
$out .= "<td $attributes>$tag->description</td>";
|
||||
break;
|
||||
case 'slug':
|
||||
$out .= "<td $attributes>" . apply_filters('editable_slug', $tag->slug) . "</td>";
|
||||
$out .= "<td $attributes>$tag->slug</td>";
|
||||
break;
|
||||
case 'posts':
|
||||
$attributes = 'class="posts column-posts num"' . $style;
|
||||
@@ -735,7 +730,7 @@ function tag_rows( $page = 1, $pagesize = 20, $searchterms = '', $taxonomy = 'po
|
||||
$out = '';
|
||||
$count = 0;
|
||||
foreach( $tags as $tag )
|
||||
$out .= _tag_row( $tag, ++$count % 2 ? ' class="alternate"' : '', $taxonomy );
|
||||
$out .= _tag_row( $tag, ++$count % 2 ? ' class="iedit alternate"' : ' class="iedit"', $taxonomy );
|
||||
|
||||
// filter and send to screen
|
||||
echo $out;
|
||||
@@ -758,8 +753,7 @@ function wp_manage_posts_columns() {
|
||||
$posts_columns['author'] = __('Author');
|
||||
$posts_columns['categories'] = __('Categories');
|
||||
$posts_columns['tags'] = __('Tags');
|
||||
$post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all';
|
||||
if ( !in_array( $post_status, array('pending', 'draft', 'future') ) )
|
||||
if ( !isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) )
|
||||
$posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>';
|
||||
$posts_columns['date'] = __('Date');
|
||||
$posts_columns = apply_filters('manage_posts_columns', $posts_columns);
|
||||
@@ -806,8 +800,10 @@ function wp_manage_pages_columns() {
|
||||
$posts_columns['cb'] = '<input type="checkbox" />';
|
||||
$posts_columns['title'] = __('Title');
|
||||
$posts_columns['author'] = __('Author');
|
||||
$post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all';
|
||||
if ( !in_array( $post_status, array('pending', 'draft', 'future') ) )
|
||||
$post_status = 'all';
|
||||
if ( !empty($_GET['post_status']) )
|
||||
$post_status = $_GET['post_status'];
|
||||
if ( !in_array($post_status, array('pending', 'draft', 'future')) )
|
||||
$posts_columns['comments'] = '<div class="vers"><img alt="" src="images/comment-grey-bubble.png" /></div>';
|
||||
$posts_columns['date'] = __('Date');
|
||||
$posts_columns = apply_filters('manage_pages_columns', $posts_columns);
|
||||
@@ -1059,18 +1055,21 @@ function inline_edit_row( $type ) {
|
||||
|
||||
<?php endif; // $bulk
|
||||
|
||||
ob_start();
|
||||
$authors = get_editable_user_ids( $current_user->id, true, $type ); // TODO: ROLE SYSTEM
|
||||
$authors_dropdown = '';
|
||||
if ( $authors && count( $authors ) > 1 ) :
|
||||
$users_opt = array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'multi' => 1, 'echo' => 0);
|
||||
$users_opt = array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'multi' => 1);
|
||||
if ( $bulk )
|
||||
$users_opt['show_option_none'] = __('- No Change -');
|
||||
$authors_dropdown = '<label>';
|
||||
$authors_dropdown .= '<span class="title">' . __( 'Author' ) . '</span>';
|
||||
$authors_dropdown .= wp_dropdown_users( $users_opt );
|
||||
$authors_dropdown .= '</label>';
|
||||
?>
|
||||
<label>
|
||||
<span class="title"><?php _e( 'Author' ); ?></span>
|
||||
<?php wp_dropdown_users( $users_opt ); ?>
|
||||
</label>
|
||||
|
||||
<?php
|
||||
endif; // authors
|
||||
$authors_dropdown = ob_get_clean();
|
||||
?>
|
||||
|
||||
<?php if ( !$bulk ) : echo $authors_dropdown; ?>
|
||||
@@ -1295,7 +1294,7 @@ function get_inline_data($post) {
|
||||
echo '
|
||||
<div class="hidden" id="inline_' . $post->ID . '">
|
||||
<div class="post_title">' . $title . '</div>
|
||||
<div class="post_name">' . apply_filters('editable_slug', $post->post_name) . '</div>
|
||||
<div class="post_name">' . $post->post_name . '</div>
|
||||
<div class="post_author">' . $post->post_author . '</div>
|
||||
<div class="comment_status">' . $post->comment_status . '</div>
|
||||
<div class="ping_status">' . $post->ping_status . '</div>
|
||||
@@ -1366,7 +1365,7 @@ function post_rows( $posts = array() ) {
|
||||
* @param unknown_type $mode
|
||||
*/
|
||||
function _post_row($a_post, $pending_comments, $mode) {
|
||||
global $post, $current_user;
|
||||
global $post;
|
||||
static $rowclass;
|
||||
|
||||
$global_post = $post;
|
||||
@@ -1374,6 +1373,7 @@ function _post_row($a_post, $pending_comments, $mode) {
|
||||
setup_postdata($post);
|
||||
|
||||
$rowclass = 'alternate' == $rowclass ? '' : 'alternate';
|
||||
global $current_user;
|
||||
$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
|
||||
$edit_link = get_edit_post_link( $post->ID );
|
||||
$title = _draft_or_post_title();
|
||||
@@ -1438,28 +1438,23 @@ function _post_row($a_post, $pending_comments, $mode) {
|
||||
case 'title':
|
||||
$attributes = 'class="post-title column-title"' . $style;
|
||||
?>
|
||||
<td <?php echo $attributes ?>><strong><?php if ( current_user_can('edit_post', $post->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; }; _post_states($post); ?></strong>
|
||||
<td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; }; _post_states($post); ?></strong>
|
||||
<?php
|
||||
if ( 'excerpt' == $mode )
|
||||
the_excerpt();
|
||||
|
||||
$actions = array();
|
||||
if ( current_user_can('edit_post', $post->ID) && 'trash' != $post->post_status ) {
|
||||
if ( current_user_can('edit_post', $post->ID) ) {
|
||||
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>';
|
||||
$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick Edit') . '</a>';
|
||||
}
|
||||
if ( current_user_can('delete_post', $post->ID) ) {
|
||||
if ( 'trash' == $post->post_status )
|
||||
$actions['untrash'] = "<a title='" . esc_attr(__('Restore this post from the Trash')) . "' href='" . wp_nonce_url("post.php?action=untrash&post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
|
||||
elseif ( EMPTY_TRASH_DAYS )
|
||||
$actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>";
|
||||
if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
|
||||
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
|
||||
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
|
||||
}
|
||||
if ( in_array($post->post_status, array('pending', 'draft')) ) {
|
||||
if ( current_user_can('edit_post', $post->ID) )
|
||||
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
|
||||
} elseif ( 'trash' != $post->post_status ) {
|
||||
} else {
|
||||
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
||||
}
|
||||
$actions = apply_filters('post_row_actions', $actions, $post);
|
||||
@@ -1661,25 +1656,20 @@ foreach ($posts_columns as $column_name=>$column_display_name) {
|
||||
$attributes = 'class="post-title page-title column-title"' . $style;
|
||||
$edit_link = get_edit_post_link( $page->ID );
|
||||
?>
|
||||
<td <?php echo $attributes ?>><strong><?php if ( current_user_can('edit_page', $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . esc_html($parent_name) : ''; ?></strong>
|
||||
<td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_page', $page->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . esc_html($parent_name) : ''; ?></strong>
|
||||
<?php
|
||||
$actions = array();
|
||||
if ( current_user_can('edit_page', $page->ID) && $post->post_status != 'trash' ) {
|
||||
if ( current_user_can('edit_page', $page->ID) ) {
|
||||
$actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>';
|
||||
$actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
|
||||
}
|
||||
if ( current_user_can('delete_page', $page->ID) ) {
|
||||
if ( $post->post_status == 'trash' )
|
||||
$actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("page.php?action=untrash&post=$page->ID", 'untrash-page_' . $page->ID) . "'>" . __('Restore') . "</a>";
|
||||
elseif ( EMPTY_TRASH_DAYS )
|
||||
$actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>";
|
||||
if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS )
|
||||
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";
|
||||
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
|
||||
}
|
||||
if ( in_array($post->post_status, array('pending', 'draft')) ) {
|
||||
if ( current_user_can('edit_page', $page->ID) )
|
||||
$actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
|
||||
} elseif ( $post->post_status != 'trash' ) {
|
||||
} else {
|
||||
$actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
||||
}
|
||||
$actions = apply_filters('page_row_actions', $actions, $page);
|
||||
@@ -1895,7 +1885,6 @@ function user_row( $user_object, $style = '', $role = '' ) {
|
||||
|
||||
if ( !( is_object( $user_object) && is_a( $user_object, 'WP_User' ) ) )
|
||||
$user_object = new WP_User( (int) $user_object );
|
||||
$user_object = sanitize_user_object($user_object, 'display');
|
||||
$email = $user_object->user_email;
|
||||
$url = $user_object->user_url;
|
||||
$short_url = str_replace( 'http://', '', $url );
|
||||
@@ -1997,13 +1986,13 @@ function user_row( $user_object, $style = '', $role = '' ) {
|
||||
*
|
||||
* @since unknown
|
||||
*
|
||||
* @param string $status Comment status (approved, spam, trash, etc)
|
||||
* @param string $s Term to search for
|
||||
* @param int $start Offset to start at for pagination
|
||||
* @param int $num Maximum number of comments to return
|
||||
* @param int $post Post ID or 0 to return all comments
|
||||
* @param string $type Comment type (comment, trackback, pingback, etc)
|
||||
* @return array [0] contains the comments and [1] contains the total number of comments that match (ignoring $start and $num)
|
||||
* @param unknown_type $status
|
||||
* @param unknown_type $s
|
||||
* @param unknown_type $start
|
||||
* @param unknown_type $num
|
||||
* @param unknown_type $post
|
||||
* @param unknown_type $type
|
||||
* @return unknown
|
||||
*/
|
||||
function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
|
||||
global $wpdb;
|
||||
@@ -2015,65 +2004,61 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0
|
||||
$index = '';
|
||||
|
||||
if ( 'moderated' == $status ) {
|
||||
$approved = "c.comment_approved = '0'";
|
||||
$approved = "comment_approved = '0'";
|
||||
$total = $count->moderated;
|
||||
} elseif ( 'approved' == $status ) {
|
||||
$approved = "c.comment_approved = '1'";
|
||||
$approved = "comment_approved = '1'";
|
||||
$total = $count->approved;
|
||||
} elseif ( 'spam' == $status ) {
|
||||
$approved = "c.comment_approved = 'spam'";
|
||||
$approved = "comment_approved = 'spam'";
|
||||
$total = $count->spam;
|
||||
} elseif ( 'trash' == $status ) {
|
||||
$approved = "c.comment_approved = 'trash'";
|
||||
$total = $count->trash;
|
||||
} else {
|
||||
$approved = "( c.comment_approved = '0' OR c.comment_approved = '1' )";
|
||||
$approved = "( comment_approved = '0' OR comment_approved = '1' )";
|
||||
$total = $count->moderated + $count->approved;
|
||||
$index = 'USE INDEX (c.comment_date_gmt)';
|
||||
$index = 'USE INDEX (comment_date_gmt)';
|
||||
}
|
||||
|
||||
if ( $post ) {
|
||||
$total = '';
|
||||
$post = " AND c.comment_post_ID = '$post'";
|
||||
$post = " AND comment_post_ID = '$post'";
|
||||
$orderby = "ORDER BY comment_date_gmt ASC LIMIT $start, $num";
|
||||
} else {
|
||||
$post = '';
|
||||
$orderby = "ORDER BY comment_date_gmt DESC LIMIT $start, $num";
|
||||
}
|
||||
|
||||
$orderby = "ORDER BY c.comment_date_gmt DESC LIMIT $start, $num";
|
||||
|
||||
if ( 'comment' == $type )
|
||||
$typesql = "AND c.comment_type = ''";
|
||||
$typesql = "AND comment_type = ''";
|
||||
elseif ( 'pingback' == $type )
|
||||
$typesql = "AND comment_type = 'pingback'";
|
||||
elseif ( 'trackback' == $type )
|
||||
$typesql = "AND comment_type = 'trackback'";
|
||||
elseif ( 'pings' == $type )
|
||||
$typesql = "AND ( c.comment_type = 'pingback' OR c.comment_type = 'trackback' )";
|
||||
elseif ( 'all' == $type )
|
||||
$typesql = '';
|
||||
elseif ( !empty($type) )
|
||||
$typesql = $wpdb->prepare("AND c.comment_type = %s", $type);
|
||||
$typesql = "AND ( comment_type = 'pingback' OR comment_type = 'trackback' )";
|
||||
else
|
||||
$typesql = '';
|
||||
|
||||
if ( !empty($type) )
|
||||
$total = '';
|
||||
|
||||
$query = "FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ";
|
||||
if ( $s ) {
|
||||
$total = '';
|
||||
$s = $wpdb->escape($s);
|
||||
$query .= "AND
|
||||
(c.comment_author LIKE '%$s%' OR
|
||||
c.comment_author_email LIKE '%$s%' OR
|
||||
c.comment_author_url LIKE ('%$s%') OR
|
||||
c.comment_author_IP LIKE ('%$s%') OR
|
||||
c.comment_content LIKE ('%$s%') ) AND
|
||||
$query = "FROM $wpdb->comments WHERE
|
||||
(comment_author LIKE '%$s%' OR
|
||||
comment_author_email LIKE '%$s%' OR
|
||||
comment_author_url LIKE ('%$s%') OR
|
||||
comment_author_IP LIKE ('%$s%') OR
|
||||
comment_content LIKE ('%$s%') ) AND
|
||||
$approved
|
||||
$typesql";
|
||||
} else {
|
||||
$query .= "AND $approved $post $typesql";
|
||||
$query = "FROM $wpdb->comments $index WHERE $approved $post $typesql";
|
||||
}
|
||||
|
||||
$comments = $wpdb->get_results("SELECT * $query $orderby");
|
||||
if ( '' === $total )
|
||||
$total = $wpdb->get_var("SELECT COUNT(c.comment_ID) $query");
|
||||
$total = $wpdb->get_var("SELECT COUNT(comment_ID) $query");
|
||||
|
||||
update_comment_cache($comments);
|
||||
|
||||
@@ -2110,18 +2095,10 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true,
|
||||
else
|
||||
$ptime = mysql2date(__('Y/m/d \a\t g:i A'), $comment->comment_date );
|
||||
|
||||
if ( $user_can ) {
|
||||
$del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
|
||||
$approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
|
||||
|
||||
$approve_url = esc_url( "comment.php?action=approvecomment&p=$post->ID&c=$comment->comment_ID&$approve_nonce" );
|
||||
$unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$post->ID&c=$comment->comment_ID&$approve_nonce" );
|
||||
$spam_url = esc_url( "comment.php?action=spamcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
|
||||
$unspam_url = esc_url( "comment.php?action=unspamcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
|
||||
$trash_url = esc_url( "comment.php?action=trashcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
|
||||
$untrash_url = esc_url( "comment.php?action=untrashcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
|
||||
$delete_url = esc_url( "comment.php?action=deletecomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
|
||||
}
|
||||
$delete_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&p=$post->ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
|
||||
$approve_url = esc_url( wp_nonce_url( "comment.php?action=approvecomment&p=$post->ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) );
|
||||
$unapprove_url = esc_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$post->ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) );
|
||||
$spam_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$post->ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
|
||||
|
||||
echo "<tr id='comment-$comment->comment_ID' class='$the_comment_status'>";
|
||||
$columns = get_column_headers('edit-comments');
|
||||
@@ -2147,61 +2124,38 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true,
|
||||
echo '<div id="submitted-on">';
|
||||
printf(__('Submitted on <a href="%1$s">%2$s at %3$s</a>'), get_comment_link($comment->comment_ID), get_comment_date(__('Y/m/d')), get_comment_date(__('g:ia')));
|
||||
echo '</div>';
|
||||
comment_text();
|
||||
if ( $user_can ) { ?>
|
||||
comment_text(); ?>
|
||||
<div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
|
||||
<textarea class="comment" rows="1" cols="1"><?php echo htmlspecialchars( apply_filters('comment_edit_pre', $comment->comment_content), ENT_QUOTES ); ?></textarea>
|
||||
<div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
|
||||
<div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
|
||||
<textarea class="comment" rows="3" cols="10"><?php echo $comment->comment_content; ?></textarea>
|
||||
<div class="author-email"><?php if ( $user_can ) echo esc_attr( $comment->comment_author_email ); ?></div>
|
||||
<div class="author"><?php if ( $user_can ) echo esc_attr( $comment->comment_author ); ?></div>
|
||||
<div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
|
||||
<div class="comment_status"><?php echo $comment->comment_approved; ?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
$actions = array();
|
||||
|
||||
if ( $user_can ) {
|
||||
// preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash
|
||||
$actions = array(
|
||||
'approve' => '', 'unapprove' => '',
|
||||
'reply' => '',
|
||||
'quickedit' => '',
|
||||
'edit' => '',
|
||||
'spam' => '', 'unspam' => '',
|
||||
'trash' => '', 'untrash' => '', 'delete' => ''
|
||||
);
|
||||
|
||||
$actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
|
||||
$actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
|
||||
if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments
|
||||
if ( 'approved' == $the_comment_status )
|
||||
if ( 'approved' == $the_comment_status ) {
|
||||
$actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved vim-u vim-destructive' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
|
||||
else if ( 'unapproved' == $the_comment_status )
|
||||
unset($actions['approve']);
|
||||
} else {
|
||||
$actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved vim-a vim-destructive' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
|
||||
} else {
|
||||
$actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
|
||||
$actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
|
||||
unset($actions['unapprove']);
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {
|
||||
if ( 'spam' != $the_comment_status )
|
||||
$actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
|
||||
} elseif ( 'spam' == $the_comment_status ) {
|
||||
$actions['unspam'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1 vim-z vim-destructive'>" . __( 'Not Spam' ) . '</a>';
|
||||
} elseif ( 'trash' == $the_comment_status ) {
|
||||
$actions['untrash'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1 vim-z vim-destructive'>" . __( 'Restore' ) . '</a>';
|
||||
}
|
||||
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
|
||||
$actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
|
||||
$actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
|
||||
if ( 'spam' != $the_comment_status )
|
||||
$actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\');return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
|
||||
|
||||
if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) {
|
||||
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::delete=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
|
||||
} else {
|
||||
$actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
|
||||
}
|
||||
|
||||
if ( 'trash' != $the_comment_status ) {
|
||||
$actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
|
||||
$actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
|
||||
if ( 'spam' != $the_comment_status )
|
||||
$actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\');return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
|
||||
}
|
||||
|
||||
$actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
|
||||
$actions = apply_filters( 'comment_row_actions', $actions, $comment );
|
||||
|
||||
$i = 0;
|
||||
echo '<div class="row-actions">';
|
||||
@@ -2212,12 +2166,6 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true,
|
||||
// Reply and quickedit need a hide-if-no-js span when not added with ajax
|
||||
if ( ('reply' == $action || 'quickedit' == $action) && ! $from_ajax )
|
||||
$action .= ' hide-if-no-js';
|
||||
elseif ( ($action == 'untrash' && $the_comment_status == 'trash') || ($action == 'unspam' && $the_comment_status == 'spam') ) {
|
||||
if ('1' == get_comment_meta($comment_id, '_wp_trash_meta_status', true))
|
||||
$action .= ' approve';
|
||||
else
|
||||
$action .= ' unapprove';
|
||||
}
|
||||
|
||||
echo "<span class='$action'>$sep$link</span>";
|
||||
}
|
||||
@@ -2317,9 +2265,9 @@ function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single',
|
||||
?>
|
||||
<form method="get" action="">
|
||||
<?php if ( $table_row ) : ?>
|
||||
<table style="display:none;"><tbody id="com-reply"><tr id="replyrow" style="display:none;"><td colspan="<?php echo $col_count; ?>">
|
||||
<table style="display:none;"><tbody id="com-reply"><tr id="replyrow"><td colspan="<?php echo $col_count; ?>">
|
||||
<?php else : ?>
|
||||
<div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;">
|
||||
<div id="com-reply" style="display:none;"><div id="replyrow">
|
||||
<?php endif; ?>
|
||||
<div id="replyhead" style="display:none;"><?php _e('Reply to Comment'); ?></div>
|
||||
|
||||
@@ -2372,22 +2320,6 @@ function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single',
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Output 'undo move to trash' text for comments
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
function wp_comment_trashnotice() {
|
||||
?>
|
||||
<div class="hidden" id="trash-undo-holder">
|
||||
<div class="trash-undo-inside"><?php printf(__('Comment by %s moved to the trash.'), '<strong></strong>'); ?> <span class="undo untrash"><a href="#"><?php _e('Undo'); ?></a></span></div>
|
||||
</div>
|
||||
<div class="hidden" id="spam-undo-holder">
|
||||
<div class="spam-undo-inside"><?php printf(__('Comment by %s marked as spam.'), '<strong></strong>'); ?> <span class="undo unspam"><a href="#"><?php _e('Undo'); ?></a></span></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
@@ -2629,12 +2561,10 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
|
||||
$year = '<input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />';
|
||||
$hour = '<input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
|
||||
$minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
|
||||
|
||||
echo '<div class="timestamp-wrap">';
|
||||
/* translators: 1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input */
|
||||
printf(__('%1$s%2$s, %3$s @ %4$s : %5$s'), $month, $day, $year, $hour, $minute);
|
||||
|
||||
echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
|
||||
echo '<input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
|
||||
|
||||
if ( $multi ) return;
|
||||
|
||||
@@ -2850,11 +2780,11 @@ function wp_max_upload_size() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the form used by the importers to accept the data to be imported
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.0
|
||||
* @since unknown
|
||||
*
|
||||
* @param string $action The action attribute for the form.
|
||||
* @param unknown_type $action
|
||||
*/
|
||||
function wp_import_upload_form( $action ) {
|
||||
$bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
|
||||
@@ -2865,8 +2795,9 @@ function wp_import_upload_form( $action ) {
|
||||
<p><strong><?php echo $upload_dir['error']; ?></strong></p></div><?php
|
||||
else :
|
||||
?>
|
||||
<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo esc_attr(wp_nonce_url($action, 'import-upload')); ?>">
|
||||
<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo esc_attr($action) ?>">
|
||||
<p>
|
||||
<?php wp_nonce_field('import-upload'); ?>
|
||||
<label for="upload"><?php _e( 'Choose a file from your computer:' ); ?></label> (<?php printf( __('Maximum size: %s' ), $size ); ?>)
|
||||
<input type="file" id="upload" name="import" size="25" />
|
||||
<input type="hidden" name="action" value="save" />
|
||||
@@ -3076,7 +3007,10 @@ function get_hidden_meta_boxes($page) {
|
||||
|
||||
// Hide slug boxes by default
|
||||
if ( empty($hidden[0]) ) {
|
||||
$hidden = array('slugdiv');
|
||||
if ( 'page' == $page )
|
||||
$hidden = array('pageslugdiv');
|
||||
elseif ( 'post' == $page )
|
||||
$hidden = array('slugdiv');
|
||||
}
|
||||
|
||||
return $hidden;
|
||||
@@ -3175,7 +3109,7 @@ function do_settings_fields($page, $section) {
|
||||
else
|
||||
echo '<th scope="row">' . $field['title'] . '</th>';
|
||||
echo '<td>';
|
||||
call_user_func($field['callback'], $field['args']);
|
||||
call_user_func($field['callback']);
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
@@ -3716,20 +3650,14 @@ function screen_options($screen) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$option = str_replace( '-', '_', "${screen}_per_page" );
|
||||
$per_page = (int) get_user_option( $option, 0, false );
|
||||
if ( empty( $per_page ) || $per_page < 1 ) {
|
||||
$option = str_replace('-', '_', "${screen}_per_page");
|
||||
$per_page = get_user_option($option);
|
||||
if ( empty($per_page) ) {
|
||||
if ( 'plugins' == $screen )
|
||||
$per_page = 999;
|
||||
else
|
||||
$per_page = 20;
|
||||
}
|
||||
if ( 'edit_comments_per_page' == $option )
|
||||
$per_page = apply_filters( 'comments_per_page', $per_page, isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all' );
|
||||
elseif ( 'categories' == $option )
|
||||
$per_page = apply_filters( 'edit_categories_per_page', $per_page );
|
||||
else
|
||||
$per_page = apply_filters( $option, $per_page );
|
||||
|
||||
$return = '<h5>' . __('Options') . "</h5>\n";
|
||||
$return .= "<div class='screen-options'>\n";
|
||||
|
||||
@@ -28,8 +28,6 @@ function current_theme_info() {
|
||||
$ct->description = $themes[$current_theme]['Description'];
|
||||
$ct->author = $themes[$current_theme]['Author'];
|
||||
$ct->tags = $themes[$current_theme]['Tags'];
|
||||
$ct->theme_root = $themes[$current_theme]['Theme Root'];
|
||||
$ct->theme_root_uri = $themes[$current_theme]['Theme Root URI'];
|
||||
return $ct;
|
||||
}
|
||||
|
||||
@@ -117,36 +115,28 @@ function get_broken_themes() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Page Templates available in this theme
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since unknown
|
||||
*
|
||||
* @return array Key is template name, Value is template name
|
||||
* @return unknown
|
||||
*/
|
||||
function get_page_templates() {
|
||||
$themes = get_themes();
|
||||
$theme = get_current_theme();
|
||||
$templates = $themes[$theme]['Template Files'];
|
||||
$page_templates = array();
|
||||
$page_templates = array ();
|
||||
|
||||
if ( is_array( $templates ) ) {
|
||||
$base = array( trailingslashit(get_template_directory()), trailingslashit(get_stylesheet_directory()) );
|
||||
|
||||
foreach ( $templates as $template ) {
|
||||
$basename = str_replace($base, '', $template);
|
||||
|
||||
// don't allow template files in subdirectories
|
||||
if ( false !== strpos($basename, '/') )
|
||||
continue;
|
||||
|
||||
$template_data = implode( '', file( $template ));
|
||||
$template_data = implode( '', file( WP_CONTENT_DIR.$template ));
|
||||
|
||||
$name = '';
|
||||
if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) )
|
||||
$name = _cleanup_header_comment($name[1]);
|
||||
|
||||
if ( !empty( $name ) ) {
|
||||
$page_templates[trim( $name )] = $basename;
|
||||
$page_templates[trim( $name )] = basename( $template );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,18 +144,4 @@ function get_page_templates() {
|
||||
return $page_templates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tidies a filename for url display by the theme editor.
|
||||
*
|
||||
* @since 2.9.0
|
||||
* @private
|
||||
*
|
||||
* @param string $fullpath Full path to the theme file
|
||||
* @param string $containingfolder Path of the theme parent folder
|
||||
* @return string
|
||||
*/
|
||||
function _get_template_edit_filename($fullpath, $containingfolder) {
|
||||
return str_replace(dirname(dirname( $containingfolder )) , '', $fullpath);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -55,12 +55,6 @@ $_old_files = array(
|
||||
'wp-admin/js/link-cat.js',
|
||||
'wp-admin/js/forms.js',
|
||||
'wp-admin/js/upload.js',
|
||||
'wp-admin/js/set-post-thumbnail-handler.js',
|
||||
'wp-admin/js/set-post-thumbnail-handler.dev.js',
|
||||
'wp-admin/js/page.js',
|
||||
'wp-admin/js/page.dev.js',
|
||||
'wp-admin/js/slug.js',
|
||||
'wp-admin/js/slug.dev.js',
|
||||
'wp-admin/profile-update.php',
|
||||
'wp-admin/templates.php',
|
||||
'wp-includes/images/audio.png',
|
||||
@@ -132,8 +126,6 @@ $_old_files = array(
|
||||
'wp-admin/edit-form-ajax-cat.php',
|
||||
'wp-admin/execute-pings.php',
|
||||
'wp-admin/import/b2.php',
|
||||
'wp-admin/import/btt.php',
|
||||
'wp-admin/import/jkw.php',
|
||||
'wp-admin/inline-uploading.php',
|
||||
'wp-admin/link-categories.php',
|
||||
'wp-admin/list-manipulation.js',
|
||||
@@ -169,9 +161,7 @@ $_old_files = array(
|
||||
'wp-images/smilies',
|
||||
'wp-images/wp-small.png',
|
||||
'wp-images/wpminilogo.png',
|
||||
'wp.php',
|
||||
'wp-includes/gettext.php',
|
||||
'wp-includes/streams.php'
|
||||
'wp.php'
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -215,25 +205,10 @@ $_old_files = array(
|
||||
* @return WP_Error|null WP_Error on failure, null on success.
|
||||
*/
|
||||
function update_core($from, $to) {
|
||||
global $wp_filesystem, $_old_files, $wpdb;
|
||||
global $wp_filesystem, $_old_files;
|
||||
|
||||
@set_time_limit( 300 );
|
||||
|
||||
$php_version = phpversion();
|
||||
$mysql_version = $wpdb->db_version();
|
||||
$required_php_version = '4.3';
|
||||
$required_mysql_version = '4.1.2';
|
||||
$wp_version = '2.9';
|
||||
$php_compat = version_compare( $php_version, $required_php_version, '>=' );
|
||||
$mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
|
||||
|
||||
if ( !$mysql_compat && !$php_compat )
|
||||
return new WP_Error( 'php_mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) );
|
||||
elseif ( !$php_compat )
|
||||
return new WP_Error( 'php_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ) );
|
||||
elseif ( !$mysql_compat )
|
||||
return new WP_Error( 'mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ) );
|
||||
|
||||
// Sanity check the unzipped distribution
|
||||
apply_filters('update_feedback', __('Verifying the unpacked files'));
|
||||
if ( !$wp_filesystem->exists($from . '/wordpress/wp-settings.php') || !$wp_filesystem->exists($from . '/wordpress/wp-admin/admin.php') ||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* WordPress Administration Update API
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
* @subpackage Admin
|
||||
*/
|
||||
|
||||
// The admin side of our 1.1 update system
|
||||
@@ -145,31 +145,6 @@ function update_right_now_message() {
|
||||
echo "<span id='wp-version-message'>$msg</span>";
|
||||
}
|
||||
|
||||
function get_plugin_updates() {
|
||||
$all_plugins = get_plugins();
|
||||
$upgrade_plugins = array();
|
||||
$current = get_transient( 'update_plugins' );
|
||||
foreach ( (array)$all_plugins as $plugin_file => $plugin_data) {
|
||||
if ( isset( $current->response[ $plugin_file ] ) ) {
|
||||
$upgrade_plugins[ $plugin_file ] = (object) $plugin_data;
|
||||
$upgrade_plugins[ $plugin_file ]->update = $current->response[ $plugin_file ];
|
||||
}
|
||||
}
|
||||
|
||||
return $upgrade_plugins;
|
||||
}
|
||||
|
||||
function wp_plugin_update_rows() {
|
||||
$plugins = get_transient( 'update_plugins' );
|
||||
if ( isset($plugins->response) && is_array($plugins->response) ) {
|
||||
$plugins = array_keys( $plugins->response );
|
||||
foreach( $plugins as $plugin_file ) {
|
||||
add_action( "after_plugin_row_$plugin_file", 'wp_plugin_update_row', 10, 2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'admin_init', 'wp_plugin_update_rows' );
|
||||
|
||||
function wp_plugin_update_row( $file, $plugin_data ) {
|
||||
$current = get_transient( 'update_plugins' );
|
||||
if ( !isset( $current->response[ $file ] ) )
|
||||
@@ -194,6 +169,7 @@ function wp_plugin_update_row( $file, $plugin_data ) {
|
||||
|
||||
echo '</div></td></tr>';
|
||||
}
|
||||
add_action( 'after_plugin_row', 'wp_plugin_update_row', 10, 2 );
|
||||
|
||||
function wp_update_plugin($plugin, $feedback = '') {
|
||||
|
||||
@@ -205,22 +181,6 @@ function wp_update_plugin($plugin, $feedback = '') {
|
||||
return $upgrader->upgrade($plugin);
|
||||
}
|
||||
|
||||
function get_theme_updates() {
|
||||
$themes = get_themes();
|
||||
$current = get_transient('update_themes');
|
||||
$update_themes = array();
|
||||
|
||||
foreach ( $themes as $theme ) {
|
||||
$theme = (object) $theme;
|
||||
if ( isset($current->response[ $theme->Stylesheet ]) ) {
|
||||
$update_themes[$theme->Stylesheet] = $theme;
|
||||
$update_themes[$theme->Stylesheet]->update = $current->response[ $theme->Stylesheet ];
|
||||
}
|
||||
}
|
||||
|
||||
return $update_themes;
|
||||
}
|
||||
|
||||
function wp_update_theme($theme, $feedback = '') {
|
||||
|
||||
if ( !empty($feedback) )
|
||||
|
||||
@@ -269,7 +269,6 @@ function wp_upgrade() {
|
||||
|
||||
wp_check_mysql_version();
|
||||
wp_cache_flush();
|
||||
pre_schema_upgrade();
|
||||
make_db_current_silent();
|
||||
upgrade_all();
|
||||
wp_cache_flush();
|
||||
@@ -346,9 +345,6 @@ function upgrade_all() {
|
||||
if ( $wp_current_db_version < 10360 )
|
||||
upgrade_280();
|
||||
|
||||
if ( $wp_current_db_version < 11958 )
|
||||
upgrade_290();
|
||||
|
||||
maybe_disable_automattic_widgets();
|
||||
|
||||
update_option( 'db_version', $wp_db_version );
|
||||
@@ -558,10 +554,8 @@ function upgrade_130() {
|
||||
if ( 1 != $option->dupes ) { // Could this be done in the query?
|
||||
$limit = $option->dupes - 1;
|
||||
$dupe_ids = $wpdb->get_col( $wpdb->prepare("SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit) );
|
||||
if ( $dupe_ids ) {
|
||||
$dupe_ids = join($dupe_ids, ',');
|
||||
$wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)");
|
||||
}
|
||||
$dupe_ids = join($dupe_ids, ',');
|
||||
$wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -986,23 +980,6 @@ function upgrade_280() {
|
||||
populate_roles_280();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute changes made in WordPress 2.9.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
function upgrade_290() {
|
||||
global $wp_current_db_version;
|
||||
|
||||
if ( $wp_current_db_version < 11958 ) {
|
||||
// Previously, setting depth to 1 would redundantly disable threading, but now 2 is the minimum depth to avoid confusion
|
||||
if ( get_option( 'thread_comments_depth' ) == '1' ) {
|
||||
update_option( 'thread_comments_depth', 2 );
|
||||
update_option( 'thread_comments', 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// The functions we use to actually do stuff
|
||||
|
||||
@@ -1679,28 +1656,4 @@ function maybe_disable_automattic_widgets() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs before the schema is upgraded.
|
||||
*/
|
||||
function pre_schema_upgrade() {
|
||||
global $wp_current_db_version, $wp_db_version, $wpdb;
|
||||
|
||||
// Upgrade versions prior to 2.9
|
||||
if ( $wp_current_db_version < 11557 ) {
|
||||
// Delete duplicate options. Keep the option with the highest option_id.
|
||||
$delete_options = $wpdb->get_col("SELECT o1.option_id FROM $wpdb->options AS o1 JOIN $wpdb->options AS o2 ON o2.option_name = o1.option_name AND o2.option_id > o1.option_id");
|
||||
if ( !empty($delete_options) ) {
|
||||
$delete_options = implode(',', $delete_options);
|
||||
$wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($delete_options)");
|
||||
}
|
||||
|
||||
// Drop the old primary key and add the new.
|
||||
$wpdb->query("ALTER TABLE $wpdb->options DROP PRIMARY KEY, ADD PRIMARY KEY(option_id)");
|
||||
|
||||
// Drop the old option_name index. dbDelta() doesn't do the drop.
|
||||
$wpdb->query("ALTER TABLE $wpdb->options DROP INDEX option_name");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* Creates a new user from the "Users" form using $_POST information.
|
||||
*
|
||||
* It seems that the first half is for backwards compatibility, but only
|
||||
* has the ability to alter the user's role. WordPress core seems to
|
||||
* has the ability to alter the user's role. Wordpress core seems to
|
||||
* use this function only in the second way, running edit_user() with
|
||||
* no id so as to create a new user.
|
||||
*
|
||||
@@ -25,16 +25,15 @@ function add_user() {
|
||||
$user_id = (int) func_get_arg( 0 );
|
||||
|
||||
if ( isset( $_POST['role'] ) ) {
|
||||
$new_role = sanitize_text_field( $_POST['role'] );
|
||||
// Don't let anyone with 'edit_users' (admins) edit their own role to something without it.
|
||||
if ( $user_id != $current_user->id || $wp_roles->role_objects[$new_role]->has_cap( 'edit_users' ) ) {
|
||||
if( $user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap( 'edit_users' ) ) {
|
||||
// If the new role isn't editable by the logged-in user die with error
|
||||
$editable_roles = get_editable_roles();
|
||||
if ( !$editable_roles[$new_role] )
|
||||
if (!$editable_roles[$_POST['role']])
|
||||
wp_die(__('You can’t give users that role.'));
|
||||
|
||||
$user = new WP_User( $user_id );
|
||||
$user->set_role( $new_role );
|
||||
$user->set_role( $_POST['role'] );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -65,8 +64,8 @@ function edit_user( $user_id = 0 ) {
|
||||
$user = '';
|
||||
}
|
||||
|
||||
if ( !$update && isset( $_POST['user_login'] ) )
|
||||
$user->user_login = sanitize_user($_POST['user_login'], true);
|
||||
if ( isset( $_POST['user_login'] ))
|
||||
$user->user_login = esc_html( trim( $_POST['user_login'] ));
|
||||
|
||||
$pass1 = $pass2 = '';
|
||||
if ( isset( $_POST['pass1'] ))
|
||||
@@ -75,55 +74,63 @@ function edit_user( $user_id = 0 ) {
|
||||
$pass2 = $_POST['pass2'];
|
||||
|
||||
if ( isset( $_POST['role'] ) && current_user_can( 'edit_users' ) ) {
|
||||
$new_role = sanitize_text_field( $_POST['role'] );
|
||||
|
||||
// Don't let anyone with 'edit_users' (admins) edit their own role to something without it.
|
||||
if( $user_id != $current_user->id || $wp_roles->role_objects[$new_role]->has_cap( 'edit_users' ))
|
||||
$user->role = $new_role;
|
||||
if( $user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap( 'edit_users' ))
|
||||
$user->role = $_POST['role'];
|
||||
|
||||
// If the new role isn't editable by the logged-in user die with error
|
||||
$editable_roles = get_editable_roles();
|
||||
if ( !$editable_roles[$new_role] )
|
||||
if (!$editable_roles[$_POST['role']])
|
||||
wp_die(__('You can’t give users that role.'));
|
||||
}
|
||||
|
||||
if ( isset( $_POST['email'] ))
|
||||
$user->user_email = sanitize_text_field( $_POST['email'] );
|
||||
$user->user_email = esc_html( trim( $_POST['email'] ));
|
||||
if ( isset( $_POST['url'] ) ) {
|
||||
if ( empty ( $_POST['url'] ) || $_POST['url'] == 'http://' ) {
|
||||
$user->user_url = '';
|
||||
} else {
|
||||
$user->user_url = sanitize_url( $_POST['url'] );
|
||||
$user->user_url = esc_url( trim( $_POST['url'] ));
|
||||
$user->user_url = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url;
|
||||
}
|
||||
}
|
||||
if ( isset( $_POST['first_name'] ) )
|
||||
$user->first_name = sanitize_text_field( $_POST['first_name'] );
|
||||
if ( isset( $_POST['last_name'] ) )
|
||||
$user->last_name = sanitize_text_field( $_POST['last_name'] );
|
||||
if ( isset( $_POST['nickname'] ) )
|
||||
$user->nickname = sanitize_text_field( $_POST['nickname'] );
|
||||
if ( isset( $_POST['display_name'] ) )
|
||||
$user->display_name = sanitize_text_field( $_POST['display_name'] );
|
||||
|
||||
if ( isset( $_POST['description'] ) )
|
||||
if ( isset( $_POST['first_name'] ))
|
||||
$user->first_name = esc_html( trim( $_POST['first_name'] ));
|
||||
if ( isset( $_POST['last_name'] ))
|
||||
$user->last_name = esc_html( trim( $_POST['last_name'] ));
|
||||
if ( isset( $_POST['nickname'] ))
|
||||
$user->nickname = esc_html( trim( $_POST['nickname'] ));
|
||||
if ( isset( $_POST['display_name'] ))
|
||||
$user->display_name = esc_html( trim( $_POST['display_name'] ));
|
||||
if ( isset( $_POST['description'] ))
|
||||
$user->description = trim( $_POST['description'] );
|
||||
if ( isset( $_POST['jabber'] ))
|
||||
$user->jabber = esc_html( trim( $_POST['jabber'] ));
|
||||
if ( isset( $_POST['aim'] ))
|
||||
$user->aim = esc_html( trim( $_POST['aim'] ));
|
||||
if ( isset( $_POST['yim'] ))
|
||||
$user->yim = esc_html( trim( $_POST['yim'] ));
|
||||
if ( !$update )
|
||||
$user->rich_editing = 'true'; // Default to true for new users.
|
||||
else if ( isset( $_POST['rich_editing'] ) )
|
||||
$user->rich_editing = $_POST['rich_editing'];
|
||||
else
|
||||
$user->rich_editing = 'true';
|
||||
|
||||
foreach ( _wp_get_user_contactmethods() as $method => $name ) {
|
||||
if ( isset( $_POST[$method] ))
|
||||
$user->$method = sanitize_text_field( $_POST[$method] );
|
||||
}
|
||||
|
||||
if ( $update ) {
|
||||
$user->rich_editing = isset( $_POST['rich_editing'] ) && 'false' == $_POST['rich_editing'] ? 'false' : 'true';
|
||||
$user->admin_color = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'fresh';
|
||||
}
|
||||
|
||||
$user->comment_shortcuts = isset( $_POST['comment_shortcuts'] ) && 'true' == $_POST['comment_shortcuts'] ? 'true' : '';
|
||||
$user->comment_shortcuts = isset( $_POST['comment_shortcuts'] )? $_POST['comment_shortcuts'] : '';
|
||||
|
||||
$user->use_ssl = 0;
|
||||
if ( !empty($_POST['use_ssl']) )
|
||||
$user->use_ssl = 1;
|
||||
|
||||
if ( !$update )
|
||||
$user->admin_color = 'fresh'; // Default to fresh for new users.
|
||||
else if ( isset( $_POST['admin_color'] ) )
|
||||
$user->admin_color = $_POST['admin_color'];
|
||||
else
|
||||
$user->admin_color = 'fresh';
|
||||
|
||||
$errors = new WP_Error();
|
||||
|
||||
/* checking that username has been typed */
|
||||
@@ -153,34 +160,34 @@ function edit_user( $user_id = 0 ) {
|
||||
if ( $pass1 != $pass2 )
|
||||
$errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter the same password in the two password fields.' ), array( 'form-field' => 'pass1' ) );
|
||||
|
||||
if ( !empty( $pass1 ) )
|
||||
if (!empty ( $pass1 ))
|
||||
$user->user_pass = $pass1;
|
||||
|
||||
if ( !$update && !validate_username( $user->user_login ) )
|
||||
$errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is invalid. Please enter a valid username.' ));
|
||||
|
||||
if ( !$update && username_exists( $user->user_login ) )
|
||||
if (!$update && username_exists( $user->user_login ))
|
||||
$errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ));
|
||||
|
||||
/* checking e-mail address */
|
||||
if ( empty( $user->user_email ) ) {
|
||||
if ( empty ( $user->user_email ) ) {
|
||||
$errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please enter an e-mail address.' ), array( 'form-field' => 'email' ) );
|
||||
} elseif ( !is_email( $user->user_email ) ) {
|
||||
} elseif (!is_email( $user->user_email ) ) {
|
||||
$errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The e-mail address isn’t correct.' ), array( 'form-field' => 'email' ) );
|
||||
} elseif ( ( $owner_id = email_exists($user->user_email) ) && $owner_id != $user->ID ) {
|
||||
$errors->add( 'email_exists', __('<strong>ERROR</strong>: This email is already registered, please choose another one.'), array( 'form-field' => 'email' ) );
|
||||
}
|
||||
|
||||
// Allow plugins to return their own errors.
|
||||
// Allow plugins to return there own errors.
|
||||
do_action_ref_array('user_profile_update_errors', array ( &$errors, $update, &$user ) );
|
||||
|
||||
if ( $errors->get_error_codes() )
|
||||
return $errors;
|
||||
|
||||
if ( $update ) {
|
||||
$user_id = wp_update_user( get_object_vars( $user ) );
|
||||
$user_id = wp_update_user( get_object_vars( $user ));
|
||||
} else {
|
||||
$user_id = wp_insert_user( get_object_vars( $user ) );
|
||||
$user_id = wp_insert_user( get_object_vars( $user ));
|
||||
wp_new_user_notification( $user_id, isset($_POST['send_password']) ? $pass1 : '' );
|
||||
}
|
||||
return $user_id;
|
||||
@@ -364,17 +371,17 @@ function get_others_pending($user_id) {
|
||||
*/
|
||||
function get_user_to_edit( $user_id ) {
|
||||
$user = new WP_User( $user_id );
|
||||
|
||||
$user_contactmethods = _wp_get_user_contactmethods();
|
||||
foreach ($user_contactmethods as $method => $name) {
|
||||
if ( empty( $user->{$method} ) )
|
||||
$user->{$method} = '';
|
||||
}
|
||||
|
||||
if ( empty($user->description) )
|
||||
$user->description = '';
|
||||
|
||||
$user = sanitize_user_object($user, 'edit');
|
||||
$user->user_login = esc_attr($user->user_login);
|
||||
$user->user_email = esc_attr($user->user_email);
|
||||
$user->user_url = esc_url($user->user_url);
|
||||
$user->first_name = esc_attr($user->first_name);
|
||||
$user->last_name = esc_attr($user->last_name);
|
||||
$user->display_name = esc_attr($user->display_name);
|
||||
$user->nickname = esc_attr($user->nickname);
|
||||
$user->aim = isset( $user->aim ) && !empty( $user->aim ) ? esc_attr($user->aim) : '';
|
||||
$user->yim = isset( $user->yim ) && !empty( $user->yim ) ? esc_attr($user->yim) : '';
|
||||
$user->jabber = isset( $user->jabber ) && !empty( $user->jabber ) ? esc_attr($user->jabber) : '';
|
||||
$user->description = isset( $user->description ) && !empty( $user->description ) ? esc_html($user->description) : '';
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
@@ -52,28 +52,18 @@ function wp_list_widgets() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the widgets and their settings for a sidebar.
|
||||
* Used in the the admin widget config screen.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since unknown
|
||||
*
|
||||
* @param string $sidebar id slug of the sidebar
|
||||
* @param string $sidebar
|
||||
*/
|
||||
function wp_list_widget_controls( $sidebar ) {
|
||||
add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' );
|
||||
|
||||
echo "<div id='$sidebar' class='widgets-sortables'>\n";
|
||||
|
||||
$description = wp_sidebar_description( $sidebar );
|
||||
|
||||
if ( !empty( $description ) ) {
|
||||
echo "<div class='sidebar-description'>\n";
|
||||
echo "\t<p class='description'>$description</p>";
|
||||
echo "</div>\n";
|
||||
}
|
||||
|
||||
echo "\t<div id='$sidebar' class='widgets-sortables'>\n";
|
||||
dynamic_sidebar( $sidebar );
|
||||
echo "</div>\n";
|
||||
echo "\t</div>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,15 +180,15 @@ function wp_widget_control( $sidebar_args ) {
|
||||
</div>
|
||||
<input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($id_format); ?>" />
|
||||
<input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr($id_base); ?>" />
|
||||
<input type="hidden" name="widget-width" class="widget-width" value="<?php if (isset( $control['width'] )) echo esc_attr($control['width']); ?>" />
|
||||
<input type="hidden" name="widget-height" class="widget-height" value="<?php if (isset( $control['height'] )) echo esc_attr($control['height']); ?>" />
|
||||
<input type="hidden" name="widget-width" class="widget-width" value="<?php echo esc_attr($control['width']); ?>" />
|
||||
<input type="hidden" name="widget-height" class="widget-height" value="<?php echo esc_attr($control['height']); ?>" />
|
||||
<input type="hidden" name="widget_number" class="widget_number" value="<?php echo esc_attr($widget_number); ?>" />
|
||||
<input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr($multi_number); ?>" />
|
||||
<input type="hidden" name="add_new" class="add_new" value="<?php echo esc_attr($add_new); ?>" />
|
||||
|
||||
<div class="widget-control-actions">
|
||||
<div class="alignleft">
|
||||
<a class="widget-control-remove" href="#remove"><?php _e('Delete'); ?></a> |
|
||||
<a class="widget-control-remove" href="#remove"><?php _e('Remove'); ?></a> |
|
||||
<a class="widget-control-close" href="#close"><?php _e('Close'); ?></a>
|
||||
</div>
|
||||
<div class="alignright<?php if ( 'noform' === $has_form ) echo ' widget-control-noform'; ?>">
|
||||
|
||||
@@ -49,12 +49,6 @@ header( 'Content-Type: text/html; charset=utf-8' );
|
||||
}//end function display_header();
|
||||
|
||||
function display_setup_form( $error = null ) {
|
||||
// Ensure that Blogs appear in search engines by default
|
||||
$blog_public = 1;
|
||||
if ( isset($_POST) && !empty($_POST) ) {
|
||||
$blog_public = isset($_POST['blog_public']);
|
||||
}
|
||||
|
||||
if ( ! is_null( $error ) ) {
|
||||
?>
|
||||
<p><?php printf( __('<strong>ERROR</strong>: %s'), $error); ?></p>
|
||||
@@ -68,10 +62,10 @@ function display_setup_form( $error = null ) {
|
||||
<tr>
|
||||
<th scope="row"><label for="admin_email"><?php _e('Your E-mail'); ?></label></th>
|
||||
<td><input name="admin_email" type="text" id="admin_email" size="25" value="<?php echo ( isset($_POST['admin_email']) ? esc_attr($_POST['admin_email']) : '' ); ?>" /><br />
|
||||
<?php _e('Double-check your email address before continuing.'); ?></td>
|
||||
<?php _e('Double-check your email address before continuing.'); ?>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><label><input type="checkbox" name="blog_public" value="1" <?php checked($blog_public); ?> /> <?php _e('Allow my blog to appear in search engines like Google and Technorati.'); ?></label></td>
|
||||
<td colspan="2"><label><input type="checkbox" name="blog_public" value="1"<?php if( isset($_POST) && ! empty($_POST) && isset( $_POST['blog_public'] ) ) : ?> checked="checked"<?php endif; ?> /> <?php _e('Allow my blog to appear in search engines like Google and Technorati.'); ?></label></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="step"><input type="submit" name="Submit" value="<?php esc_attr_e('Install WordPress'); ?>" class="button" /></p>
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
jQuery(document).ready(function($) {
|
||||
var options = false, addAfter, delBefore, delAfter;
|
||||
var options = false, addAfter, addAfter2, delBefore, delAfter;
|
||||
if ( document.forms['addcat'].category_parent )
|
||||
options = document.forms['addcat'].category_parent.options;
|
||||
|
||||
addAfter = function( r, settings ) {
|
||||
var name, id;
|
||||
|
||||
name = $("<span>" + $('name', r).text() + "</span>").text();
|
||||
name = $("<span>" + $('name', r).text() + "</span>").html();
|
||||
id = $('cat', r).attr('id');
|
||||
options[options.length] = new Option(name, id);
|
||||
|
||||
addAfter2( r, settings );
|
||||
}
|
||||
|
||||
addAfter2 = function( x, r ) {
|
||||
var t = $(r.parsed.responses[0].data);
|
||||
if ( t.length == 1 )
|
||||
inlineEditTax.addEvents($(t.id));
|
||||
}
|
||||
|
||||
delAfter = function( r, settings ) {
|
||||
@@ -28,7 +36,7 @@ jQuery(document).ready(function($) {
|
||||
if ( options )
|
||||
$('#the-list').wpList( { addAfter: addAfter, delBefore: delBefore, delAfter: delAfter } );
|
||||
else
|
||||
$('#the-list').wpList({ delBefore: delBefore });
|
||||
$('#the-list').wpList({ addAfter: addAfter2, delBefore: delBefore });
|
||||
|
||||
$('.delete a[class^="delete"]').live('click', function(){return false;});
|
||||
$('.delete a[class^="delete"]').click(function(){return false;});
|
||||
});
|
||||
|
||||
@@ -1 +1 @@
|
||||
jQuery(document).ready(function(d){var b=false,e,c,a;if(document.forms.addcat.category_parent){b=document.forms.addcat.category_parent.options}e=function(h,g){var f,i;f=d("<span>"+d("name",h).text()+"</span>").text();i=d("cat",h).attr("id");b[b.length]=new Option(f,i)};a=function(g,f){var i=d("cat",g).attr("id"),h;for(h=0;h<b.length;h++){if(i==b[h].value){b[h]=null}}};c=function(f){if("undefined"!=showNotice){return showNotice.warn()?f:false}return f};if(b){d("#the-list").wpList({addAfter:e,delBefore:c,delAfter:a})}else{d("#the-list").wpList({delBefore:c})}d('.delete a[class^="delete"]').live("click",function(){return false})});
|
||||
jQuery(document).ready(function(d){var b=false,f,e,c,a;if(document.forms.addcat.category_parent){b=document.forms.addcat.category_parent.options}f=function(i,h){var g,j;g=d("<span>"+d("name",i).text()+"</span>").html();j=d("cat",i).attr("id");b[b.length]=new Option(g,j);e(i,h)};e=function(g,i){var h=d(i.parsed.responses[0].data);if(h.length==1){inlineEditTax.addEvents(d(h.id))}};a=function(h,g){var j=d("cat",h).attr("id"),i;for(i=0;i<b.length;i++){if(j==b[i].value){b[i]=null}}};c=function(g){if("undefined"!=showNotice){return showNotice.warn()?g:false}return g};if(b){d("#the-list").wpList({addAfter:f,delBefore:c,delAfter:a})}else{d("#the-list").wpList({addAfter:e,delBefore:c})}d('.delete a[class^="delete"]').click(function(){return false})});
|
||||
@@ -22,25 +22,15 @@ jQuery(document).ready( function($) {
|
||||
});
|
||||
|
||||
$('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels
|
||||
var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(),
|
||||
newD = new Date( aa, mm - 1, jj, hh, mn );
|
||||
|
||||
if ( newD.getFullYear() != aa || (1 + newD.getMonth()) != mm || newD.getDate() != jj || newD.getMinutes() != mn ) {
|
||||
$('.timestamp-wrap', '#timestampdiv').addClass('form-invalid');
|
||||
return false;
|
||||
} else {
|
||||
$('.timestamp-wrap', '#timestampdiv').removeClass('form-invalid');
|
||||
}
|
||||
|
||||
$('#timestampdiv').slideUp("normal");
|
||||
$('.edit-timestamp').show();
|
||||
$('#timestamp').html(
|
||||
commentL10n.submittedOn + ' <b>' +
|
||||
$( '#mm option[value=' + mm + ']' ).text() + ' ' +
|
||||
jj + ', ' +
|
||||
aa + ' @ ' +
|
||||
hh + ':' +
|
||||
mn + '</b> '
|
||||
$( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' +
|
||||
$('#jj').val() + ', ' +
|
||||
$('#aa').val() + ' @ ' +
|
||||
$('#hh').val() + ':' +
|
||||
$('#mn').val() + '</b> '
|
||||
);
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -1 +1 @@
|
||||
jQuery(document).ready(function(b){var a=b("#timestamp").html();b(".edit-timestamp").click(function(){if(b("#timestampdiv").is(":hidden")){b("#timestampdiv").slideDown("normal");b(".edit-timestamp").hide()}return false});b(".cancel-timestamp").click(function(){b("#timestampdiv").slideUp("normal");b("#mm").val(b("#hidden_mm").val());b("#jj").val(b("#hidden_jj").val());b("#aa").val(b("#hidden_aa").val());b("#hh").val(b("#hidden_hh").val());b("#mn").val(b("#hidden_mn").val());b("#timestamp").html(a);b(".edit-timestamp").show();return false});b(".save-timestamp").click(function(){var g=b("#aa").val(),h=b("#mm").val(),d=b("#jj").val(),c=b("#hh").val(),f=b("#mn").val(),e=new Date(g,h-1,d,c,f);if(e.getFullYear()!=g||(1+e.getMonth())!=h||e.getDate()!=d||e.getMinutes()!=f){b(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{b(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}b("#timestampdiv").slideUp("normal");b(".edit-timestamp").show();b("#timestamp").html(commentL10n.submittedOn+" <b>"+b("#mm option[value="+h+"]").text()+" "+d+", "+g+" @ "+c+":"+f+"</b> ");return false})});
|
||||
jQuery(document).ready(function(b){var a=b("#timestamp").html();b(".edit-timestamp").click(function(){if(b("#timestampdiv").is(":hidden")){b("#timestampdiv").slideDown("normal");b(".edit-timestamp").hide()}return false});b(".cancel-timestamp").click(function(){b("#timestampdiv").slideUp("normal");b("#mm").val(b("#hidden_mm").val());b("#jj").val(b("#hidden_jj").val());b("#aa").val(b("#hidden_aa").val());b("#hh").val(b("#hidden_hh").val());b("#mn").val(b("#hidden_mn").val());b("#timestamp").html(a);b(".edit-timestamp").show();return false});b(".save-timestamp").click(function(){b("#timestampdiv").slideUp("normal");b(".edit-timestamp").show();b("#timestamp").html(commentL10n.submittedOn+" <b>"+b("#mm option[value="+b("#mm").val()+"]").text()+" "+b("#jj").val()+", "+b("#aa").val()+" @ "+b("#hh").val()+":"+b("#mn").val()+"</b> ");return false})});
|
||||
@@ -1,21 +1,19 @@
|
||||
var showNotice, adminMenu, columns, validateForm;
|
||||
var showNotice, adminMenu, columns;
|
||||
(function($){
|
||||
// sidebar admin menu
|
||||
adminMenu = {
|
||||
init : function() {
|
||||
var menu = $('#adminmenu');
|
||||
|
||||
$('.wp-menu-toggle', menu).each( function() {
|
||||
var t = $(this), sub = t.siblings('.wp-submenu');
|
||||
if ( sub.length )
|
||||
t.click(function(){ adminMenu.toggle( sub ); });
|
||||
init : function() {
|
||||
$('#adminmenu div.wp-menu-toggle').each( function() {
|
||||
if ( $(this).siblings('.wp-submenu').length )
|
||||
$(this).click(function(){ adminMenu.toggle( $(this).siblings('.wp-submenu') ); });
|
||||
else
|
||||
t.hide();
|
||||
$(this).hide();
|
||||
});
|
||||
|
||||
this.favorites();
|
||||
|
||||
$('.separator', menu).click(function(){
|
||||
$('a.separator').click(function(){
|
||||
if ( $('body').hasClass('folded') ) {
|
||||
adminMenu.fold(1);
|
||||
deleteUserSetting( 'mfold' );
|
||||
@@ -26,38 +24,30 @@ adminMenu = {
|
||||
return false;
|
||||
});
|
||||
|
||||
if ( $('body').hasClass('folded') )
|
||||
if ( $('body').hasClass('folded') ) {
|
||||
this.fold();
|
||||
|
||||
}
|
||||
this.restoreMenuState();
|
||||
},
|
||||
|
||||
restoreMenuState : function() {
|
||||
$('li.wp-has-submenu', '#adminmenu').each(function(i, e) {
|
||||
$('#adminmenu li.wp-has-submenu').each(function(i, e) {
|
||||
var v = getUserSetting( 'm'+i );
|
||||
if ( $(e).hasClass('wp-has-current-submenu') )
|
||||
return true; // leave the current parent open
|
||||
if ( $(e).hasClass('wp-has-current-submenu') ) return true; // leave the current parent open
|
||||
|
||||
if ( 'o' == v )
|
||||
$(e).addClass('wp-menu-open');
|
||||
else if ( 'c' == v )
|
||||
$(e).removeClass('wp-menu-open');
|
||||
if ( 'o' == v ) $(e).addClass('wp-menu-open');
|
||||
else if ( 'c' == v ) $(e).removeClass('wp-menu-open');
|
||||
});
|
||||
},
|
||||
|
||||
toggle : function(el) {
|
||||
var id = el.slideToggle(150, function() {
|
||||
el.css('display','');
|
||||
}).parent().toggleClass( 'wp-menu-open' ).attr('id');
|
||||
|
||||
if ( id ) {
|
||||
$('li.wp-has-submenu', '#adminmenu').each(function(i, e) {
|
||||
if ( id == e.id ) {
|
||||
var v = $(e).hasClass('wp-menu-open') ? 'o' : 'c';
|
||||
setUserSetting( 'm'+i, v );
|
||||
}
|
||||
});
|
||||
}
|
||||
el['slideToggle'](150, function(){el.css('display','');}).parent().toggleClass( 'wp-menu-open' );
|
||||
|
||||
$('#adminmenu li.wp-has-submenu').each(function(i, e) {
|
||||
var v = $(e).hasClass('wp-menu-open') ? 'o' : 'c';
|
||||
setUserSetting( 'm'+i, v );
|
||||
});
|
||||
|
||||
return false;
|
||||
},
|
||||
@@ -72,14 +62,14 @@ adminMenu = {
|
||||
over: function(e){
|
||||
var m, b, h, o, f;
|
||||
m = $(this).find('.wp-submenu');
|
||||
b = $(this).offset().top + m.height() + 1; // Bottom offset of the menu
|
||||
b = m.parent().offset().top + m.height() + 1; // Bottom offset of the menu
|
||||
h = $('#wpwrap').height(); // Height of the entire page
|
||||
o = 60 + b - h;
|
||||
f = $(window).height() + $(window).scrollTop() - 15; // The fold
|
||||
if ( f < (b - o) ) {
|
||||
f = $(window).height() + $('body').scrollTop() - 15; // The fold
|
||||
if (f < (b - o)) {
|
||||
o = b - f;
|
||||
}
|
||||
if ( o > 1 ) {
|
||||
if (o > 1) {
|
||||
m.css({'marginTop':'-'+o+'px'});
|
||||
} else if ( m.css('marginTop') ) {
|
||||
m.css({'marginTop':''});
|
||||
@@ -96,42 +86,27 @@ adminMenu = {
|
||||
},
|
||||
|
||||
favorites : function() {
|
||||
$('#favorite-inside').width( $('#favorite-actions').width() - 4 );
|
||||
$('#favorite-toggle, #favorite-inside').bind('mouseenter', function() {
|
||||
$('#favorite-inside').removeClass('slideUp').addClass('slideDown');
|
||||
setTimeout(function() {
|
||||
if ( $('#favorite-inside').hasClass('slideDown') ) {
|
||||
$('#favorite-inside').slideDown(100);
|
||||
$('#favorite-first').addClass('slide-down');
|
||||
}
|
||||
}, 200);
|
||||
}).bind('mouseleave', function() {
|
||||
$('#favorite-inside').removeClass('slideDown').addClass('slideUp');
|
||||
setTimeout(function() {
|
||||
if ( $('#favorite-inside').hasClass('slideUp') ) {
|
||||
$('#favorite-inside').slideUp(100, function() {
|
||||
$('#favorite-first').removeClass('slide-down');
|
||||
});
|
||||
}
|
||||
}, 300);
|
||||
});
|
||||
$('#favorite-inside').width($('#favorite-actions').width()-4);
|
||||
$('#favorite-toggle, #favorite-inside').bind( 'mouseenter', function(){$('#favorite-inside').removeClass('slideUp').addClass('slideDown'); setTimeout(function(){if ( $('#favorite-inside').hasClass('slideDown') ) { $('#favorite-inside').slideDown(100); $('#favorite-first').addClass('slide-down'); }}, 200) } );
|
||||
|
||||
$('#favorite-toggle, #favorite-inside').bind( 'mouseleave', function(){$('#favorite-inside').removeClass('slideDown').addClass('slideUp'); setTimeout(function(){if ( $('#favorite-inside').hasClass('slideUp') ) { $('#favorite-inside').slideUp(100, function(){ $('#favorite-first').removeClass('slide-down'); } ); }}, 300) } );
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function(){ adminMenu.init(); });
|
||||
$(document).ready(function(){adminMenu.init();});
|
||||
|
||||
// show/hide/save table columns
|
||||
columns = {
|
||||
init : function() {
|
||||
$('.hide-column-tog', '#adv-settings').click( function() {
|
||||
var column = $(this).val();
|
||||
if ( $(this).attr('checked') )
|
||||
$('.hide-column-tog').click( function() {
|
||||
var column = $(this).val(), show = $(this).attr('checked');
|
||||
if ( show ) {
|
||||
$('.column-' + column).show();
|
||||
else
|
||||
} else {
|
||||
$('.column-' + column).hide();
|
||||
|
||||
}
|
||||
columns.save_manage_columns_state();
|
||||
});
|
||||
} );
|
||||
},
|
||||
|
||||
save_manage_columns_state : function() {
|
||||
@@ -147,10 +122,6 @@ columns = {
|
||||
|
||||
$(document).ready(function(){columns.init();});
|
||||
|
||||
validateForm = function( form ) {
|
||||
return !$( form ).find('.form-required').filter( function() { return $('input:visible', this).val() == ''; } ).addClass( 'form-invalid' ).find('input:visible').change( function() { $(this).closest('.form-invalid').removeClass( 'form-invalid' ); } ).size();
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
|
||||
// stub for doing better warnings
|
||||
@@ -172,15 +143,25 @@ showNotice = {
|
||||
jQuery(document).ready( function($) {
|
||||
var lastClicked = false, checks, first, last, checked;
|
||||
|
||||
// pulse
|
||||
$('.fade').animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300).animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300);
|
||||
|
||||
// Move .updated and .error alert boxes
|
||||
$('div.wrap h2:first').nextAll('div.updated, div.error').addClass('below-h2');
|
||||
$('div.updated, div.error').not('.below-h2').insertAfter( $('div.wrap h2:first') );
|
||||
$('div.wrap h2 ~ div.updated, div.wrap h2 ~ div.error').addClass('below-h2');
|
||||
$('div.updated, div.error').not('.below-h2').insertAfter('div.wrap h2:first');
|
||||
|
||||
// show warnings
|
||||
$('#doaction, #doaction2').click(function(){
|
||||
if ( $('select[name="action"]').val() == 'delete' || $('select[name="action2"]').val() == 'delete' ) {
|
||||
return showNotice.warn();
|
||||
}
|
||||
});
|
||||
|
||||
// screen settings tab
|
||||
$('#show-settings-link').click(function () {
|
||||
if ( ! $('#screen-options-wrap').hasClass('screen-options-open') )
|
||||
if ( ! $('#screen-options-wrap').hasClass('screen-options-open') ) {
|
||||
$('#contextual-help-link-wrap').css('visibility', 'hidden');
|
||||
|
||||
}
|
||||
$('#screen-options-wrap').slideToggle('fast', function(){
|
||||
if ( $(this).hasClass('screen-options-open') ) {
|
||||
$('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right.gif")'});
|
||||
@@ -196,10 +177,10 @@ jQuery(document).ready( function($) {
|
||||
|
||||
// help tab
|
||||
$('#contextual-help-link').click(function () {
|
||||
if ( ! $('#contextual-help-wrap').hasClass('contextual-help-open') )
|
||||
if ( ! $('#contextual-help-wrap').hasClass('contextual-help-open') ) {
|
||||
$('#screen-options-link-wrap').css('visibility', 'hidden');
|
||||
|
||||
$('#contextual-help-wrap').slideToggle('fast', function() {
|
||||
}
|
||||
$('#contextual-help-wrap').slideToggle('fast', function(){
|
||||
if ( $(this).hasClass('contextual-help-open') ) {
|
||||
$('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right.gif")'});
|
||||
$('#screen-options-link-wrap').css('visibility', '');
|
||||
@@ -211,19 +192,20 @@ jQuery(document).ready( function($) {
|
||||
});
|
||||
return false;
|
||||
});
|
||||
$('#contextual-help-link-wrap, #screen-options-link-wrap').show();
|
||||
|
||||
// check all checkboxes
|
||||
$('tbody').children().children('.check-column').find(':checkbox').click( function(e) {
|
||||
$( 'table:visible tbody .check-column :checkbox' ).click( function(e) {
|
||||
if ( 'undefined' == e.shiftKey ) { return true; }
|
||||
if ( e.shiftKey ) {
|
||||
if ( !lastClicked ) { return true; }
|
||||
checks = $( lastClicked ).closest( 'form' ).find( ':checkbox' );
|
||||
checks = $( lastClicked ).parents( 'form:first' ).find( ':checkbox' );
|
||||
first = checks.index( lastClicked );
|
||||
last = checks.index( this );
|
||||
checked = $(this).attr('checked');
|
||||
if ( 0 < first && 0 < last && first != last ) {
|
||||
checks.slice( first, last ).attr( 'checked', function(){
|
||||
if ( $(this).closest('tr').is(':visible') )
|
||||
if ( $(this).parents('tr').is(':visible') )
|
||||
return checked ? 'checked' : '';
|
||||
|
||||
return '';
|
||||
@@ -232,17 +214,13 @@ jQuery(document).ready( function($) {
|
||||
}
|
||||
lastClicked = this;
|
||||
return true;
|
||||
});
|
||||
} );
|
||||
$( 'thead :checkbox, tfoot :checkbox' ).click( function(e) {
|
||||
var c = $(this).attr('checked'), kbtoggle = 'undefined' == typeof toggleWithKeyboard ? false : toggleWithKeyboard, toggle = e.shiftKey || kbtoggle;
|
||||
|
||||
$('thead, tfoot').find(':checkbox').click( function(e) {
|
||||
var c = $(this).attr('checked'),
|
||||
kbtoggle = 'undefined' == typeof toggleWithKeyboard ? false : toggleWithKeyboard,
|
||||
toggle = e.shiftKey || kbtoggle;
|
||||
|
||||
$(this).closest( 'table' ).children( 'tbody' ).filter(':visible')
|
||||
.children().children('.check-column').find(':checkbox')
|
||||
.attr('checked', function() {
|
||||
if ( $(this).closest('tr').is(':hidden') )
|
||||
$(this).parents( 'form:first' ).find( 'table tbody:visible' ).find( '.check-column :checkbox' ).attr( 'checked', function() {
|
||||
if ( $(this).parents('tr').is(':hidden') )
|
||||
return '';
|
||||
if ( toggle )
|
||||
return $(this).attr( 'checked' ) ? '' : 'checked';
|
||||
@@ -250,10 +228,7 @@ jQuery(document).ready( function($) {
|
||||
return 'checked';
|
||||
return '';
|
||||
});
|
||||
|
||||
$(this).closest('table').children('thead, tfoot').filter(':visible')
|
||||
.children().children('.check-column').find(':checkbox')
|
||||
.attr('checked', function() {
|
||||
$(this).parents( 'form:first' ).find( 'table thead:visible, table tfoot:visible').find( '.check-column :checkbox' ).attr( 'checked', function() {
|
||||
if ( toggle )
|
||||
return '';
|
||||
else if (c)
|
||||
@@ -261,16 +236,17 @@ jQuery(document).ready( function($) {
|
||||
return '';
|
||||
});
|
||||
});
|
||||
|
||||
$('#default-password-nag-no').click( function() {
|
||||
setUserSetting('default_password_nag', 'hide');
|
||||
$('div.default-password-nag').hide();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
jQuery(document).ready( function($){
|
||||
var turboNag = $('span.turbo-nag', '#user_info');
|
||||
var turboNag = $('.turbo-nag');
|
||||
|
||||
if ( !turboNag.length || ('undefined' != typeof(google) && google.gears) )
|
||||
return;
|
||||
@@ -287,4 +263,5 @@ jQuery(document).ready( function($){
|
||||
}
|
||||
|
||||
turboNag.show();
|
||||
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -4,9 +4,9 @@ var theList, theExtraList, toggleWithKeyboard = false;
|
||||
setCommentsList = function() {
|
||||
var totalInput, perPageInput, pageInput, lastConfidentTime = 0, dimAfter, delBefore, updateTotalCount, delAfter;
|
||||
|
||||
totalInput = $('.tablenav input[name="_total"]', '#comments-form');
|
||||
perPageInput = $('.tablenav input[name="_per_page"]', '#comments-form');
|
||||
pageInput = $('.tablenav input[name="_page"]', '#comments-form');
|
||||
totalInput = $('#comments-form .tablenav :input[name="_total"]');
|
||||
perPageInput = $('#comments-form .tablenav :input[name="_per_page"]');
|
||||
pageInput = $('#comments-form .tablenav :input[name="_page"]');
|
||||
|
||||
dimAfter = function( r, settings ) {
|
||||
var c = $('#' + settings.element);
|
||||
@@ -17,192 +17,109 @@ setCommentsList = function() {
|
||||
c.find('div.comment_status').html('1')
|
||||
|
||||
$('span.pending-count').each( function() {
|
||||
var a = $(this), n, dif;
|
||||
n = a.html().replace(/[^0-9]+/g, '');
|
||||
var a = $(this), n;
|
||||
n = a.html().replace(/[ ,.]+/g, '');
|
||||
n = parseInt(n,10);
|
||||
if ( isNaN(n) ) return;
|
||||
dif = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1;
|
||||
n = n + dif;
|
||||
n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
|
||||
if ( n < 0 ) { n = 0; }
|
||||
a.closest('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
|
||||
updateCount(a, n);
|
||||
dashboardTotals();
|
||||
a.parents('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
|
||||
n = n.toString();
|
||||
if ( n.length > 3 )
|
||||
n = n.substr(0, n.length-3)+' '+n.substr(-3);
|
||||
a.html(n);
|
||||
});
|
||||
};
|
||||
|
||||
// Send current total, page, per_page and url
|
||||
delBefore = function( settings, list ) {
|
||||
var cl = $(settings.target).attr('className'), id, el, n, h, a, author, action = false;
|
||||
|
||||
settings.data._total = totalInput.val() || 0;
|
||||
settings.data._per_page = perPageInput.val() || 0;
|
||||
settings.data._page = pageInput.val() || 0;
|
||||
delBefore = function( settings ) {
|
||||
settings.data._total = totalInput.val();
|
||||
settings.data._per_page = perPageInput.val();
|
||||
settings.data._page = pageInput.val();
|
||||
settings.data._url = document.location.href;
|
||||
|
||||
if ( cl.indexOf(':trash=1') != -1 )
|
||||
action = 'trash';
|
||||
else if ( cl.indexOf(':spam=1') != -1 )
|
||||
action = 'spam';
|
||||
|
||||
if ( action ) {
|
||||
id = cl.replace(/.*?comment-([0-9]+).*/, '$1');
|
||||
el = $('#comment-' + id);
|
||||
note = $('#' + action + '-undo-holder').html();
|
||||
|
||||
if ( el.siblings('#replyrow').length && commentReply.cid == id )
|
||||
commentReply.close();
|
||||
|
||||
if ( el.is('tr') ) {
|
||||
n = el.children(':visible').length;
|
||||
author = $('.author strong', el).text();
|
||||
h = $('<tr id="undo-' + id + '" class="undo un' + action + '" style="display:none;"><td colspan="' + n + '">' + note + '</td></tr>');
|
||||
} else {
|
||||
author = $('.comment-author', el).text();
|
||||
h = $('<div id="undo-' + id + '" style="display:none;" class="undo un' + action + '">' + note + '</div>');
|
||||
}
|
||||
|
||||
el.before(h);
|
||||
|
||||
$('strong', '#undo-' + id).text(author + ' ');
|
||||
a = $('.undo a', '#undo-' + id);
|
||||
a.attr('href', 'comment.php?action=un' + action + 'comment&c=' + id + '&_wpnonce=' + settings.data._ajax_nonce);
|
||||
a.attr('className', 'delete:the-comment-list:comment-' + id + '::un' + action + '=1 vim-z vim-destructive');
|
||||
$('.avatar', el).clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside');
|
||||
|
||||
a.click(function(){
|
||||
list.wpList.del(this);
|
||||
$('#undo-' + id).css( {backgroundColor:'#ceb'} ).fadeOut(350, function(){
|
||||
$(this).remove();
|
||||
$('#comment-' + id).css('backgroundColor', '').fadeIn(300, function(){ $(this).show() });
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
if ( 'undefined' != showNotice && settings.data.action && settings.data.action == 'delete-comment' && !settings.data.spam )
|
||||
return showNotice.warn() ? settings : false;
|
||||
|
||||
return settings;
|
||||
};
|
||||
|
||||
// Updates the current total (as displayed visibly)
|
||||
/* Updates the current total (as displayed visibly)
|
||||
*/
|
||||
updateTotalCount = function( total, time, setConfidentTime ) {
|
||||
if ( time < lastConfidentTime )
|
||||
if ( time < lastConfidentTime ) {
|
||||
return;
|
||||
|
||||
if ( setConfidentTime )
|
||||
lastConfidentTime = time;
|
||||
|
||||
totalInput.val( total.toString() );
|
||||
$('span.total-type-count').each( function() {
|
||||
updateCount( $(this), total );
|
||||
});
|
||||
};
|
||||
|
||||
function dashboardTotals(n) {
|
||||
var dash = $('#dashboard_right_now'), total, appr, totalN, apprN;
|
||||
|
||||
n = n || 0;
|
||||
if ( isNaN(n) || !dash.length )
|
||||
return;
|
||||
|
||||
total = $('span.total-count', dash);
|
||||
appr = $('span.approved-count', dash);
|
||||
totalN = getCount(total);
|
||||
|
||||
totalN = totalN + n;
|
||||
apprN = totalN - getCount( $('span.pending-count', dash) ) - getCount( $('span.spam-count', dash) );
|
||||
updateCount(total, totalN);
|
||||
updateCount(appr, apprN);
|
||||
|
||||
}
|
||||
|
||||
function getCount(el) {
|
||||
var n = parseInt( el.html().replace(/[^0-9]+/g, ''), 10 );
|
||||
if ( isNaN(n) )
|
||||
return 0;
|
||||
return n;
|
||||
}
|
||||
|
||||
function updateCount(el, n) {
|
||||
var n1 = '';
|
||||
if ( isNaN(n) )
|
||||
return;
|
||||
n = n < 1 ? '0' : n.toString();
|
||||
if ( n.length > 3 ) {
|
||||
while ( n.length > 3 ) {
|
||||
n1 = thousandsSeparator + n.substr(n.length - 3) + n1;
|
||||
n = n.substr(0, n.length - 3);
|
||||
}
|
||||
n = n + n1;
|
||||
}
|
||||
el.html(n);
|
||||
}
|
||||
totalInput.val( total.toString() );
|
||||
if ( setConfidentTime ) {
|
||||
lastConfidentTime = time;
|
||||
}
|
||||
$('span.total-type-count').each( function() {
|
||||
var a = $(this), n;
|
||||
n = totalInput.val().toString();
|
||||
if ( n.length > 3 )
|
||||
n = n.substr(0, n.length-3)+' '+n.substr(-3);
|
||||
a.html(n);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// In admin-ajax.php, we send back the unix time stamp instead of 1 on success
|
||||
delAfter = function( r, settings ) {
|
||||
var total, pageLinks, N, untrash = $(settings.target).parent().is('span.untrash'), unspam = $(settings.target).parent().is('span.unspam'), spam, trash;
|
||||
|
||||
function getUpdate(s) {
|
||||
if ( $(settings.target).parent().is('span.' + s) )
|
||||
return 1;
|
||||
else if ( $('#' + settings.element).is('.' + s) )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
spam = getUpdate('spam');
|
||||
trash = getUpdate('trash');
|
||||
|
||||
if ( untrash )
|
||||
trash = -1;
|
||||
if ( unspam )
|
||||
spam = -1;
|
||||
|
||||
$('span.pending-count').each( function() {
|
||||
var a = $(this), n = getCount(a), unapproved = $('#' + settings.element).is('.unapproved');
|
||||
|
||||
if ( $(settings.target).parent().is('span.unapprove') || ( ( untrash || unspam ) && unapproved ) ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove"
|
||||
n = n + 1;
|
||||
} else if ( unapproved ) { // we deleted a formerly unapproved comment
|
||||
var a = $(this), n;
|
||||
n = a.html().replace(/[ ,.]+/g, '');
|
||||
n = parseInt(n,10);
|
||||
if ( isNaN(n) ) return;
|
||||
if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment
|
||||
n = n - 1;
|
||||
} else if ( $(settings.target).parents( 'span.unapprove' ).size() ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove"
|
||||
n = n + 1;
|
||||
}
|
||||
if ( n < 0 ) { n = 0; }
|
||||
a.closest('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
|
||||
updateCount(a, n);
|
||||
dashboardTotals();
|
||||
a.parents('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
|
||||
n = n.toString();
|
||||
if ( n.length > 3 )
|
||||
n = n.substr(0, n.length-3)+' '+n.substr(-3);
|
||||
a.html(n);
|
||||
});
|
||||
|
||||
$('span.spam-count').each( function() {
|
||||
var a = $(this), n = getCount(a) + spam;
|
||||
updateCount(a, n);
|
||||
});
|
||||
|
||||
$('span.trash-count').each( function() {
|
||||
var a = $(this), n = getCount(a) + trash;
|
||||
updateCount(a, n);
|
||||
});
|
||||
|
||||
if ( $('#dashboard_right_now').length ) {
|
||||
N = trash ? -1 * trash : 0;
|
||||
dashboardTotals(N);
|
||||
} else {
|
||||
total = totalInput.val() ? parseInt( totalInput.val(), 10 ) : 0;
|
||||
total = total - spam - trash;
|
||||
if ( total < 0 )
|
||||
total = 0;
|
||||
|
||||
if ( ( 'object' == typeof r ) && lastConfidentTime < settings.parsed.responses[0].supplemental.time ) {
|
||||
pageLinks = settings.parsed.responses[0].supplemental.pageLinks || '';
|
||||
if ( $.trim( pageLinks ) )
|
||||
$('.tablenav-pages').find( '.page-numbers' ).remove().end().append( $( pageLinks ) );
|
||||
else
|
||||
$('.tablenav-pages').find( '.page-numbers' ).remove();
|
||||
|
||||
updateTotalCount( total, settings.parsed.responses[0].supplemental.time, true );
|
||||
} else {
|
||||
updateTotalCount( total, r, false );
|
||||
var a = $(this), n;
|
||||
n = a.html().replace(/[ ,.]+/g, '');
|
||||
n = parseInt(n,10);
|
||||
if ( isNaN(n) ) return;
|
||||
if ( $(settings.target).parents( 'span.spam' ).size() ) { // we marked a comment as spam
|
||||
n = n + 1;
|
||||
} else if ( $('#' + settings.element).is('.spam') ) { // we approved or deleted a comment marked as spam
|
||||
n = n - 1;
|
||||
}
|
||||
if ( n < 0 ) { n = 0; }
|
||||
n = n.toString();
|
||||
if ( n.length > 3 )
|
||||
n = n.substr(0, n.length-3)+' '+n.substr(-3);
|
||||
a.html(n);
|
||||
});
|
||||
|
||||
|
||||
// XML response
|
||||
if ( ( 'object' == typeof r ) && lastConfidentTime < settings.parsed.responses[0].supplemental.time ) {
|
||||
// Set the total to the known good value (even if this value is a little old, newer values should only be a few less, and so shouldn't mess up the page links)
|
||||
updateTotalCount( settings.parsed.responses[0].supplemental.total, settings.parsed.responses[0].supplemental.time, true );
|
||||
if ( $.trim( settings.parsed.responses[0].supplemental.pageLinks ) ) {
|
||||
$('.tablenav-pages').find( '.page-numbers' ).remove().end().append( $( settings.parsed.responses[0].supplemental.pageLinks ) );
|
||||
} else if ( 'undefined' != typeof settings.parsed.responses[0].supplemental.pageLinks ) {
|
||||
$('.tablenav-pages').find( '.page-numbers' ).remove();
|
||||
}
|
||||
} else {
|
||||
// Decrement the total
|
||||
var total = parseInt( totalInput.val(), 10 );
|
||||
if ( total-- < 0 )
|
||||
total = 0;
|
||||
updateTotalCount( total, r, false );
|
||||
}
|
||||
|
||||
if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 || untrash ) {
|
||||
if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -211,18 +128,11 @@ setCommentsList = function() {
|
||||
};
|
||||
|
||||
theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
|
||||
theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )
|
||||
.bind('wpListDelEnd', function(e, s){
|
||||
var id = s.element.replace(/[^0-9]+/g, '');
|
||||
theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } );
|
||||
|
||||
if ( s.target.className.indexOf(':trash=1') != -1 || s.target.className.indexOf(':spam=1') != -1 )
|
||||
$('#undo-' + id).fadeIn(300, function(){ $(this).show() });
|
||||
});
|
||||
};
|
||||
|
||||
commentReply = {
|
||||
cid : '',
|
||||
act : '',
|
||||
|
||||
init : function() {
|
||||
var row = $('#replyrow');
|
||||
@@ -277,38 +187,25 @@ commentReply = {
|
||||
},
|
||||
|
||||
close : function() {
|
||||
var c;
|
||||
|
||||
if ( this.cid ) {
|
||||
c = $('#comment-' + this.cid);
|
||||
|
||||
if ( this.act == 'edit-comment' )
|
||||
c.fadeIn(300, function(){ c.show() }).css('backgroundColor', '');
|
||||
|
||||
$('#replyrow').hide();
|
||||
$('#com-reply').append( $('#replyrow') );
|
||||
$('#replycontent').val('');
|
||||
$('input', '#edithead').val('');
|
||||
$('.error', '#replysubmit').html('').hide();
|
||||
$('.waiting', '#replysubmit').hide();
|
||||
|
||||
if ( $.browser.msie )
|
||||
$('#replycontainer, #replycontent').css('height', '120px');
|
||||
else
|
||||
$('#replycontainer').resizable('destroy').css('height', '120px');
|
||||
|
||||
this.cid = '';
|
||||
}
|
||||
$(this.o).fadeIn('fast').css('backgroundColor', '');
|
||||
$('#com-reply').append( $('#replyrow') );
|
||||
$('#replycontent').val('');
|
||||
$('#edithead input').val('');
|
||||
$('#replysubmit .error').html('').hide();
|
||||
$('#replysubmit .waiting').hide();
|
||||
if ( $.browser.msie )
|
||||
$('#replycontainer, #replycontent').css('height', '120px');
|
||||
else
|
||||
$('#replycontainer').resizable('destroy').css('height', '120px');
|
||||
},
|
||||
|
||||
open : function(id, p, a) {
|
||||
var t = this, editRow, rowData, act, h, c = $('#comment-' + id);
|
||||
var t = this, editRow, act, h;
|
||||
t.close();
|
||||
t.cid = id;
|
||||
t.o = '#comment-'+id;
|
||||
|
||||
$('td', '#replyrow').attr('colspan', $('table.widefat thead th:visible').length);
|
||||
editRow = $('#replyrow');
|
||||
rowData = $('#inline-'+id);
|
||||
$('#replyrow td').attr('colspan', $('.widefat thead th:visible').length);
|
||||
editRow = $('#replyrow'), rowData = $('#inline-'+id);
|
||||
act = t.act = (a == 'edit') ? 'edit-comment' : 'replyto-comment';
|
||||
|
||||
$('#action', editRow).val(act);
|
||||
@@ -324,21 +221,21 @@ commentReply = {
|
||||
$('#edithead, #savebtn', editRow).show();
|
||||
$('#replyhead, #replybtn', editRow).hide();
|
||||
|
||||
h = c.height();
|
||||
h = $(t.o).height();
|
||||
if ( h > 220 )
|
||||
if ( $.browser.msie )
|
||||
$('#replycontainer, #replycontent', editRow).height(h-105);
|
||||
else
|
||||
$('#replycontainer', editRow).height(h-105);
|
||||
|
||||
c.after( editRow ).fadeOut('fast', function(){
|
||||
$('#replyrow').fadeIn(300, function(){ $(this).show() });
|
||||
$(t.o).after(editRow.hide()).fadeOut('fast', function(){
|
||||
$('#replyrow').fadeIn('fast');
|
||||
});
|
||||
} else {
|
||||
$('#edithead, #savebtn', editRow).hide();
|
||||
$('#replyhead, #replybtn', editRow).show();
|
||||
c.after(editRow);
|
||||
$('#replyrow').fadeIn(300, function(){ $(this).show() });
|
||||
$(t.o).after(editRow);
|
||||
$('#replyrow').hide().fadeIn('fast');
|
||||
}
|
||||
|
||||
if ( ! $.browser.msie )
|
||||
@@ -366,8 +263,7 @@ commentReply = {
|
||||
window.scroll(0, rtop - 35);
|
||||
|
||||
$('#replycontent').focus().keyup(function(e){
|
||||
if ( e.which == 27 )
|
||||
commentReply.revert(); // close on Escape
|
||||
if (e.which == 27) commentReply.revert(); // close on Escape
|
||||
});
|
||||
}, 600);
|
||||
|
||||
@@ -389,7 +285,7 @@ commentReply = {
|
||||
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : ajaxurl,
|
||||
url : wpListL10n.url,
|
||||
data : post,
|
||||
success : function(x) { commentReply.show(x); },
|
||||
error : function(r) { commentReply.error(r); }
|
||||
@@ -412,15 +308,16 @@ commentReply = {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( 'edit-comment' == this.act )
|
||||
$(this.o).remove();
|
||||
|
||||
r = r.responses[0];
|
||||
c = r.data;
|
||||
id = '#comment-' + r.id;
|
||||
if ( 'edit-comment' == this.act )
|
||||
$(id).remove();
|
||||
|
||||
$(c).hide()
|
||||
$('#replyrow').after(c);
|
||||
|
||||
this.o = id = '#comment-'+r.id;
|
||||
this.revert();
|
||||
this.addEvents($(id));
|
||||
bg = $(id).hasClass('unapproved') ? '#ffffe0' : '#fff';
|
||||
@@ -467,33 +364,26 @@ $(document).ready(function(){
|
||||
window.location = l[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g, '')+'&hotkeys_highlight_'+first_last+'=1';
|
||||
}
|
||||
};
|
||||
|
||||
edit_comment = function(event, current_row) {
|
||||
window.location = $('span.edit a', current_row).attr('href');
|
||||
};
|
||||
|
||||
toggle_all = function() {
|
||||
toggleWithKeyboard = true;
|
||||
$('input:checkbox', '#cb').click().attr('checked', '');
|
||||
$('#comments-form thead #cb input:checkbox').click().attr('checked', '');
|
||||
toggleWithKeyboard = false;
|
||||
};
|
||||
|
||||
}
|
||||
make_bulk = function(value) {
|
||||
return function() {
|
||||
var scope = $('select[name="action"]');
|
||||
$('option[value='+value+']', scope).attr('selected', 'selected');
|
||||
$('#comments-form').submit();
|
||||
return function(event, _) {
|
||||
$('option[value='+value+']').attr('selected', 'selected');
|
||||
$('form#comments-form')[0].submit();
|
||||
}
|
||||
};
|
||||
|
||||
$.table_hotkeys(
|
||||
$('table.widefat'),
|
||||
['a', 'u', 's', 'd', 'r', 'q', 'z', ['e', edit_comment], ['shift+x', toggle_all],
|
||||
['shift+a', make_bulk('approve')], ['shift+s', make_bulk('markspam')],
|
||||
['shift+d', make_bulk('delete')], ['shift+t', make_bulk('trash')],
|
||||
['shift+z', make_bulk('untrash')], ['shift+u', make_bulk('unapprove')]],
|
||||
{ highlight_first: adminCommentsL10n.hotkeys_highlight_first, highlight_last: adminCommentsL10n.hotkeys_highlight_last,
|
||||
prev_page_link_cb: make_hotkeys_redirect('prev'), next_page_link_cb: make_hotkeys_redirect('next') }
|
||||
$.table_hotkeys($('table.widefat'),['a', 'u', 's', 'd', 'r', 'q', ['e', edit_comment],
|
||||
['shift+a', make_bulk('approve')], ['shift+s', make_bulk('markspam')],
|
||||
['shift+d', make_bulk('delete')], ['shift+x', toggle_all],
|
||||
['shift+u', make_bulk('unapprove')]],
|
||||
{highlight_first: adminCommentsL10n.hotkeys_highlight_first, highlight_last: adminCommentsL10n.hotkeys_highlight_last,
|
||||
prev_page_link_cb: make_hotkeys_redirect('prev'), next_page_link_cb: make_hotkeys_redirect('next')}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -6,11 +6,8 @@ jQuery(document).ready(function($){
|
||||
if ( h )
|
||||
$('#content').css('height', h.ch - 15 + 'px');
|
||||
} else {
|
||||
if ( typeof tinyMCE != 'object' ) {
|
||||
$('#content').css('color', '#000');
|
||||
} else {
|
||||
$('#quicktags').hide();
|
||||
}
|
||||
$('#content').css('color', 'white');
|
||||
$('#quicktags').hide();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -22,7 +19,20 @@ var switchEditors = {
|
||||
return document.getElementById(e);
|
||||
},
|
||||
|
||||
_wp_Nop : function(content) {
|
||||
edInit : function() {
|
||||
},
|
||||
|
||||
saveCallback : function(el, content, body) {
|
||||
|
||||
if ( tinyMCE.activeEditor.isHidden() )
|
||||
content = this.I(el).value;
|
||||
else
|
||||
content = this.pre_wpautop(content);
|
||||
|
||||
return content;
|
||||
},
|
||||
|
||||
pre_wpautop : function(content) {
|
||||
var blocklist1, blocklist2;
|
||||
|
||||
// Protect pre|script tags
|
||||
@@ -32,32 +42,32 @@ var switchEditors = {
|
||||
});
|
||||
|
||||
// Pretty it up for the source editor
|
||||
blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset';
|
||||
content = content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*', 'g'), '</$1>\n');
|
||||
content = content.replace(new RegExp('\\s*<(('+blocklist1+')[^>]*)>', 'g'), '\n<$1>');
|
||||
blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6]|p';
|
||||
content = content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*', 'mg'), '</$1>\n');
|
||||
content = content.replace(new RegExp('\\s*<(('+blocklist1+')[^>]*)>', 'mg'), '\n<$1>');
|
||||
|
||||
// Mark </p> if it has any attributes.
|
||||
content = content.replace(/(<p [^>]+>.*?)<\/p>/g, '$1</p#>');
|
||||
content = content.replace(new RegExp('(<p [^>]+>.*?)</p>', 'mg'), '$1</p#>');
|
||||
|
||||
// Sepatate <div> containing <p>
|
||||
content = content.replace(/<div([^>]*)>\s*<p>/gi, '<div$1>\n\n');
|
||||
content = content.replace(new RegExp('<div([^>]*)>\\s*<p>', 'mgi'), '<div$1>\n\n');
|
||||
|
||||
// Remove <p> and <br />
|
||||
content = content.replace(/\s*<p>/gi, '');
|
||||
content = content.replace(/\s*<\/p>\s*/gi, '\n\n');
|
||||
content = content.replace(/\n[\s\u00a0]+\n/g, '\n\n');
|
||||
content = content.replace(/\s*<br ?\/?>\s*/gi, '\n');
|
||||
content = content.replace(new RegExp('\\s*<p>', 'mgi'), '');
|
||||
content = content.replace(new RegExp('\\s*</p>\\s*', 'mgi'), '\n\n');
|
||||
content = content.replace(new RegExp('\\n\\s*\\n', 'mgi'), '\n\n');
|
||||
content = content.replace(new RegExp('\\s*<br ?/?>\\s*', 'gi'), '\n');
|
||||
|
||||
// Fix some block element newline issues
|
||||
content = content.replace(/\s*<div/g, '\n<div');
|
||||
content = content.replace(/<\/div>\s*/g, '</div>\n');
|
||||
content = content.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n');
|
||||
content = content.replace(/caption\]\n\n+\[caption/g, 'caption]\n\n[caption');
|
||||
content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div');
|
||||
content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n');
|
||||
content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
|
||||
content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
|
||||
|
||||
blocklist2 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset';
|
||||
content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'g'), '\n<$1>');
|
||||
content = content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*', 'g'), '</$1>\n');
|
||||
content = content.replace(/<li([^>]*)>/g, '\t<li$1>');
|
||||
blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre';
|
||||
content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
|
||||
content = content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*', 'mg'), '</$1>\n');
|
||||
content = content.replace(new RegExp('<li([^>]*)>', 'g'), '\t<li$1>');
|
||||
|
||||
if ( content.indexOf('<object') != -1 ) {
|
||||
content = content.replace(/<object[\s\S]+?<\/object>/g, function(a){
|
||||
@@ -66,16 +76,17 @@ var switchEditors = {
|
||||
}
|
||||
|
||||
// Unmark special paragraph closing tags
|
||||
content = content.replace(/<\/p#>/g, '</p>\n');
|
||||
content = content.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1');
|
||||
content = content.replace(new RegExp('</p#>', 'g'), '</p>\n');
|
||||
content = content.replace(new RegExp('\\s*(<p [^>]+>.*</p>)', 'mg'), '\n$1');
|
||||
|
||||
// Trim whitespace
|
||||
content = content.replace(/^\s+/, '');
|
||||
content = content.replace(/[\s\u00a0]+$/, '');
|
||||
content = content.replace(new RegExp('^\\s*', ''), '');
|
||||
content = content.replace(new RegExp('[\\s\\u00a0]*$', ''), '');
|
||||
|
||||
// put back the line breaks in pre|script
|
||||
content = content.replace(/<wp_temp>/g, '\n');
|
||||
|
||||
// Hope.
|
||||
return content;
|
||||
},
|
||||
|
||||
@@ -100,17 +111,14 @@ var switchEditors = {
|
||||
edCloseAllTags(); // :-(
|
||||
qt.style.display = 'none';
|
||||
|
||||
ta.style.color = '#FFF';
|
||||
ta.value = this.wpautop(ta.value);
|
||||
|
||||
try {
|
||||
if ( ed )
|
||||
ed.show();
|
||||
else
|
||||
tinyMCE.execCommand("mceAddControl", false, id);
|
||||
} catch(e) {}
|
||||
|
||||
ta.style.color = '#000';
|
||||
if ( ed ) {
|
||||
ed.show();
|
||||
} else {
|
||||
try{tinyMCE.execCommand("mceAddControl", false, id);}
|
||||
catch(e){}
|
||||
}
|
||||
} else {
|
||||
setUserSetting( 'editor', 'html' );
|
||||
ta.style.color = '#000';
|
||||
@@ -128,8 +136,8 @@ var switchEditors = {
|
||||
return false;
|
||||
},
|
||||
|
||||
_wp_Autop : function(pee) {
|
||||
var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend';
|
||||
wpautop : function(pee) {
|
||||
var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]';
|
||||
|
||||
if ( pee.indexOf('<object') != -1 ) {
|
||||
pee = pee.replace(/<object[\s\S]+?<\/object>/g, function(a){
|
||||
@@ -141,31 +149,24 @@ var switchEditors = {
|
||||
return a.replace(/[\r\n]+/g, ' ');
|
||||
});
|
||||
|
||||
pee = pee + '\n\n';
|
||||
pee = pee.replace(/<br \/>\s*<br \/>/gi, '\n\n');
|
||||
pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), '\n$1');
|
||||
pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), '$1\n\n');
|
||||
pee = pee.replace(/\r\n|\r/g, '\n');
|
||||
pee = pee.replace(/\n\s*\n+/g, '\n\n');
|
||||
pee = pee.replace(/([\s\S]+?)\n\n/g, '<p>$1</p>\n');
|
||||
pee = pee.replace(/<p>\s*?<\/p>/gi, '');
|
||||
pee = pee + "\n\n";
|
||||
pee = pee.replace(new RegExp('<br />\\s*<br />', 'gi'), "\n\n");
|
||||
pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), "\n$1");
|
||||
pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), "$1\n\n");
|
||||
pee = pee.replace(new RegExp("\\r\\n|\\r", 'g'), "\n");
|
||||
pee = pee.replace(new RegExp("\\n\\s*\\n+", 'g'), "\n\n");
|
||||
pee = pee.replace(new RegExp('([\\s\\S]+?)\\n\\n', 'mg'), "<p>$1</p>\n");
|
||||
pee = pee.replace(new RegExp('<p>\\s*?</p>', 'gi'), '');
|
||||
pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
|
||||
pee = pee.replace(/<p>(<li.+?)<\/p>/gi, '$1');
|
||||
pee = pee.replace(/<p>\s*<blockquote([^>]*)>/gi, '<blockquote$1><p>');
|
||||
pee = pee.replace(/<\/blockquote>\s*<\/p>/gi, '</p></blockquote>');
|
||||
pee = pee.replace(new RegExp("<p>(<li.+?)</p>", 'gi'), "$1");
|
||||
pee = pee.replace(new RegExp('<p>\\s*<blockquote([^>]*)>', 'gi'), "<blockquote$1><p>");
|
||||
pee = pee.replace(new RegExp('</blockquote>\\s*</p>', 'gi'), '</p></blockquote>');
|
||||
pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)', 'gi'), "$1");
|
||||
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
|
||||
pee = pee.replace(/\s*\n/gi, '<br />\n');
|
||||
pee = pee.replace(new RegExp('\\s*\\n', 'gi'), "<br />\n");
|
||||
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
|
||||
pee = pee.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi, '$1');
|
||||
pee = pee.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi, '[caption$1[/caption]');
|
||||
|
||||
pee = pee.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g, function(a, b, c) {
|
||||
if ( c.match(/<p( [^>]+)?>/) )
|
||||
return a;
|
||||
|
||||
return b + '<p>' + c + '</p>';
|
||||
});
|
||||
pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
|
||||
pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[caption$1[/caption]');
|
||||
|
||||
// Fix the pre|script tags
|
||||
pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
|
||||
@@ -174,23 +175,5 @@ var switchEditors = {
|
||||
});
|
||||
|
||||
return pee;
|
||||
},
|
||||
|
||||
pre_wpautop : function(content) {
|
||||
var t = this, o = { o: t, data: content, unfiltered: content };
|
||||
|
||||
jQuery('body').trigger('beforePreWpautop', [o]);
|
||||
o.data = t._wp_Nop(o.data);
|
||||
jQuery('body').trigger('afterPreWpautop', [o]);
|
||||
return o.data;
|
||||
},
|
||||
|
||||
wpautop : function(pee) {
|
||||
var t = this, o = { o: t, data: pee, unfiltered: pee };
|
||||
|
||||
jQuery('body').trigger('beforeWpautop', [o]);
|
||||
o.data = t._wp_Autop(o.data);
|
||||
jQuery('body').trigger('afterWpautop', [o]);
|
||||
return o.data;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1 +1 @@
|
||||
jQuery(document).ready(function(b){var a=wpCookies.getHash("TinyMCE_content_size");if(getUserSetting("editor")=="html"){if(a){b("#content").css("height",a.ch-15+"px")}}else{if(typeof tinyMCE!="object"){b("#content").css("color","#000")}else{b("#quicktags").hide()}}});var switchEditors={mode:"",I:function(a){return document.getElementById(a)},_wp_Nop:function(b){var c,a;b=b.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(d){d=d.replace(/<br ?\/?>[\r\n]*/g,"<wp_temp>");return d.replace(/<\/?p( [^>]*)?>[\r\n]*/g,"<wp_temp>")});c="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset";b=b.replace(new RegExp("\\s*</("+c+")>\\s*","g"),"</$1>\n");b=b.replace(new RegExp("\\s*<(("+c+")[^>]*)>","g"),"\n<$1>");b=b.replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>");b=b.replace(/<div([^>]*)>\s*<p>/gi,"<div$1>\n\n");b=b.replace(/\s*<p>/gi,"");b=b.replace(/\s*<\/p>\s*/gi,"\n\n");b=b.replace(/\n[\s\u00a0]+\n/g,"\n\n");b=b.replace(/\s*<br ?\/?>\s*/gi,"\n");b=b.replace(/\s*<div/g,"\n<div");b=b.replace(/<\/div>\s*/g,"</div>\n");b=b.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n");b=b.replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption");a="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset";b=b.replace(new RegExp("\\s*<(("+a+") ?[^>]*)\\s*>","g"),"\n<$1>");b=b.replace(new RegExp("\\s*</("+a+")>\\s*","g"),"</$1>\n");b=b.replace(/<li([^>]*)>/g,"\t<li$1>");if(b.indexOf("<object")!=-1){b=b.replace(/<object[\s\S]+?<\/object>/g,function(d){return d.replace(/[\r\n]+/g,"")})}b=b.replace(/<\/p#>/g,"</p>\n");b=b.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1");b=b.replace(/^\s+/,"");b=b.replace(/[\s\u00a0]+$/,"");b=b.replace(/<wp_temp>/g,"\n");return b},go:function(i,g){i=i||"content";g=g||this.mode||"";var b,h=this.I("quicktags"),c=this.I("edButtonHTML"),d=this.I("edButtonPreview"),a=this.I(i);try{b=tinyMCE.get(i)}catch(f){b=false}if("tinymce"==g){if(b&&!b.isHidden()){return false}setUserSetting("editor","tinymce");this.mode="html";d.className="active";c.className="";edCloseAllTags();h.style.display="none";a.style.color="#FFF";a.value=this.wpautop(a.value);try{if(b){b.show()}else{tinyMCE.execCommand("mceAddControl",false,i)}}catch(f){}a.style.color="#000"}else{setUserSetting("editor","html");a.style.color="#000";this.mode="tinymce";c.className="active";d.className="";if(b&&!b.isHidden()){a.style.height=b.getContentAreaContainer().offsetHeight+24+"px";b.hide()}h.style.display="block"}return false},_wp_Autop:function(a){var b="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend";if(a.indexOf("<object")!=-1){a=a.replace(/<object[\s\S]+?<\/object>/g,function(c){return c.replace(/[\r\n]+/g,"")})}a=a.replace(/<[^<>]+>/g,function(c){return c.replace(/[\r\n]+/g," ")});a=a+"\n\n";a=a.replace(/<br \/>\s*<br \/>/gi,"\n\n");a=a.replace(new RegExp("(<(?:"+b+")[^>]*>)","gi"),"\n$1");a=a.replace(new RegExp("(</(?:"+b+")>)","gi"),"$1\n\n");a=a.replace(/\r\n|\r/g,"\n");a=a.replace(/\n\s*\n+/g,"\n\n");a=a.replace(/([\s\S]+?)\n\n/g,"<p>$1</p>\n");a=a.replace(/<p>\s*?<\/p>/gi,"");a=a.replace(new RegExp("<p>\\s*(</?(?:"+b+")[^>]*>)\\s*</p>","gi"),"$1");a=a.replace(/<p>(<li.+?)<\/p>/gi,"$1");a=a.replace(/<p>\s*<blockquote([^>]*)>/gi,"<blockquote$1><p>");a=a.replace(/<\/blockquote>\s*<\/p>/gi,"</p></blockquote>");a=a.replace(new RegExp("<p>\\s*(</?(?:"+b+")[^>]*>)","gi"),"$1");a=a.replace(new RegExp("(</?(?:"+b+")[^>]*>)\\s*</p>","gi"),"$1");a=a.replace(/\s*\n/gi,"<br />\n");a=a.replace(new RegExp("(</?(?:"+b+")[^>]*>)\\s*<br />","gi"),"$1");a=a.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1");a=a.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi,"[caption$1[/caption]");a=a.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(e,d,f){if(f.match(/<p( [^>]+)?>/)){return e}return d+"<p>"+f+"</p>"});a=a.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(c){c=c.replace(/<br ?\/?>[\r\n]*/g,"\n");return c.replace(/<\/?p( [^>]*)?>[\r\n]*/g,"\n")});return a},pre_wpautop:function(b){var a=this,c={o:a,data:b,unfiltered:b};jQuery("body").trigger("beforePreWpautop",[c]);c.data=a._wp_Nop(c.data);jQuery("body").trigger("afterPreWpautop",[c]);return c.data},wpautop:function(b){var a=this,c={o:a,data:b,unfiltered:b};jQuery("body").trigger("beforeWpautop",[c]);c.data=a._wp_Autop(c.data);jQuery("body").trigger("afterWpautop",[c]);return c.data}};
|
||||
jQuery(document).ready(function(b){var a=wpCookies.getHash("TinyMCE_content_size");if(getUserSetting("editor")=="html"){if(a){b("#content").css("height",a.ch-15+"px")}}else{b("#content").css("color","white");b("#quicktags").hide()}});var switchEditors={mode:"",I:function(a){return document.getElementById(a)},edInit:function(){},saveCallback:function(b,c,a){if(tinyMCE.activeEditor.isHidden()){c=this.I(b).value}else{c=this.pre_wpautop(c)}return c},pre_wpautop:function(b){var c,a;b=b.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(d){d=d.replace(/<br ?\/?>[\r\n]*/g,"<wp_temp>");return d.replace(/<\/?p( [^>]*)?>[\r\n]*/g,"<wp_temp>")});c="blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6]|p";b=b.replace(new RegExp("\\s*</("+c+")>\\s*","mg"),"</$1>\n");b=b.replace(new RegExp("\\s*<(("+c+")[^>]*)>","mg"),"\n<$1>");b=b.replace(new RegExp("(<p [^>]+>.*?)</p>","mg"),"$1</p#>");b=b.replace(new RegExp("<div([^>]*)>\\s*<p>","mgi"),"<div$1>\n\n");b=b.replace(new RegExp("\\s*<p>","mgi"),"");b=b.replace(new RegExp("\\s*</p>\\s*","mgi"),"\n\n");b=b.replace(new RegExp("\\n\\s*\\n","mgi"),"\n\n");b=b.replace(new RegExp("\\s*<br ?/?>\\s*","gi"),"\n");b=b.replace(new RegExp("\\s*<div","mg"),"\n<div");b=b.replace(new RegExp("</div>\\s*","mg"),"</div>\n");b=b.replace(new RegExp("\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*","gi"),"\n\n[caption$1[/caption]\n\n");b=b.replace(new RegExp("caption\\]\\n\\n+\\[caption","g"),"caption]\n\n[caption");a="blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre";b=b.replace(new RegExp("\\s*<(("+a+") ?[^>]*)\\s*>","mg"),"\n<$1>");b=b.replace(new RegExp("\\s*</("+a+")>\\s*","mg"),"</$1>\n");b=b.replace(new RegExp("<li([^>]*)>","g"),"\t<li$1>");if(b.indexOf("<object")!=-1){b=b.replace(/<object[\s\S]+?<\/object>/g,function(d){return d.replace(/[\r\n]+/g,"")})}b=b.replace(new RegExp("</p#>","g"),"</p>\n");b=b.replace(new RegExp("\\s*(<p [^>]+>.*</p>)","mg"),"\n$1");b=b.replace(new RegExp("^\\s*",""),"");b=b.replace(new RegExp("[\\s\\u00a0]*$",""),"");b=b.replace(/<wp_temp>/g,"\n");return b},go:function(i,g){i=i||"content";g=g||this.mode||"";var b,h=this.I("quicktags"),c=this.I("edButtonHTML"),d=this.I("edButtonPreview"),a=this.I(i);try{b=tinyMCE.get(i)}catch(f){b=false}if("tinymce"==g){if(b&&!b.isHidden()){return false}setUserSetting("editor","tinymce");this.mode="html";d.className="active";c.className="";edCloseAllTags();h.style.display="none";a.value=this.wpautop(a.value);if(b){b.show()}else{try{tinyMCE.execCommand("mceAddControl",false,i)}catch(f){}}}else{setUserSetting("editor","html");a.style.color="#000";this.mode="tinymce";c.className="active";d.className="";if(b&&!b.isHidden()){a.style.height=b.getContentAreaContainer().offsetHeight+24+"px";b.hide()}h.style.display="block"}return false},wpautop:function(a){var b="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]";if(a.indexOf("<object")!=-1){a=a.replace(/<object[\s\S]+?<\/object>/g,function(c){return c.replace(/[\r\n]+/g,"")})}a=a.replace(/<[^<>]+>/g,function(c){return c.replace(/[\r\n]+/g," ")});a=a+"\n\n";a=a.replace(new RegExp("<br />\\s*<br />","gi"),"\n\n");a=a.replace(new RegExp("(<(?:"+b+")[^>]*>)","gi"),"\n$1");a=a.replace(new RegExp("(</(?:"+b+")>)","gi"),"$1\n\n");a=a.replace(new RegExp("\\r\\n|\\r","g"),"\n");a=a.replace(new RegExp("\\n\\s*\\n+","g"),"\n\n");a=a.replace(new RegExp("([\\s\\S]+?)\\n\\n","mg"),"<p>$1</p>\n");a=a.replace(new RegExp("<p>\\s*?</p>","gi"),"");a=a.replace(new RegExp("<p>\\s*(</?(?:"+b+")[^>]*>)\\s*</p>","gi"),"$1");a=a.replace(new RegExp("<p>(<li.+?)</p>","gi"),"$1");a=a.replace(new RegExp("<p>\\s*<blockquote([^>]*)>","gi"),"<blockquote$1><p>");a=a.replace(new RegExp("</blockquote>\\s*</p>","gi"),"</p></blockquote>");a=a.replace(new RegExp("<p>\\s*(</?(?:"+b+")[^>]*>)","gi"),"$1");a=a.replace(new RegExp("(</?(?:"+b+")[^>]*>)\\s*</p>","gi"),"$1");a=a.replace(new RegExp("\\s*\\n","gi"),"<br />\n");a=a.replace(new RegExp("(</?(?:"+b+")[^>]*>)\\s*<br />","gi"),"$1");a=a.replace(new RegExp("<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)","gi"),"$1");a=a.replace(new RegExp("(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*","gi"),"[caption$1[/caption]");a=a.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(c){c=c.replace(/<br ?\/?>[\r\n]*/g,"\n");return c.replace(/<\/?p( [^>]*)?>[\r\n]*/g,"\n")});return a}};
|
||||
@@ -3,11 +3,10 @@ jQuery(document).ready(function($) {
|
||||
|
||||
gallerySortableInit = function() {
|
||||
gallerySortable = $('#media-items').sortable( {
|
||||
items: 'div.media-item',
|
||||
items: '.media-item',
|
||||
placeholder: 'sorthelper',
|
||||
axis: 'y',
|
||||
distance: 2,
|
||||
handle: 'div.filename',
|
||||
stop: function(e, ui) {
|
||||
// When an update has occurred, adjust the order for each item
|
||||
var all = $('#media-items').sortable('toArray'), len = all.length;
|
||||
|
||||
@@ -1 +1 @@
|
||||
jQuery(document).ready(function(c){var b,e,a,d=false;e=function(){b=c("#media-items").sortable({items:"div.media-item",placeholder:"sorthelper",axis:"y",distance:2,handle:"div.filename",stop:function(i,h){var g=c("#media-items").sortable("toArray"),f=g.length;c.each(g,function(k,l){var j=d?(f-k):(1+k);c("#"+l+" .menu_order input").val(j)})}})};sortIt=function(){var g=c(".menu_order_input"),f=g.length;g.each(function(j){var h=d?(f-j):(1+j);c(this).val(h)})};clearAll=function(f){f=f||0;c(".menu_order_input").each(function(){if(this.value=="0"||f){this.value=""}})};c("#asc").click(function(){d=false;sortIt();return false});c("#desc").click(function(){d=true;sortIt();return false});c("#clear").click(function(){clearAll(1);return false});c("#showall").click(function(){c("#sort-buttons span a").toggle();c("a.describe-toggle-on").hide();c("a.describe-toggle-off, table.slidetoggle").show();return false});c("#hideall").click(function(){c("#sort-buttons span a").toggle();c("a.describe-toggle-on").show();c("a.describe-toggle-off, table.slidetoggle").hide();return false});e();clearAll();if(c("#media-items>*").length>1){a=wpgallery.getWin();c("#save-all, #gallery-settings").show();if(typeof a.tinyMCE!="undefined"&&a.tinyMCE.activeEditor&&!a.tinyMCE.activeEditor.isHidden()){wpgallery.mcemode=true;wpgallery.init()}else{c("#insert-gallery").show()}}});jQuery(window).unload(function(){tinymce=tinyMCE=wpgallery=null});var tinymce=null,tinyMCE,wpgallery;wpgallery={mcemode:false,editor:{},dom:{},is_update:false,el:{},I:function(a){return document.getElementById(a)},init:function(){var d=this,a,f,c,e,b=d.getWin();if(!d.mcemode){return}a=(""+document.location.search).replace(/^\?/,"").split("&");f={};for(c=0;c<a.length;c++){e=a[c].split("=");f[unescape(e[0])]=unescape(e[1])}if(f.mce_rdomain){document.domain=f.mce_rdomain}tinymce=b.tinymce;tinyMCE=b.tinyMCE;d.editor=tinymce.EditorManager.activeEditor;d.setup()},getWin:function(){return window.dialogArguments||opener||parent||top},restoreSelection:function(){var a=this;if(tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},setup:function(){var f=this,c,d=f.editor,i,e,h,b,j;if(!f.mcemode){return}f.restoreSelection();f.el=d.selection.getNode();if(f.el.nodeName!="IMG"||!d.dom.hasClass(f.el,"wpGallery")){if((i=d.dom.select("img.wpGallery"))&&i[0]){f.el=i[0]}else{if(getUserSetting("galfile")=="1"){f.I("linkto-file").checked="checked"}if(getUserSetting("galdesc")=="1"){f.I("order-desc").checked="checked"}if(getUserSetting("galcols")){f.I("columns").value=getUserSetting("galcols")}if(getUserSetting("galord")){f.I("orderby").value=getUserSetting("galord")}jQuery("#insert-gallery").show();return}}c=d.dom.getAttrib(f.el,"title");c=d.dom.decode(c);if(c){jQuery("#update-gallery").show();f.is_update=true;e=c.match(/columns=['"]([0-9]+)['"]/);h=c.match(/link=['"]([^'"]+)['"]/i);b=c.match(/order=['"]([^'"]+)['"]/i);j=c.match(/orderby=['"]([^'"]+)['"]/i);if(h&&h[1]){f.I("linkto-file").checked="checked"}if(b&&b[1]){f.I("order-desc").checked="checked"}if(e&&e[1]){f.I("columns").value=""+e[1]}if(j&&j[1]){f.I("orderby").value=j[1]}}else{jQuery("#insert-gallery").show()}},update:function(){var b=this,a=b.editor,d="",c;if(!b.mcemode||!b.is_update){c="[gallery"+b.getSettings()+"]";b.getWin().send_to_editor(c);return}if(b.el.nodeName!="IMG"){return}d=a.dom.decode(a.dom.getAttrib(b.el,"title"));d=d.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi,"");d+=b.getSettings();a.dom.setAttrib(b.el,"title",d);b.getWin().tb_remove()},getSettings:function(){var a=this.I,b="";if(a("linkto-file").checked){b+=' link="file"';setUserSetting("galfile","1")}if(a("order-desc").checked){b+=' order="DESC"';setUserSetting("galdesc","1")}if(a("columns").value!=3){b+=' columns="'+a("columns").value+'"';setUserSetting("galcols",a("columns").value)}if(a("orderby").value!="menu_order"){b+=' orderby="'+a("orderby").value+'"';setUserSetting("galord",a("orderby").value)}return b}};
|
||||
jQuery(document).ready(function(c){var b,e,a,d=false;e=function(){b=c("#media-items").sortable({items:".media-item",placeholder:"sorthelper",axis:"y",distance:2,stop:function(i,h){var g=c("#media-items").sortable("toArray"),f=g.length;c.each(g,function(k,l){var j=d?(f-k):(1+k);c("#"+l+" .menu_order input").val(j)})}})};sortIt=function(){var g=c(".menu_order_input"),f=g.length;g.each(function(j){var h=d?(f-j):(1+j);c(this).val(h)})};clearAll=function(f){f=f||0;c(".menu_order_input").each(function(){if(this.value=="0"||f){this.value=""}})};c("#asc").click(function(){d=false;sortIt();return false});c("#desc").click(function(){d=true;sortIt();return false});c("#clear").click(function(){clearAll(1);return false});c("#showall").click(function(){c("#sort-buttons span a").toggle();c("a.describe-toggle-on").hide();c("a.describe-toggle-off, table.slidetoggle").show();return false});c("#hideall").click(function(){c("#sort-buttons span a").toggle();c("a.describe-toggle-on").show();c("a.describe-toggle-off, table.slidetoggle").hide();return false});e();clearAll();if(c("#media-items>*").length>1){a=wpgallery.getWin();c("#save-all, #gallery-settings").show();if(typeof a.tinyMCE!="undefined"&&a.tinyMCE.activeEditor&&!a.tinyMCE.activeEditor.isHidden()){wpgallery.mcemode=true;wpgallery.init()}else{c("#insert-gallery").show()}}});jQuery(window).unload(function(){tinymce=tinyMCE=wpgallery=null});var tinymce=null,tinyMCE,wpgallery;wpgallery={mcemode:false,editor:{},dom:{},is_update:false,el:{},I:function(a){return document.getElementById(a)},init:function(){var d=this,a,f,c,e,b=d.getWin();if(!d.mcemode){return}a=(""+document.location.search).replace(/^\?/,"").split("&");f={};for(c=0;c<a.length;c++){e=a[c].split("=");f[unescape(e[0])]=unescape(e[1])}if(f.mce_rdomain){document.domain=f.mce_rdomain}tinymce=b.tinymce;tinyMCE=b.tinyMCE;d.editor=tinymce.EditorManager.activeEditor;d.setup()},getWin:function(){return window.dialogArguments||opener||parent||top},restoreSelection:function(){var a=this;if(tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},setup:function(){var f=this,c,d=f.editor,i,e,h,b,j;if(!f.mcemode){return}f.restoreSelection();f.el=d.selection.getNode();if(f.el.nodeName!="IMG"||!d.dom.hasClass(f.el,"wpGallery")){if((i=d.dom.select("img.wpGallery"))&&i[0]){f.el=i[0]}else{if(getUserSetting("galfile")=="1"){f.I("linkto-file").checked="checked"}if(getUserSetting("galdesc")=="1"){f.I("order-desc").checked="checked"}if(getUserSetting("galcols")){f.I("columns").value=getUserSetting("galcols")}if(getUserSetting("galord")){f.I("orderby").value=getUserSetting("galord")}jQuery("#insert-gallery").show();return}}c=d.dom.getAttrib(f.el,"title");c=d.dom.decode(c);if(c){jQuery("#update-gallery").show();f.is_update=true;e=c.match(/columns=['"]([0-9]+)['"]/);h=c.match(/link=['"]([^'"]+)['"]/i);b=c.match(/order=['"]([^'"]+)['"]/i);j=c.match(/orderby=['"]([^'"]+)['"]/i);if(h&&h[1]){f.I("linkto-file").checked="checked"}if(b&&b[1]){f.I("order-desc").checked="checked"}if(e&&e[1]){f.I("columns").value=""+e[1]}if(j&&j[1]){f.I("orderby").value=j[1]}}else{jQuery("#insert-gallery").show()}},update:function(){var b=this,a=b.editor,d="",c;if(!b.mcemode||!b.is_update){c="[gallery"+b.getSettings()+"]";b.getWin().send_to_editor(c);return}if(b.el.nodeName!="IMG"){return}d=a.dom.decode(a.dom.getAttrib(b.el,"title"));d=d.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi,"");d+=b.getSettings();a.dom.setAttrib(b.el,"title",d);b.getWin().tb_remove()},getSettings:function(){var a=this.I,b="";if(a("linkto-file").checked){b+=' link="file"';setUserSetting("galfile","1")}if(a("order-desc").checked){b+=' order="DESC"';setUserSetting("galdesc","1")}if(a("columns").value!=3){b+=' columns="'+a("columns").value+'"';setUserSetting("galcols",a("columns").value)}if(a("orderby").value!="menu_order"){b+=' orderby="'+a("orderby").value+'"';setUserSetting("galord",a("orderby").value)}return b}};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user