Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c9a152a59 |
@@ -2,7 +2,7 @@
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
@@ -279,10 +279,3 @@ POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
WRITTEN OFFER
|
||||
|
||||
The source code for any program binaries or compressed scripts that are
|
||||
included with WordPress can be freely obtained at the following URL:
|
||||
|
||||
http://wordpress.org/download/source/
|
||||
|
||||
18
readme.html
@@ -8,7 +8,7 @@
|
||||
<body>
|
||||
<h1 id="logo">
|
||||
<a href="http://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" width="250" height="68" /></a>
|
||||
<br /> Version 3.1
|
||||
<br /> Version 3.0
|
||||
</h1>
|
||||
<p style="text-align: center">Semantic Personal Publishing Platform</p>
|
||||
|
||||
@@ -31,17 +31,17 @@
|
||||
<li>The installer should then send you to the <a href="wp-login.php">login page</a>. Sign in with the username and password you chose during the installation. If a password was generated for you, you can then click on 'Profile' to change the password.</li>
|
||||
</ol>
|
||||
|
||||
<h1>Updating</h1>
|
||||
<h2>Using the Automatic Updater</h2>
|
||||
<p>If you are updating from version 2.7 or higher, you can use the automatic updater:</p>
|
||||
<h1>Upgrading</h1>
|
||||
<h2>Using the Automatic Upgrader</h2>
|
||||
<p>If you are upgrading from version 2.7 or higher, you can use the automatic upgrader:</p>
|
||||
<ol>
|
||||
<li>Open the <span class="file"><a href="wp-admin/update-core.php">wp-admin/update-core.php</a></span> in your browser and follow the instructions.</li>
|
||||
<li>You wanted more, perhaps? That's it!</li>
|
||||
</ol>
|
||||
|
||||
<h2>Updating Manually</h2>
|
||||
<h2>Upgrading Manually</h2>
|
||||
<ol>
|
||||
<li>Before you update anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</li>
|
||||
<li>Before you upgrade anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</li>
|
||||
<li>Delete your old WordPress files, saving ones you've modified.</li>
|
||||
<li>Upload the new files.</li>
|
||||
<li>Point your browser to <span class="file"><a href="wp-admin/upgrade.php">/wp-admin/upgrade.php</a>.</span></li>
|
||||
@@ -70,7 +70,7 @@
|
||||
<dl>
|
||||
<dt><a href="http://codex.wordpress.org/">The WordPress Codex</a></dt>
|
||||
<dd>The Codex is the encyclopedia of all things WordPress. It is the most comprehensive source of information for WordPress available.</dd>
|
||||
<dt><a href="http://wordpress.org/news/">The WordPress Blog</a></dt>
|
||||
<dt><a href="http://wordpress.org/development/">The WordPress Blog</a></dt>
|
||||
<dd>This is where you'll find the latest updates and news related to WordPress. Recent WordPress news appears in your administrative dashboard by default.</dd>
|
||||
<dt><a href="http://planet.wordpress.org/">WordPress Planet</a></dt>
|
||||
<dd>The WordPress Planet is a news aggregator that brings together posts from WordPress blogs around the web.</dd>
|
||||
@@ -101,8 +101,8 @@
|
||||
|
||||
<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/" title="Donate to WordPress">donating</a>.</p>
|
||||
|
||||
<h1>License</h1>
|
||||
<p>WordPress is free software, and is released under the terms of the <abbr title="GNU General Public License">GPL</abbr> version 2 or (at your option) any later version. See <a href="license.txt">license.txt</a>.</p>
|
||||
<h1>Copyright</h1>
|
||||
<p>WordPress is released under the <abbr title="GNU Public License">GPL</abbr>v2 (see <a href="license.txt">license.txt</a>).</p>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
@@ -7,10 +7,12 @@ require( dirname(__FILE__) . '/wp-load.php' );
|
||||
require( './wp-blog-header.php' );
|
||||
|
||||
if ( !is_multisite() ) {
|
||||
wp_redirect( site_url( '/wp-login.php?action=register' ) );
|
||||
wp_redirect( get_option( 'siteurl' ) . "/wp-login.php?action=register" );
|
||||
die();
|
||||
}
|
||||
|
||||
require_once( ABSPATH . WPINC . '/registration.php');
|
||||
|
||||
if ( is_object( $wp_object_cache ) )
|
||||
$wp_object_cache->cache_enabled = false;
|
||||
|
||||
@@ -28,7 +30,7 @@ function wpmu_activate_stylesheet() {
|
||||
#submit, #key { width: 90%; font-size: 24px; }
|
||||
#language { margin-top: .5em; }
|
||||
.error { background: #f66; }
|
||||
span.h3 { padding: 0 8px; font-size: 1.3em; font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; font-weight: bold; color: #333; }
|
||||
span.h3 { padding:0 8px; font-size:1.3em; font-family:'Trebuchet MS','Lucida Grande',Verdana,Arial,Sans-Serif; font-weight:700; color:#333333; }
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
@@ -63,7 +65,7 @@ get_header();
|
||||
<?php
|
||||
echo '<p class="lead-in">';
|
||||
if ( $signup->domain . $signup->path == '' ) {
|
||||
printf( __('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) );
|
||||
printf( __('Your account has been activated. You may now <a href="%1$s">login</a> to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) );
|
||||
} else {
|
||||
printf( __('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of “%3$s”. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword' ) );
|
||||
}
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
/**
|
||||
* Executing AJAX process.
|
||||
*
|
||||
* @since 2.1.0
|
||||
* @since unknown
|
||||
*/
|
||||
define('DOING_AJAX', true);
|
||||
define('WP_ADMIN', true);
|
||||
|
||||
require_once('../wp-load.php');
|
||||
|
||||
if ( ! isset( $_REQUEST['action'] ) )
|
||||
die('-1');
|
||||
|
||||
require_once('../wp-load.php');
|
||||
|
||||
require_once('./includes/admin.php');
|
||||
@header('Content-Type: text/html; charset=' . get_option('blog_charset'));
|
||||
send_nosniff_header();
|
||||
@@ -50,43 +50,16 @@ if ( ! is_user_logged_in() ) {
|
||||
|
||||
if ( isset( $_GET['action'] ) ) :
|
||||
switch ( $action = $_GET['action'] ) :
|
||||
case 'fetch-list' :
|
||||
|
||||
$list_class = $_GET['list_args']['class'];
|
||||
check_ajax_referer( "fetch-list-$list_class", '_ajax_fetch_list_nonce' );
|
||||
|
||||
$current_screen = (object) $_GET['list_args']['screen'];
|
||||
//TODO fix this in a better way see #15336
|
||||
$current_screen->is_network = 'false' === $current_screen->is_network ? false : true;
|
||||
$current_screen->is_user = 'false' === $current_screen->is_user ? false : true;
|
||||
|
||||
define( 'WP_NETWORK_ADMIN', $current_screen->is_network );
|
||||
define( 'WP_USER_ADMIN', $current_screen->is_user );
|
||||
|
||||
$wp_list_table = _get_list_table( $list_class );
|
||||
if ( ! $wp_list_table )
|
||||
die( '0' );
|
||||
|
||||
if ( ! $wp_list_table->ajax_user_can() )
|
||||
die( '-1' );
|
||||
|
||||
$wp_list_table->ajax_response();
|
||||
|
||||
die( '0' );
|
||||
break;
|
||||
case 'ajax-tag-search' :
|
||||
if ( isset( $_GET['tax'] ) ) {
|
||||
$taxonomy = sanitize_key( $_GET['tax'] );
|
||||
$tax = get_taxonomy( $taxonomy );
|
||||
if ( ! $tax )
|
||||
die( '0' );
|
||||
if ( ! current_user_can( $tax->cap->assign_terms ) )
|
||||
die( '-1' );
|
||||
} else {
|
||||
die('0');
|
||||
}
|
||||
if ( !current_user_can( 'edit_posts' ) )
|
||||
die('-1');
|
||||
|
||||
$s = stripslashes( $_GET['q'] );
|
||||
$s = $_GET['q']; // is this slashed already?
|
||||
|
||||
if ( isset($_GET['tax']) )
|
||||
$taxonomy = sanitize_title($_GET['tax']);
|
||||
else
|
||||
die('0');
|
||||
|
||||
if ( false !== strpos( $s, ',' ) ) {
|
||||
$s = explode( ',', $s );
|
||||
@@ -96,7 +69,7 @@ case 'ajax-tag-search' :
|
||||
if ( strlen( $s ) < 2 )
|
||||
die; // require 2 chars for matching
|
||||
|
||||
$results = $wpdb->get_col( $wpdb->prepare( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.name LIKE (%s)", $taxonomy, '%' . like_escape( $s ) . '%' ) );
|
||||
$results = $wpdb->get_col( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = '$taxonomy' AND t.name LIKE ('%" . $s . "%')" );
|
||||
|
||||
echo join( $results, "\n" );
|
||||
die;
|
||||
@@ -189,7 +162,7 @@ endif;
|
||||
* @param int $comment_id
|
||||
* @return die
|
||||
*/
|
||||
function _wp_ajax_delete_comment_response( $comment_id, $delta = -1 ) {
|
||||
function _wp_ajax_delete_comment_response( $comment_id ) {
|
||||
$total = (int) @$_POST['_total'];
|
||||
$per_page = (int) @$_POST['_per_page'];
|
||||
$page = (int) @$_POST['_page'];
|
||||
@@ -198,39 +171,43 @@ function _wp_ajax_delete_comment_response( $comment_id, $delta = -1 ) {
|
||||
if ( !$total || !$per_page || !$page || !$url )
|
||||
die( (string) time() );
|
||||
|
||||
$total += $delta;
|
||||
if ( $total < 0 )
|
||||
if ( --$total < 0 ) // Take the total from POST and decrement it (since we just deleted one)
|
||||
$total = 0;
|
||||
|
||||
// Only do the expensive stuff on a page-break, and about 1 other time per page
|
||||
if ( 0 == $total % $per_page || 1 == mt_rand( 1, $per_page ) ) {
|
||||
$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'];
|
||||
}
|
||||
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() );
|
||||
|
||||
$comment_count = wp_count_comments($post_id);
|
||||
|
||||
if ( isset( $comment_count->$status ) ) // We're looking for a known type of comment count
|
||||
$total = $comment_count->$status;
|
||||
// else use the decremented value from above
|
||||
$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);
|
||||
$time = time(); // The time since the last comment count
|
||||
|
||||
if ( isset( $comment_count->$status ) ) // We're looking for a known type of comment count
|
||||
$total = $comment_count->$status;
|
||||
// else use the decremented value from above
|
||||
|
||||
$page_links = paginate_links( array(
|
||||
'base' => add_query_arg( 'apage', '%#%', $url ),
|
||||
'format' => '',
|
||||
'prev_text' => __('«'),
|
||||
'next_text' => __('»'),
|
||||
'total' => ceil($total / $per_page),
|
||||
'current' => $page
|
||||
) );
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'comment',
|
||||
'id' => $comment_id, // here for completeness - not used
|
||||
'supplemental' => array(
|
||||
'total_items_i18n' => sprintf( _n( '1 item', '%s items', $total ), number_format_i18n( $total ) ),
|
||||
'total_pages' => ceil( $total / $per_page ),
|
||||
'total_pages_i18n' => number_format_i18n( ceil( $total / $per_page ) ),
|
||||
'pageLinks' => $page_links,
|
||||
'total' => $total,
|
||||
'time' => $time
|
||||
)
|
||||
@@ -327,7 +304,6 @@ case 'delete-comment' : // On success, die with time() instead of 1
|
||||
check_ajax_referer( "delete-comment_$id" );
|
||||
$status = wp_get_comment_status( $comment->comment_ID );
|
||||
|
||||
$delta = -1;
|
||||
if ( isset($_POST['trash']) && 1 == $_POST['trash'] ) {
|
||||
if ( 'trash' == $status )
|
||||
die( (string) time() );
|
||||
@@ -336,8 +312,6 @@ case 'delete-comment' : // On success, die with time() instead of 1
|
||||
if ( 'trash' != $status )
|
||||
die( (string) time() );
|
||||
$r = wp_untrash_comment( $comment->comment_ID );
|
||||
if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'trash' ) // undo trash, not in trash
|
||||
$delta = 1;
|
||||
} elseif ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
|
||||
if ( 'spam' == $status )
|
||||
die( (string) time() );
|
||||
@@ -346,8 +320,6 @@ case 'delete-comment' : // On success, die with time() instead of 1
|
||||
if ( 'spam' != $status )
|
||||
die( (string) time() );
|
||||
$r = wp_unspam_comment( $comment->comment_ID );
|
||||
if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'spam' ) // undo spam, not in spam
|
||||
$delta = 1;
|
||||
} elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) {
|
||||
$r = wp_delete_comment( $comment->comment_ID );
|
||||
} else {
|
||||
@@ -355,7 +327,7 @@ case 'delete-comment' : // On success, die with time() instead of 1
|
||||
}
|
||||
|
||||
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, $delta );
|
||||
_wp_ajax_delete_comment_response( $comment->comment_ID );
|
||||
die( '0' );
|
||||
break;
|
||||
case 'delete-tag' :
|
||||
@@ -377,6 +349,42 @@ case 'delete-tag' :
|
||||
else
|
||||
die('0');
|
||||
break;
|
||||
case 'delete-link-cat' :
|
||||
check_ajax_referer( "delete-link-category_$id" );
|
||||
if ( !current_user_can( 'manage_categories' ) )
|
||||
die('-1');
|
||||
|
||||
$cat = get_term( $id, 'link_category' );
|
||||
if ( !$cat || is_wp_error( $cat ) )
|
||||
die('1');
|
||||
|
||||
$cat_name = get_term_field('name', $id, 'link_category');
|
||||
|
||||
$default = get_option('default_link_category');
|
||||
|
||||
// Don't delete the default cats.
|
||||
if ( $id == $default ) {
|
||||
$x = new WP_AJAX_Response( array(
|
||||
'what' => 'link-cat',
|
||||
'id' => $id,
|
||||
'data' => new WP_Error( 'default-link-cat', sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name) )
|
||||
) );
|
||||
$x->send();
|
||||
}
|
||||
|
||||
$r = wp_delete_term($id, 'link_category', array('default' => $default));
|
||||
if ( !$r )
|
||||
die('0');
|
||||
if ( is_wp_error($r) ) {
|
||||
$x = new WP_AJAX_Response( array(
|
||||
'what' => 'link-cat',
|
||||
'id' => $id,
|
||||
'data' => $r
|
||||
) );
|
||||
$x->send();
|
||||
}
|
||||
die('1');
|
||||
break;
|
||||
case 'delete-link' :
|
||||
check_ajax_referer( "delete-bookmark_$id" );
|
||||
if ( !current_user_can( 'manage_links' ) )
|
||||
@@ -507,21 +515,56 @@ case 'add-link-category' : // On the Fly
|
||||
}
|
||||
$x->send();
|
||||
break;
|
||||
case 'add-tag' :
|
||||
case 'add-link-cat' : // From Blogroll -> Categories
|
||||
check_ajax_referer( 'add-link-category' );
|
||||
if ( !current_user_can( 'manage_categories' ) )
|
||||
die('-1');
|
||||
|
||||
if ( '' === trim($_POST['name']) ) {
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'link-cat',
|
||||
'id' => new WP_Error( 'name', __('You did not enter a category name.') )
|
||||
) );
|
||||
$x->send();
|
||||
}
|
||||
|
||||
$r = wp_insert_term($_POST['name'], 'link_category', $_POST );
|
||||
if ( is_wp_error( $r ) ) {
|
||||
$x = new WP_AJAX_Response( array(
|
||||
'what' => 'link-cat',
|
||||
'id' => $r
|
||||
) );
|
||||
$x->send();
|
||||
}
|
||||
|
||||
extract($r, EXTR_SKIP);
|
||||
|
||||
if ( !$link_cat = link_cat_row( $term_id ) )
|
||||
die('0');
|
||||
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'link-cat',
|
||||
'id' => $term_id,
|
||||
'position' => -1,
|
||||
'data' => $link_cat
|
||||
) );
|
||||
$x->send();
|
||||
break;
|
||||
case 'add-tag' : // From Manage->Tags
|
||||
check_ajax_referer( 'add-tag' );
|
||||
$post_type = !empty($_POST['post_type']) ? $_POST['post_type'] : 'post';
|
||||
|
||||
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
|
||||
$tax = get_taxonomy($taxonomy);
|
||||
|
||||
$x = new WP_Ajax_Response();
|
||||
|
||||
if ( !current_user_can( $tax->cap->edit_terms ) )
|
||||
die('-1');
|
||||
|
||||
$x = new WP_Ajax_Response();
|
||||
|
||||
$tag = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST );
|
||||
|
||||
if ( !$tag || is_wp_error($tag) || (!$tag = get_term( $tag['term_id'], $taxonomy )) ) {
|
||||
$message = __('An error has occurred. Please reload the page and try again.');
|
||||
$message = __('An error has occured. Please reload the page and try again.');
|
||||
if ( is_wp_error($tag) && $tag->get_error_message() )
|
||||
$message = $tag->get_error_message();
|
||||
|
||||
@@ -532,21 +575,23 @@ case 'add-tag' :
|
||||
$x->send();
|
||||
}
|
||||
|
||||
set_current_screen( $_POST['screen'] );
|
||||
|
||||
$wp_list_table = _get_list_table('WP_Terms_List_Table');
|
||||
if ( isset($_POST['screen']) )
|
||||
set_current_screen($_POST['screen']);
|
||||
|
||||
$level = 0;
|
||||
$tag_full_name = false;
|
||||
$tag_full_name = $tag->name;
|
||||
if ( is_taxonomy_hierarchical($taxonomy) ) {
|
||||
$level = count( get_ancestors( $tag->term_id, $taxonomy ) );
|
||||
ob_start();
|
||||
$wp_list_table->single_row( $tag, $level );
|
||||
$noparents = ob_get_clean();
|
||||
$_tag = $tag;
|
||||
while ( $_tag->parent ) {
|
||||
$_tag = get_term( $_tag->parent, $taxonomy );
|
||||
$tag_full_name = $_tag->name . ' — ' . $tag_full_name;
|
||||
$level++;
|
||||
}
|
||||
$noparents = _tag_row( $tag, $level, $taxonomy );
|
||||
}
|
||||
|
||||
ob_start();
|
||||
$wp_list_table->single_row( $tag );
|
||||
$parents = ob_get_clean();
|
||||
$tag->name = $tag_full_name;
|
||||
$parents = _tag_row( $tag, 0, $taxonomy);
|
||||
|
||||
$x->add( array(
|
||||
'what' => 'taxonomy',
|
||||
@@ -555,29 +600,28 @@ case 'add-tag' :
|
||||
$x->add( array(
|
||||
'what' => 'term',
|
||||
'position' => $level,
|
||||
'supplemental' => (array) $tag
|
||||
'supplemental' => get_term( $tag->term_id, $taxonomy, ARRAY_A ) //Refetch as $tag has been contaminated by the full name.
|
||||
) );
|
||||
$x->send();
|
||||
break;
|
||||
case 'get-tagcloud' :
|
||||
if ( isset( $_POST['tax'] ) ) {
|
||||
$taxonomy = sanitize_key( $_POST['tax'] );
|
||||
$tax = get_taxonomy( $taxonomy );
|
||||
if ( ! $tax )
|
||||
die( '0' );
|
||||
if ( ! current_user_can( $tax->cap->assign_terms ) )
|
||||
die( '-1' );
|
||||
} else {
|
||||
if ( !current_user_can( 'edit_posts' ) )
|
||||
die('-1');
|
||||
|
||||
if ( isset($_POST['tax']) )
|
||||
$taxonomy = sanitize_title($_POST['tax']);
|
||||
else
|
||||
die('0');
|
||||
}
|
||||
|
||||
$tags = get_terms( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) );
|
||||
|
||||
if ( empty( $tags ) )
|
||||
if ( empty( $tags ) ) {
|
||||
$tax = get_taxonomy( $taxonomy );
|
||||
die( isset( $tax->no_tagcloud ) ? $tax->no_tagcloud : __('No tags found!') );
|
||||
}
|
||||
|
||||
if ( is_wp_error( $tags ) )
|
||||
die( $tags->get_error_message() );
|
||||
if ( is_wp_error($tags) )
|
||||
die($tags->get_error_message());
|
||||
|
||||
foreach ( $tags as $key => $tag ) {
|
||||
$tags[ $key ]->link = '#';
|
||||
@@ -594,27 +638,63 @@ case 'get-tagcloud' :
|
||||
|
||||
exit;
|
||||
break;
|
||||
case 'add-comment' :
|
||||
check_ajax_referer( $action );
|
||||
if ( !current_user_can( 'edit_posts' ) )
|
||||
die('-1');
|
||||
$search = isset($_POST['s']) ? $_POST['s'] : false;
|
||||
$status = isset($_POST['comment_status']) ? $_POST['comment_status'] : 'all';
|
||||
$per_page = isset($_POST['per_page']) ? (int) $_POST['per_page'] + 8 : 28;
|
||||
$start = isset($_POST['page']) ? ( intval($_POST['page']) * $per_page ) -1 : $per_page - 1;
|
||||
if ( 1 > $start )
|
||||
$start = 27;
|
||||
|
||||
$mode = isset($_POST['mode']) ? $_POST['mode'] : 'detail';
|
||||
$p = isset($_POST['p']) ? $_POST['p'] : 0;
|
||||
$comment_type = isset($_POST['comment_type']) ? $_POST['comment_type'] : '';
|
||||
list($comments, $total) = _wp_get_comment_list( $status, $search, $start, 1, $p, $comment_type );
|
||||
|
||||
if ( get_option('show_avatars') )
|
||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
||||
|
||||
if ( !$comments )
|
||||
die('1');
|
||||
$x = new WP_Ajax_Response();
|
||||
foreach ( (array) $comments as $comment ) {
|
||||
get_comment( $comment );
|
||||
ob_start();
|
||||
_wp_comment_row( $comment->comment_ID, $mode, $status, true, true );
|
||||
$comment_list_item = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$x->add( array(
|
||||
'what' => 'comment',
|
||||
'id' => $comment->comment_ID,
|
||||
'data' => $comment_list_item
|
||||
) );
|
||||
}
|
||||
$x->send();
|
||||
break;
|
||||
case 'get-comments' :
|
||||
check_ajax_referer( $action );
|
||||
|
||||
set_current_screen( 'edit-comments' );
|
||||
|
||||
$wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
|
||||
|
||||
if ( !current_user_can( 'edit_post', $post_id ) )
|
||||
$post_ID = (int) $_POST['post_ID'];
|
||||
if ( !current_user_can( 'edit_post', $post_ID ) )
|
||||
die('-1');
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
$start = isset($_POST['start']) ? intval($_POST['start']) : 0;
|
||||
$num = isset($_POST['num']) ? intval($_POST['num']) : 10;
|
||||
|
||||
if ( !$wp_list_table->has_items() )
|
||||
list($comments, $total) = _wp_get_comment_list( false, false, $start, $num, $post_ID );
|
||||
|
||||
if ( !$comments )
|
||||
die('1');
|
||||
|
||||
$comment_list_item = '';
|
||||
$x = new WP_Ajax_Response();
|
||||
foreach ( $wp_list_table->items as $comment ) {
|
||||
foreach ( (array) $comments as $comment ) {
|
||||
get_comment( $comment );
|
||||
ob_start();
|
||||
$wp_list_table->single_row( $comment );
|
||||
_wp_comment_row( $comment->comment_ID, 'single', false, false );
|
||||
$comment_list_item .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
}
|
||||
@@ -627,8 +707,6 @@ case 'get-comments' :
|
||||
case 'replyto-comment' :
|
||||
check_ajax_referer( $action, '_ajax_nonce-replyto-comment' );
|
||||
|
||||
set_current_screen( 'edit-comments' );
|
||||
|
||||
$comment_post_ID = (int) $_POST['comment_post_ID'];
|
||||
if ( !current_user_can( 'edit_post', $comment_post_ID ) )
|
||||
die('-1');
|
||||
@@ -666,21 +744,22 @@ case 'replyto-comment' :
|
||||
$comment = get_comment($comment_id);
|
||||
if ( ! $comment ) die('1');
|
||||
|
||||
$modes = array( 'single', 'detail', 'dashboard' );
|
||||
$mode = isset($_POST['mode']) && in_array( $_POST['mode'], $modes ) ? $_POST['mode'] : 'detail';
|
||||
$position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
|
||||
$checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
|
||||
|
||||
if ( get_option('show_avatars') && 'single' != $mode )
|
||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
||||
|
||||
$x = new WP_Ajax_Response();
|
||||
|
||||
ob_start();
|
||||
if ( 'dashboard' == $_REQUEST['mode'] ) {
|
||||
if ( 'dashboard' == $mode ) {
|
||||
require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );
|
||||
_wp_dashboard_recent_comments_row( $comment );
|
||||
_wp_dashboard_recent_comments_row( $comment, false );
|
||||
} else {
|
||||
if ( 'single' == $_REQUEST['mode'] ) {
|
||||
$wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
|
||||
} else {
|
||||
$wp_list_table = _get_list_table('WP_Comments_List_Table');
|
||||
}
|
||||
$wp_list_table->single_row( $comment );
|
||||
_wp_comment_row( $comment->comment_ID, $mode, false, $checkbox );
|
||||
}
|
||||
$comment_list_item = ob_get_contents();
|
||||
ob_end_clean();
|
||||
@@ -697,8 +776,6 @@ case 'replyto-comment' :
|
||||
case 'edit-comment' :
|
||||
check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' );
|
||||
|
||||
set_current_screen( 'edit-comments' );
|
||||
|
||||
$comment_post_ID = (int) $_POST['comment_post_ID'];
|
||||
if ( ! current_user_can( 'edit_post', $comment_post_ID ) )
|
||||
die('-1');
|
||||
@@ -710,19 +787,21 @@ case 'edit-comment' :
|
||||
$_POST['comment_status'] = $_POST['status'];
|
||||
edit_comment();
|
||||
|
||||
$mode = ( isset($_POST['mode']) && 'single' == $_POST['mode'] ) ? 'single' : 'detail';
|
||||
$position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
|
||||
$comments_status = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';
|
||||
|
||||
$checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
|
||||
$wp_list_table = _get_list_table( $checkbox ? 'WP_Comments_List_Table' : 'WP_Post_Comments_List_Table' );
|
||||
$comments_listing = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';
|
||||
|
||||
ob_start();
|
||||
$wp_list_table->single_row( get_comment( $comment_id ) );
|
||||
$comment_list_item = ob_get_contents();
|
||||
ob_end_clean();
|
||||
if ( get_option('show_avatars') && 'single' != $mode )
|
||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
||||
|
||||
$x = new WP_Ajax_Response();
|
||||
|
||||
ob_start();
|
||||
_wp_comment_row( $comment_id, $mode, $comments_listing, $checkbox );
|
||||
$comment_list_item = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
$x->add( array(
|
||||
'what' => 'edit_comment',
|
||||
'id' => $comment->comment_ID,
|
||||
@@ -740,37 +819,7 @@ case 'add-menu-item' :
|
||||
|
||||
require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
|
||||
|
||||
// For performance reasons, we omit some object properties from the checklist.
|
||||
// The following is a hacky way to restore them when adding non-custom items.
|
||||
|
||||
$menu_items_data = array();
|
||||
foreach ( (array) $_POST['menu-item'] as $menu_item_data ) {
|
||||
if (
|
||||
! empty( $menu_item_data['menu-item-type'] ) &&
|
||||
'custom' != $menu_item_data['menu-item-type'] &&
|
||||
! empty( $menu_item_data['menu-item-object-id'] )
|
||||
) {
|
||||
switch( $menu_item_data['menu-item-type'] ) {
|
||||
case 'post_type' :
|
||||
$_object = get_post( $menu_item_data['menu-item-object-id'] );
|
||||
break;
|
||||
|
||||
case 'taxonomy' :
|
||||
$_object = get_term( $menu_item_data['menu-item-object-id'], $menu_item_data['menu-item-object'] );
|
||||
break;
|
||||
}
|
||||
|
||||
$_menu_items = array_map( 'wp_setup_nav_menu_item', array( $_object ) );
|
||||
$_menu_item = array_shift( $_menu_items );
|
||||
|
||||
// Restore the missing menu item properties
|
||||
$menu_item_data['menu-item-description'] = $_menu_item->description;
|
||||
}
|
||||
|
||||
$menu_items_data[] = $menu_item_data;
|
||||
}
|
||||
|
||||
$item_ids = wp_save_nav_menu_items( 0, $menu_items_data );
|
||||
$item_ids = wp_save_nav_menu_items( 0, $_POST['menu-item'] );
|
||||
if ( is_wp_error( $item_ids ) )
|
||||
die('-1');
|
||||
|
||||
@@ -844,7 +893,7 @@ case 'add-meta' :
|
||||
'supplemental' => array('postid' => $pid)
|
||||
) );
|
||||
} else { // Update?
|
||||
$mid = (int) array_pop( $var_by_ref = array_keys($_POST['meta']) );
|
||||
$mid = (int) array_pop(array_keys($_POST['meta']));
|
||||
$key = $_POST['meta'][$mid]['key'];
|
||||
$value = $_POST['meta'][$mid]['value'];
|
||||
if ( '' == trim($key) )
|
||||
@@ -880,6 +929,7 @@ case 'add-user' :
|
||||
check_ajax_referer( $action );
|
||||
if ( !current_user_can('create_users') )
|
||||
die('-1');
|
||||
require_once(ABSPATH . WPINC . '/registration.php');
|
||||
if ( !$user_id = add_user() )
|
||||
die('0');
|
||||
elseif ( is_wp_error( $user_id ) ) {
|
||||
@@ -891,12 +941,10 @@ case 'add-user' :
|
||||
}
|
||||
$user_object = new WP_User( $user_id );
|
||||
|
||||
$wp_list_table = _get_list_table('WP_Users_List_Table');
|
||||
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'user',
|
||||
'id' => $user_id,
|
||||
'data' => $wp_list_table->single_row( $user_object, '', $user_object->roles[0] ),
|
||||
'data' => user_row( $user_object, '', $user_object->roles[0] ),
|
||||
'supplemental' => array(
|
||||
'show-link' => sprintf(__( 'User <a href="#%s">%s</a> added' ), "user-$user_id", $user_object->user_login),
|
||||
'role' => $user_object->roles[0]
|
||||
@@ -908,6 +956,7 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
|
||||
define( 'DOING_AUTOSAVE', true );
|
||||
|
||||
$nonce_age = check_ajax_referer( 'autosave', 'autosavenonce' );
|
||||
global $current_user;
|
||||
|
||||
$_POST['post_category'] = explode(",", $_POST['catslist']);
|
||||
if ( $_POST['post_type'] == 'page' || empty($_POST['post_category']) )
|
||||
@@ -1088,27 +1137,6 @@ case 'menu-quick-search':
|
||||
|
||||
_wp_ajax_menu_quick_search( $_REQUEST );
|
||||
|
||||
exit;
|
||||
break;
|
||||
case 'wp-link-ajax':
|
||||
require_once ABSPATH . 'wp-admin/includes/internal-linking.php';
|
||||
|
||||
check_ajax_referer( 'internal-linking', '_ajax_linking_nonce' );
|
||||
|
||||
$args = array();
|
||||
|
||||
if ( isset( $_POST['search'] ) )
|
||||
$args['s'] = stripslashes( $_POST['search'] );
|
||||
$args['pagenum'] = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 1;
|
||||
|
||||
$results = wp_link_query( $args );
|
||||
|
||||
if ( ! isset( $results ) )
|
||||
die( '0' );
|
||||
|
||||
echo json_encode( $results );
|
||||
echo "\n";
|
||||
|
||||
exit;
|
||||
break;
|
||||
case 'menu-locations-save':
|
||||
@@ -1117,7 +1145,7 @@ case 'menu-locations-save':
|
||||
check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' );
|
||||
if ( ! isset( $_POST['menu-locations'] ) )
|
||||
die('0');
|
||||
set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_POST['menu-locations'] ) );
|
||||
set_theme_mod( 'nav_menu_locations', $_POST['menu-locations'] );
|
||||
die('1');
|
||||
break;
|
||||
case 'meta-box-order':
|
||||
@@ -1166,7 +1194,8 @@ case 'inline-save':
|
||||
die( __('You are not allowed to edit this post.') );
|
||||
}
|
||||
|
||||
set_current_screen( $_POST['screen'] );
|
||||
if ( isset($_POST['screen']) )
|
||||
set_current_screen($_POST['screen']);
|
||||
|
||||
if ( $last = wp_check_post_lock( $post_ID ) ) {
|
||||
$last_user = get_userdata( $last );
|
||||
@@ -1203,48 +1232,67 @@ case 'inline-save':
|
||||
// update the post
|
||||
edit_post();
|
||||
|
||||
$wp_list_table = _get_list_table('WP_Posts_List_Table');
|
||||
|
||||
$mode = $_POST['post_view'];
|
||||
$wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ) );
|
||||
$post = array();
|
||||
if ( 'page' == $_POST['post_type'] ) {
|
||||
$post[] = get_post($_POST['post_ID']);
|
||||
page_rows($post);
|
||||
} elseif ( 'post' == $_POST['post_type'] || in_array($_POST['post_type'], get_post_types( array('public' => true) ) ) ) {
|
||||
$mode = $_POST['post_view'];
|
||||
$post[] = get_post($_POST['post_ID']);
|
||||
post_rows($post);
|
||||
}
|
||||
|
||||
exit;
|
||||
break;
|
||||
case 'inline-save-tax':
|
||||
check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' );
|
||||
|
||||
$taxonomy = sanitize_key( $_POST['taxonomy'] );
|
||||
$tax = get_taxonomy( $taxonomy );
|
||||
if ( ! $tax )
|
||||
die( '0' );
|
||||
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : false;
|
||||
if ( ! $taxonomy )
|
||||
die( __('Cheatin’ uh?') );
|
||||
$tax = get_taxonomy($taxonomy);
|
||||
|
||||
if ( ! current_user_can( $tax->cap->edit_terms ) )
|
||||
die( '-1' );
|
||||
|
||||
set_current_screen( 'edit-' . $taxonomy );
|
||||
|
||||
$wp_list_table = _get_list_table('WP_Terms_List_Table');
|
||||
die( __('Cheatin’ uh?') );
|
||||
|
||||
if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) )
|
||||
die(-1);
|
||||
|
||||
$tag = get_term( $id, $taxonomy );
|
||||
$_POST['description'] = $tag->description;
|
||||
switch ($_POST['tax_type']) {
|
||||
case 'link-cat' :
|
||||
$updated = wp_update_term($id, 'link_category', $_POST);
|
||||
|
||||
$updated = wp_update_term($id, $taxonomy, $_POST);
|
||||
if ( $updated && !is_wp_error($updated) ) {
|
||||
$tag = get_term( $updated['term_id'], $taxonomy );
|
||||
if ( !$tag || is_wp_error( $tag ) ) {
|
||||
if ( is_wp_error($tag) && $tag->get_error_message() )
|
||||
die( $tag->get_error_message() );
|
||||
die( __('Item not updated.') );
|
||||
}
|
||||
if ( $updated && !is_wp_error($updated) )
|
||||
echo link_cat_row($updated['term_id']);
|
||||
else
|
||||
die( __('Category not updated.') );
|
||||
|
||||
echo $wp_list_table->single_row( $tag );
|
||||
} else {
|
||||
if ( is_wp_error($updated) && $updated->get_error_message() )
|
||||
die( $updated->get_error_message() );
|
||||
die( __('Item not updated.') );
|
||||
break;
|
||||
case 'tag' :
|
||||
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
|
||||
|
||||
$tag = get_term( $id, $taxonomy );
|
||||
$_POST['description'] = $tag->description;
|
||||
|
||||
$updated = wp_update_term($id, $taxonomy, $_POST);
|
||||
if ( $updated && !is_wp_error($updated) ) {
|
||||
$tag = get_term( $updated['term_id'], $taxonomy );
|
||||
if ( !$tag || is_wp_error( $tag ) ) {
|
||||
if ( is_wp_error($tag) && $tag->get_error_message() )
|
||||
die( $tag->get_error_message() );
|
||||
die( __('Item not updated.') );
|
||||
}
|
||||
|
||||
set_current_screen( 'edit-' . $taxonomy );
|
||||
|
||||
echo _tag_row($tag, 0, $taxonomy);
|
||||
} else {
|
||||
if ( is_wp_error($updated) && $updated->get_error_message() )
|
||||
die( $updated->get_error_message() );
|
||||
die( __('Item not updated.') );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
exit;
|
||||
@@ -1266,11 +1314,11 @@ case 'find_posts':
|
||||
|
||||
$searchand = $search = '';
|
||||
foreach ( (array) $search_terms as $term ) {
|
||||
$term = esc_sql( like_escape( $term ) );
|
||||
$term = addslashes_gpc($term);
|
||||
$search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))";
|
||||
$searchand = ' AND ';
|
||||
}
|
||||
$term = esc_sql( like_escape( $s ) );
|
||||
$term = $wpdb->escape($s);
|
||||
if ( count($search_terms) > 1 && $search_terms[0] != $s )
|
||||
$search .= " OR ($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%')";
|
||||
|
||||
@@ -1319,6 +1367,19 @@ case 'find_posts':
|
||||
));
|
||||
$x->send();
|
||||
|
||||
break;
|
||||
case 'lj-importer' :
|
||||
check_ajax_referer( 'lj-api-import' );
|
||||
if ( !current_user_can( 'publish_posts' ) )
|
||||
die('-1');
|
||||
if ( empty( $_POST['step'] ) )
|
||||
die( '-1' );
|
||||
define('WP_IMPORTING', true);
|
||||
include( ABSPATH . 'wp-admin/import/livejournal.php' );
|
||||
$result = $lj_api_import->{ 'step' . ( (int) $_POST['step'] ) }();
|
||||
if ( is_wp_error( $result ) )
|
||||
echo $result->get_error_message();
|
||||
die;
|
||||
break;
|
||||
case 'widgets-order' :
|
||||
check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' );
|
||||
@@ -1367,7 +1428,7 @@ case 'save-widget' :
|
||||
$sidebar_id = $_POST['sidebar'];
|
||||
$multi_number = !empty($_POST['multi_number']) ? (int) $_POST['multi_number'] : 0;
|
||||
$settings = isset($_POST['widget-' . $id_base]) && is_array($_POST['widget-' . $id_base]) ? $_POST['widget-' . $id_base] : false;
|
||||
$error = '<p>' . __('An error has occurred. Please reload the page and try again.') . '</p>';
|
||||
$error = '<p>' . __('An error has occured. Please reload the page and try again.') . '</p>';
|
||||
|
||||
$sidebars = wp_get_sidebars_widgets();
|
||||
$sidebar = isset($sidebars[$sidebar_id]) ? $sidebars[$sidebar_id] : array();
|
||||
@@ -1457,16 +1518,15 @@ case 'set-post-thumbnail':
|
||||
die( _wp_post_thumbnail_html() );
|
||||
}
|
||||
|
||||
if ( set_post_thumbnail( $post_ID, $thumbnail_id ) )
|
||||
die( _wp_post_thumbnail_html( $thumbnail_id ) );
|
||||
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' );
|
||||
break;
|
||||
case 'date_format' :
|
||||
die( date_i18n( sanitize_option( 'date_format', $_POST['date'] ) ) );
|
||||
break;
|
||||
case 'time_format' :
|
||||
die( date_i18n( sanitize_option( 'time_format', $_POST['date'] ) ) );
|
||||
break;
|
||||
default :
|
||||
do_action( 'wp_ajax_' . $_POST['action'] );
|
||||
die('0');
|
||||
|
||||
@@ -12,38 +12,22 @@ if ( ! defined( 'WP_ADMIN' ) )
|
||||
|
||||
get_admin_page_title();
|
||||
$title = esc_html( strip_tags( $title ) );
|
||||
|
||||
if ( is_network_admin() )
|
||||
$admin_title = __( 'Network Admin' );
|
||||
elseif ( is_user_admin() )
|
||||
$admin_title = __( 'Global Dashboard' );
|
||||
else
|
||||
$admin_title = get_bloginfo( 'name' );
|
||||
|
||||
if ( $admin_title == $title )
|
||||
$admin_title = sprintf( __( '%1$s — WordPress' ), $title );
|
||||
else
|
||||
$admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $admin_title );
|
||||
|
||||
$admin_title = apply_filters( 'admin_title', $admin_title, $title );
|
||||
|
||||
wp_user_settings();
|
||||
wp_menu_unfold();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
||||
<title><?php echo $admin_title; ?></title>
|
||||
<title><?php echo $title; ?> ‹ <?php bloginfo('name') ?> — WordPress</title>
|
||||
<?php
|
||||
|
||||
wp_admin_css( 'global' );
|
||||
wp_admin_css( 'css/global' );
|
||||
wp_admin_css();
|
||||
wp_admin_css( 'colors' );
|
||||
wp_admin_css( 'ie' );
|
||||
wp_admin_css( 'css/colors' );
|
||||
wp_admin_css( 'css/ie' );
|
||||
if ( is_multisite() )
|
||||
wp_admin_css( 'ms' );
|
||||
wp_admin_css( 'css/ms' );
|
||||
wp_enqueue_script('utils');
|
||||
|
||||
$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
|
||||
@@ -69,7 +53,6 @@ var userSettings = {
|
||||
|
||||
if ( in_array( $pagenow, array('post.php', 'post-new.php') ) ) {
|
||||
add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 );
|
||||
add_action( 'admin_print_footer_scripts', 'wp_tiny_mce_preload_dialogs', 30 );
|
||||
wp_enqueue_script('quicktags');
|
||||
}
|
||||
|
||||
@@ -84,9 +67,6 @@ do_action('admin_head');
|
||||
if ( get_user_setting('mfold') == 'f' )
|
||||
$admin_body_class .= ' folded';
|
||||
|
||||
if ( is_admin_bar_showing() )
|
||||
$admin_body_class .= ' admin-bar';
|
||||
|
||||
if ( $is_iphone ) { ?>
|
||||
<style type="text/css">.row-actions{visibility:visible;}</style>
|
||||
<?php } ?>
|
||||
@@ -106,15 +86,9 @@ document.body.className = c;
|
||||
<div id="wpcontent">
|
||||
<div id="wphead">
|
||||
<?php
|
||||
|
||||
if ( is_network_admin() )
|
||||
$blog_name = sprintf( __('%s Network Admin'), esc_html($current_site->site_name) );
|
||||
elseif ( is_user_admin() )
|
||||
$blog_name = sprintf( __('%s Global Dashboard'), esc_html($current_site->site_name) );
|
||||
else
|
||||
$blog_name = get_bloginfo('name', 'display');
|
||||
$blog_name = get_bloginfo('name', 'display');
|
||||
if ( '' == $blog_name ) {
|
||||
$blog_name = __( 'Visit Site' );
|
||||
$blog_name = ' ';
|
||||
} else {
|
||||
$blog_name_excerpt = wp_html_excerpt($blog_name, 40);
|
||||
if ( $blog_name != $blog_name_excerpt )
|
||||
@@ -137,7 +111,7 @@ if ( function_exists('mb_strlen') ) {
|
||||
<a href="<?php echo trailingslashit( get_bloginfo( 'url' ) ); ?>" title="<?php esc_attr_e('Visit Site') ?>">
|
||||
<span id="site-title"><?php echo $blog_name ?></span>
|
||||
</a>
|
||||
<?php if ( !is_network_admin() && !is_user_admin() && current_user_can('manage_options') && '1' != get_option('blog_public') ): ?>
|
||||
<?php if ( current_user_can('manage_options') && '1' != get_option('blog_public') ): ?>
|
||||
<a id="privacy-on-link" href="options-privacy.php" title="<?php echo esc_attr( apply_filters('privacy_on_link_title', __('Your site is asking search engines not to index its content') ) ); ?>"><?php echo apply_filters('privacy_on_link_text', __('Search Engines Blocked') ); ?></a>
|
||||
<?php endif; ?>
|
||||
</h1>
|
||||
@@ -149,13 +123,7 @@ if ( function_exists('mb_strlen') ) {
|
||||
<p><?php
|
||||
$links = array();
|
||||
$links[5] = sprintf(__('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity);
|
||||
if ( is_multisite() && is_super_admin() ) {
|
||||
if ( !is_network_admin() )
|
||||
$links[10] = '| <a href="' . network_admin_url() . '" title="' . ( ! empty( $update_title ) ? $update_title : esc_attr__('Network Admin') ) . '">' . __('Network Admin') . ( ! empty( $total_update_count ) ? ' (' . number_format_i18n( $total_update_count ) . ')' : '' ) . '</a>';
|
||||
else
|
||||
$links[10] = '| <a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>';
|
||||
}
|
||||
$links[15] = '| <a href="' . wp_logout_url() . '" title="' . esc_attr__('Log Out') . '">' . __('Log Out') . '</a>';
|
||||
$links[15] = '| <a href="' . wp_logout_url() . '" title="' . __('Log Out') . '">' . __('Log Out') . '</a>';
|
||||
|
||||
$links = apply_filters('admin_user_info_links', $links, $current_user);
|
||||
ksort($links);
|
||||
@@ -170,7 +138,7 @@ echo implode(' ', $links);
|
||||
|
||||
<div id="wpbody">
|
||||
<?php
|
||||
unset($title_class, $blog_name, $total_update_count, $update_title);
|
||||
unset($title_class, $blog_name);
|
||||
|
||||
require(ABSPATH . 'wp-admin/menu-header.php');
|
||||
|
||||
@@ -183,14 +151,7 @@ $current_screen->parent_base = str_replace('.php', '', $current_screen->parent_b
|
||||
<?php
|
||||
screen_meta($current_screen);
|
||||
|
||||
if ( is_network_admin() )
|
||||
do_action('network_admin_notices');
|
||||
elseif ( is_user_admin() )
|
||||
do_action('user_admin_notices');
|
||||
else
|
||||
do_action('admin_notices');
|
||||
|
||||
do_action('all_admin_notices');
|
||||
do_action('admin_notices');
|
||||
|
||||
if ( $parent_file == 'options-general.php' )
|
||||
require(ABSPATH . 'wp-admin/options-head.php');
|
||||
|
||||
@@ -9,21 +9,11 @@
|
||||
/**
|
||||
* In WordPress Administration Panels
|
||||
*
|
||||
* @since 2.3.2
|
||||
* @since unknown
|
||||
*/
|
||||
if ( ! defined('WP_ADMIN') )
|
||||
if ( !defined('WP_ADMIN') )
|
||||
define('WP_ADMIN', TRUE);
|
||||
|
||||
if ( ! defined('WP_NETWORK_ADMIN') )
|
||||
define('WP_NETWORK_ADMIN', FALSE);
|
||||
|
||||
if ( ! defined('WP_USER_ADMIN') )
|
||||
define('WP_USER_ADMIN', FALSE);
|
||||
|
||||
if ( ! WP_NETWORK_ADMIN && ! WP_USER_ADMIN ) {
|
||||
define('WP_BLOG_ADMIN', TRUE);
|
||||
}
|
||||
|
||||
if ( isset($_GET['import']) && !defined('WP_LOAD_IMPORTERS') )
|
||||
define('WP_LOAD_IMPORTERS', true);
|
||||
|
||||
@@ -67,6 +57,8 @@ auth_redirect();
|
||||
|
||||
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');
|
||||
@@ -98,12 +90,7 @@ if ( isset($_GET['taxonomy']) )
|
||||
else
|
||||
$taxnow = '';
|
||||
|
||||
if ( WP_NETWORK_ADMIN )
|
||||
require(ABSPATH . 'wp-admin/network/menu.php');
|
||||
elseif ( WP_USER_ADMIN )
|
||||
require(ABSPATH . 'wp-admin/user/menu.php');
|
||||
else
|
||||
require(ABSPATH . 'wp-admin/menu.php');
|
||||
require(ABSPATH . 'wp-admin/menu.php');
|
||||
|
||||
if ( current_user_can( 'manage_options' ) )
|
||||
@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', '256M' ) );
|
||||
@@ -124,7 +111,7 @@ if ( isset($plugin_page) ) {
|
||||
$query_string = $_SERVER[ 'QUERY_STRING' ];
|
||||
else
|
||||
$query_string = 'page=' . $plugin_page;
|
||||
wp_redirect( admin_url('tools.php?' . $query_string) );
|
||||
wp_redirect( 'tools.php?' . $query_string );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -165,7 +152,7 @@ if ( isset($plugin_page) ) {
|
||||
if ( file_exists(WPMU_PLUGIN_DIR . "/$plugin_page") )
|
||||
include(WPMU_PLUGIN_DIR . "/$plugin_page");
|
||||
else
|
||||
include(WP_PLUGIN_DIR . "/$plugin_page");
|
||||
include(ABSPATH . PLUGINDIR . "/$plugin_page");
|
||||
}
|
||||
|
||||
include(ABSPATH . 'wp-admin/admin-footer.php');
|
||||
@@ -178,17 +165,13 @@ if ( isset($plugin_page) ) {
|
||||
if ( ! current_user_can('import') )
|
||||
wp_die(__('You are not allowed to import.'));
|
||||
|
||||
if ( validate_file($importer) ) {
|
||||
if ( validate_file($importer) )
|
||||
wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
// Allow plugins to define importers as well
|
||||
if ( !isset($wp_importers) || !isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2])) {
|
||||
if (! file_exists(ABSPATH . "wp-admin/import/$importer.php")) {
|
||||
if (! file_exists(ABSPATH . "wp-admin/import/$importer.php"))
|
||||
wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );
|
||||
exit;
|
||||
}
|
||||
include(ABSPATH . "wp-admin/import/$importer.php");
|
||||
}
|
||||
|
||||
@@ -203,8 +186,8 @@ if ( isset($plugin_page) ) {
|
||||
|
||||
define('WP_IMPORTING', true);
|
||||
|
||||
if ( apply_filters( 'force_filtered_html_on_import', false ) )
|
||||
kses_init_filters(); // Always filter imported data with kses on multisite.
|
||||
if ( is_multisite() )
|
||||
kses_init_filters(); // Always filter imported data with kses.
|
||||
|
||||
call_user_func($wp_importers[$importer][2]);
|
||||
|
||||
@@ -217,19 +200,6 @@ if ( isset($plugin_page) ) {
|
||||
exit();
|
||||
} else {
|
||||
do_action("load-$pagenow");
|
||||
// Backwards compatibility with old load-page-new.php, load-page.php,
|
||||
// and load-categories.php actions.
|
||||
if ( $typenow == 'page' ) {
|
||||
if ( $pagenow == 'post-new.php' )
|
||||
do_action( 'load-page-new.php' );
|
||||
elseif ( $pagenow == 'post.php' )
|
||||
do_action( 'load-page.php' );
|
||||
} elseif ( $pagenow == 'edit-tags.php' ) {
|
||||
if ( $taxnow == 'category' )
|
||||
do_action( 'load-categories.php' );
|
||||
elseif ( $taxnow == 'link_category' )
|
||||
do_action( 'load-edit-link-categories.php' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !empty($_REQUEST['action']) )
|
||||
|
||||
@@ -30,13 +30,6 @@ if ( !current_user_can('upload_files') )
|
||||
|
||||
// just fetch the detail form for that attachment
|
||||
if ( isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) {
|
||||
$post = get_post( $id );
|
||||
if ( 'attachment' != $post->post_type )
|
||||
wp_die( __( 'Unknown post type.' ) );
|
||||
$post_type_object = get_post_type_object( 'attachment' );
|
||||
if ( ! current_user_can( $post_type_object->cap->edit_post, $id ) )
|
||||
wp_die( __( 'You are not allowed to edit this item.' ) );
|
||||
|
||||
if ( 2 == $_REQUEST['fetch'] ) {
|
||||
add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
|
||||
echo get_media_item($id, array( 'send' => false, 'delete' => true ));
|
||||
|
||||
@@ -48,7 +48,7 @@ case 'editcomment' :
|
||||
add_contextual_help( $current_screen, '<p>' . __( 'You can edit the information left in a comment if needed. This is often useful when you notice that a commenter has made a typographical error.' ) . '</p>' .
|
||||
'<p>' . __( 'You can also moderate the comment from this screen using the Status box, where you can also change the timestamp of the comment.' ) . '</p>' .
|
||||
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Administration_Panels#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Administration_Panels#Comments" target="_blank">Comments Documentation</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank" >Support Forums</a>' ) . '</p>'
|
||||
);
|
||||
|
||||
@@ -60,8 +60,8 @@ case 'editcomment' :
|
||||
if ( !$comment = get_comment( $comment_id ) )
|
||||
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'javascript:history.go(-1)') );
|
||||
|
||||
if ( !current_user_can( 'edit_comment', $comment_id ) )
|
||||
comment_footer_die( __('You are not allowed to edit 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.') );
|
||||
|
||||
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.') );
|
||||
@@ -77,8 +77,6 @@ case 'approve' :
|
||||
case 'trash' :
|
||||
case 'spam' :
|
||||
|
||||
$title = __('Moderate Comment');
|
||||
|
||||
$comment_id = absint( $_GET['c'] );
|
||||
|
||||
if ( !$comment = get_comment_to_edit( $comment_id ) ) {
|
||||
@@ -86,7 +84,7 @@ case 'spam' :
|
||||
die();
|
||||
}
|
||||
|
||||
if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) {
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) {
|
||||
wp_redirect( admin_url('edit-comments.php?error=2') );
|
||||
die();
|
||||
}
|
||||
@@ -109,7 +107,7 @@ case 'spam' :
|
||||
<div class="narrow">
|
||||
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
<h2><?php esc_html_e( 'Moderate Comment' ); ?></h2>
|
||||
|
||||
<?php
|
||||
switch ( $action ) {
|
||||
@@ -180,12 +178,13 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
|
||||
<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"><?php submit_button( $button, 'button' ); ?></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>
|
||||
@@ -213,7 +212,7 @@ case 'unapprovecomment' :
|
||||
|
||||
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_comment', $comment->comment_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() && ! $noredir && false === strpos(wp_get_referer(), 'comment.php') )
|
||||
|
||||
@@ -1 +1 @@
|
||||
.bar{border-right-color:transparent;border-left-color:#99d;}.plugins .togl{border-right-color:transparent;border-left-color:#ccc;}.post-com-count{background-image:url(../images/bubble_bg-rtl.gif);}.tablenav .tablenav-pages a{background:#eee url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right -379px;}#upload-menu li.current{border-right-color:transparent;border-left-color:#448abd;}#adminmenu .wp-submenu .current a.current{background:transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) no-repeat scroll right -289px;}#adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;}.folded #adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;}#adminmenu li.wp-has-current-submenu .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right -207px;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark-rtl-vs.gif) top right no-repeat!important;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu .menu-top .current{background:url(../images/menu-bits-rtl-vs.gif?ver=20101117) top right repeat-x;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark-rtl-vs.gif) bottom right no-repeat!important;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) no-repeat right -207px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right -109px;}#adminmenu a.wp-has-submenu{background:#eff8ff url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right -379px;}#adminmenu .wp-submenu a{background:#fff url(../images/menu-bits-rtl-vs.gif?ver=20101117) no-repeat scroll right -99px;}#adminmenu li.wp-has-current-submenu a.wp-has-submenu{background:#b5b5b5 url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right top;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) no-repeat scroll right -111px;}#favorite-toggle{background:transparent url(../images/fav-arrow-rtl.gif?ver=20100531) no-repeat right -4px;}
|
||||
.bar{border-right-color:transparent;border-left-color:#99d;}.plugins .togl{border-right-color:transparent;border-left-color:#ccc;}.post-com-count{background-image:url(../images/bubble_bg-rtl.gif);}.tablenav .tablenav-pages a{background:#eee url('../images/menu-bits-rtl-vs.gif') repeat-x scroll right -379px;}#upload-menu li.current{border-right-color:transparent;border-left-color:#448abd;}#adminmenu .wp-submenu .current a.current{background:transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -289px;}#adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;}.folded #adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;}#adminmenu li.wp-has-current-submenu .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -207px;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark-rtl.gif) top right no-repeat!important;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu .menu-top .current{background:url(../images/menu-bits-rtl-vs.gif) top right repeat-x;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark-rtl.gif) bottom right no-repeat!important;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits-rtl-vs.gif) no-repeat right -207px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -109px;}#adminmenu a.wp-has-submenu{background:#f1f1f1 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -379px;}#adminmenu .wp-submenu a{background:#fff url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -310px;}#adminmenu li.wp-has-current-submenu a.wp-has-submenu{background:#b5b5b5 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right top;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -111px;}#favorite-toggle{background:transparent url(../images/fav-arrow-vs-rtl.gif?ver=20100531) no-repeat right -4px;}
|
||||
@@ -12,7 +12,7 @@
|
||||
background-image: url(../images/bubble_bg-rtl.gif);
|
||||
}
|
||||
.tablenav .tablenav-pages a {
|
||||
background: #eee url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right -379px;
|
||||
background: #eee url('../images/menu-bits-rtl-vs.gif') repeat-x scroll right -379px;
|
||||
}
|
||||
#upload-menu li.current {
|
||||
border-right-color: transparent;
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu .current a.current {
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) no-repeat scroll right -289px;
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -289px;
|
||||
}
|
||||
|
||||
#adminmenu li.wp-menu-separator {
|
||||
@@ -33,46 +33,47 @@
|
||||
|
||||
#adminmenu li.wp-has-current-submenu .wp-menu-toggle,
|
||||
#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right -207px;
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -207px;
|
||||
}
|
||||
|
||||
#adminmenu .wp-has-current-submenu ul li a.current {
|
||||
background: url(../images/menu-dark-rtl-vs.gif) top right no-repeat !important;
|
||||
background: url(../images/menu-dark-rtl.gif) top right no-repeat !important;
|
||||
}
|
||||
|
||||
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
|
||||
#adminmenu .menu-top .current {
|
||||
background: url(../images/menu-bits-rtl-vs.gif?ver=20101117) top right repeat-x;
|
||||
background: url(../images/menu-bits-rtl-vs.gif) top right repeat-x;
|
||||
}
|
||||
|
||||
#adminmenu li.wp-has-current-submenu ul li a {
|
||||
background: url(../images/menu-dark-rtl-vs.gif) bottom right no-repeat !important;
|
||||
background: url(../images/menu-dark-rtl.gif) bottom right no-repeat !important;
|
||||
}
|
||||
|
||||
#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) no-repeat right -207px;
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat right -207px;
|
||||
}
|
||||
|
||||
#adminmenu .wp-has-submenu:hover .wp-menu-toggle,
|
||||
#adminmenu .wp-menu-open .wp-menu-toggle {
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right -109px;
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -109px;
|
||||
}
|
||||
|
||||
#adminmenu a.wp-has-submenu {
|
||||
background: #eff8ff url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right -379px;
|
||||
background: #f1f1f1 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -379px;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu a {
|
||||
background: #fff url(../images/menu-bits-rtl-vs.gif?ver=20101117) no-repeat scroll right -99px;
|
||||
background: #fff url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -310px;
|
||||
}
|
||||
|
||||
#adminmenu li.wp-has-current-submenu a.wp-has-submenu {
|
||||
background: #b5b5b5 url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right top;
|
||||
background: #b5b5b5 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right top;
|
||||
}
|
||||
|
||||
.meta-box-sortables .postbox:hover .handlediv {
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) no-repeat scroll right -111px;
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -111px;
|
||||
}
|
||||
|
||||
#favorite-toggle {
|
||||
background: transparent url(../images/fav-arrow-rtl.gif?ver=20100531) no-repeat right -4px;
|
||||
}
|
||||
background: transparent url(../images/fav-arrow-vs-rtl.gif?ver=20100531) no-repeat right -4px;
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
html,
|
||||
.wp-dialog {
|
||||
html {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
@@ -111,16 +110,13 @@ div.dashboard-widget-submit {
|
||||
}
|
||||
|
||||
div.tabs-panel,
|
||||
.wp-tab-panel,
|
||||
ul.category-tabs li.tabs,
|
||||
ul.add-menu-item-tabs li.tabs,
|
||||
.wp-tab-active {
|
||||
ul.add-menu-item-tabs li.tabs {
|
||||
border-color: #dfdfdf;
|
||||
}
|
||||
|
||||
ul.category-tabs li.tabs,
|
||||
ul.add-menu-item-tabs li.tabs,
|
||||
.wp-tab-active {
|
||||
ul.add-menu-item-tabs li.tabs {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
@@ -207,13 +203,13 @@ strong .post-com-count span {
|
||||
border-top-color: #dfdfdf;
|
||||
}
|
||||
|
||||
div.error,
|
||||
.error,
|
||||
.login #login_error {
|
||||
background-color: #ffebe8;
|
||||
border-color: #c00;
|
||||
}
|
||||
|
||||
div.error a {
|
||||
.error a {
|
||||
color: #c00;
|
||||
}
|
||||
|
||||
@@ -232,7 +228,7 @@ div.error a {
|
||||
|
||||
.highlight {
|
||||
background-color: #e4f2fd;
|
||||
color: #000;
|
||||
color: #d54e21;
|
||||
}
|
||||
|
||||
.howto,
|
||||
@@ -386,8 +382,7 @@ div.dashboard-widget-submit input:hover,
|
||||
}
|
||||
|
||||
#side-sortables .category-tabs .tabs a,
|
||||
#side-sortables .add-menu-item-tabs .tabs a,
|
||||
.wp-tab-bar .wp-tab-active a {
|
||||
#side-sortables .add-menu-item-tabs .tabs a {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
@@ -438,7 +433,7 @@ div.dashboard-widget-submit input:hover,
|
||||
color: #d54e21;
|
||||
}
|
||||
|
||||
div.updated,
|
||||
.updated,
|
||||
.login .message {
|
||||
background-color: #ffffe0;
|
||||
border-color: #e6db55;
|
||||
@@ -457,7 +452,9 @@ a.page-numbers {
|
||||
}
|
||||
|
||||
.widefat td,
|
||||
.widefat th {
|
||||
.widefat th,
|
||||
#install-plugins .plugins td,
|
||||
#install-plugins .plugins th {
|
||||
border-color: #dfdfdf;
|
||||
}
|
||||
|
||||
@@ -475,10 +472,6 @@ h3.dashboard-widget-title small,
|
||||
background: #dfdfdf url(../images/gray-grad.png) repeat-x scroll left top;
|
||||
}
|
||||
|
||||
th.sortable a:hover, th.sortable a:active, th.sortable a:focus {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
h3.dashboard-widget-title small a {
|
||||
color: #d7d7d7;
|
||||
}
|
||||
@@ -499,6 +492,15 @@ a,
|
||||
color: #21759b;
|
||||
}
|
||||
|
||||
/* Because we don't want visited on these links */
|
||||
body.press-this .tabs a,
|
||||
body.press-this .tabs a:hover {
|
||||
background-color: #fff;
|
||||
border-color: #c6d9e9;
|
||||
border-bottom-color: #fff;
|
||||
color: #d54e21;
|
||||
}
|
||||
|
||||
#adminmenu #awaiting-mod,
|
||||
#adminmenu .update-plugins,
|
||||
#sidemenu a .update-plugins,
|
||||
@@ -554,8 +556,7 @@ input.readonly, textarea.readonly {
|
||||
|
||||
#edit-slug-box strong,
|
||||
.tablenav .displaying-num,
|
||||
#submitted-on,
|
||||
.submitted-on {
|
||||
#submitted-on {
|
||||
color: #777;
|
||||
}
|
||||
|
||||
@@ -723,6 +724,11 @@ table.widefat span.spam a,
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
|
||||
#user_info a:active,
|
||||
#footer a:active {
|
||||
color: #ccc !important;
|
||||
}
|
||||
|
||||
div#media-upload-error,
|
||||
.file-error,
|
||||
abbr.required,
|
||||
@@ -765,7 +771,6 @@ table.widefat .spam a:hover,
|
||||
#quicktags {
|
||||
border-color: #dfdfdf;
|
||||
background-color: #dfdfdf;
|
||||
background-image: url("../images/ed-bg.gif");
|
||||
}
|
||||
|
||||
#ed_toolbar input {
|
||||
@@ -827,7 +832,7 @@ table.widefat .spam a:hover,
|
||||
.wp_themeSkin a.mceButtonEnabled:hover,
|
||||
.wp_themeSkin a.mceButtonActive,
|
||||
.wp_themeSkin a.mceButtonSelected {
|
||||
background: #d5d5d5;
|
||||
background-color: #d5d5d5;
|
||||
border-color: #777 !important;
|
||||
}
|
||||
|
||||
@@ -1399,15 +1404,13 @@ fieldset.inline-edit-col-right .inline-edit-col {
|
||||
background: #eee url('../images/menu-bits.gif?ver=20100610') repeat-x scroll left -379px;
|
||||
}
|
||||
|
||||
.tablenav .tablenav-pages a:hover,
|
||||
.tablenav .tablenav-pages a:focus {
|
||||
.tablenav .tablenav-pages a:hover {
|
||||
color: #d54e21;
|
||||
border-color: #d54321;
|
||||
}
|
||||
|
||||
.tablenav .tablenav-pages a.disabled,
|
||||
.tablenav .tablenav-pages a.disabled:hover,
|
||||
.tablenav .tablenav-pages a.disabled:focus {
|
||||
color: #aaa;
|
||||
.tablenav .tablenav-pages a:active {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.tablenav .tablenav-pages .current {
|
||||
@@ -1460,8 +1463,7 @@ fieldset.inline-edit-col-right .inline-edit-col {
|
||||
}
|
||||
|
||||
#post-body ul.category-tabs li.tabs a,
|
||||
#post-body ul.add-menu-item-tabs li.tabs a,
|
||||
body.press-this ul.category-tabs li.tabs a {
|
||||
#post-body ul.add-menu-item-tabs li.tabs a {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
@@ -1509,9 +1511,9 @@ body.press-this ul.category-tabs li.tabs a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#screen-meta a.show-settings,
|
||||
.toggle-arrow {
|
||||
background-image:url("../images/screen-options-toggle.gif?ver=20100531");
|
||||
#screen-meta a.show-settings {
|
||||
background-color: transparent;
|
||||
text-shadow: rgba(255,255,255,0.7) 0 1px 0;
|
||||
}
|
||||
|
||||
#icon-edit,
|
||||
@@ -1573,7 +1575,7 @@ body.press-this ul.category-tabs li.tabs a {
|
||||
background: transparent url(../images/list.png) no-repeat 0 0;
|
||||
}
|
||||
|
||||
.view-switch .current #view-switch-list {
|
||||
.view-switch #view-switch-list.current {
|
||||
background: transparent url(../images/list.png) no-repeat -40px 0;
|
||||
}
|
||||
|
||||
@@ -1581,7 +1583,7 @@ body.press-this ul.category-tabs li.tabs a {
|
||||
background: transparent url(../images/list.png) no-repeat -20px 0;
|
||||
}
|
||||
|
||||
.view-switch .current #view-switch-excerpt {
|
||||
.view-switch #view-switch-excerpt.current {
|
||||
background: transparent url(../images/list.png) no-repeat -60px 0;
|
||||
}
|
||||
|
||||
@@ -1684,11 +1686,11 @@ div.widgets-sortables,
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
#nav-menu-header, #nav-menu-footer, .menu-item-handle {
|
||||
#nav-menu-header, .menu-item-handle {
|
||||
background: url("../images/gray-grad.png") repeat-x scroll left top #dfdfdf;
|
||||
}
|
||||
|
||||
#menu-management .nav-tab-active {
|
||||
background: #ececec;
|
||||
border-bottom-color: #ececec;
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
#dashboard-widgets-wrap .has-sidebar{margin-right:0;margin-left:-51%;}#dashboard-widgets-wrap .has-sidebar .has-sidebar-content{margin-right:0;margin-left:51%;}.view-all{right:auto;left:0;}#dashboard_right_now p.sub,#dashboard-widgets h4,#dashboard_quick_press h4,a.rsswidget,#dashboard_plugins h4,#dashboard_plugins h5,#dashboard_recent_comments .comment-meta .approve{font-family:Tahoma,Arial;}#dashboard_right_now p.sub{font-style:normal;left:auto;right:15px;}#dashboard_right_now td.b{padding-right:0;padding-left:6px;text-align:left;font-family:Tahoma,Arial;}#dashboard_right_now .t{padding-right:0;padding-left:12px;}#dashboard_right_now .table_content{float:right;}#dashboard_right_now .table_discussion{float:left;}#dashboard_right_now .versions a{font-family:Tahoma,Arial;}#dashboard_right_now a.button{float:left;clear:left;}#dashboard-widgets h3 .postbox-title-action{right:auto;left:30px;}#the-comment-list .pingback{padding-left:0!important;padding-right:9px!important;}#the-comment-list .comment-item{padding:1em 70px 1em 10px;}#the-comment-list .comment-item .avatar{float:right;margin-left:0;margin-right:-60px;}.rss-widget cite{text-align:left;}.rss-widget span.rss-date{font-family:Tahoma,Arial;margin-left:0;margin-right:3px;}#dashboard_quick_press h4{float:right;text-align:left;}#dashboard_quick_press h4 label{margin-right:0;margin-left:10px;}#dashboard_quick_press .input-text-wrap,#dashboard_quick_press .textarea-wrap{margin:0 5em 1em 0;}#dashboard_quick_press #media-buttons{margin:0 5em .5em 0;padding:0 10px 0 0;}#dashboard-widgets #dashboard_quick_press form p.submit{margin-left:0;margin-right:4.6em;}#dashboard-widgets #dashboard_quick_press form p.submit input{float:right;}#dashboard-widgets #dashboard_quick_press form p.submit #save-post{margin:0 10px 0 1em;}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:left;}#dashboard-widgets #dashboard_quick_press form p.submit img.waiting{margin:4px 0 0 6px;}#dashboard_recent_drafts h4 abbr{font-family:Tahoma,Arial;margin-left:0;margin-right:3px;}
|
||||
#dashboard-widgets-wrap .has-sidebar{margin-right:0;margin-left:-51%;}#dashboard-widgets-wrap .has-sidebar .has-sidebar-content{margin-right:0;margin-left:51%;}.view-all{right:auto;left:0;}#dashboard_right_now p.sub,#dashboard-widgets h4,#dashboard_quick_press h4,a.rsswidget,#dashboard_plugins h4,#dashboard_plugins h5,#dashboard_recent_comments .comment-meta .approve{font-family:Tahoma,Arial;}#dashboard_right_now p.sub{font-style:normal;left:auto;right:15px;}#dashboard_right_now td.b{padding-right:0;padding-left:6px;text-align:left;font-family:Tahoma,Arial;}#dashboard_right_now .t{padding-right:0;padding-left:12px;}#dashboard_right_now .table_content{float:right;}#dashboard_right_now .table_discussion{float:left;}#dashboard_right_now .versions{clear:right;}#dashboard_right_now .versions a{font-family:Tahoma,Arial;}#dashboard_right_now a.button{float:left;clear:left;}#dashboard-widgets h3 .postbox-title-action{right:auto;left:30px;}#the-comment-list .pingback{padding-left:0!important;padding-right:9px!important;}#the-comment-list .comment-item{padding:1em 70px 1em 10px;}#the-comment-list .comment-item .avatar{float:right;margin-left:0;margin-right:-60px;}.rss-widget cite{text-align:left;}.rss-widget span.rss-date{font-family:Tahoma,Arial;margin-left:0;margin-right:3px;}#dashboard_quick_press h4{float:right;text-align:left;}#dashboard_quick_press h4 label{margin-right:0;margin-left:10px;}#dashboard_quick_press .input-text-wrap,#dashboard_quick_press .textarea-wrap{margin:0 5em 1em 0;}#dashboard_quick_press #media-buttons{margin:0 5em .5em 0;padding:0 10px 0 0;}#dashboard-widgets #dashboard_quick_press form p.submit{margin-left:0;margin-right:4.6em;}#dashboard-widgets #dashboard_quick_press form p.submit input{float:right;}#dashboard-widgets #dashboard_quick_press form p.submit #save-post{margin:0 10px 0 1em;}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:left;}#dashboard-widgets #dashboard_quick_press form p.submit img.waiting{margin:4px 0 0 6px;}#dashboard_recent_drafts h4 abbr{font-family:Tahoma,Arial;margin-left:0;margin-right:3px;}
|
||||
@@ -34,6 +34,9 @@
|
||||
#dashboard_right_now .table_discussion {
|
||||
float:left;
|
||||
}
|
||||
#dashboard_right_now .versions {
|
||||
clear:right;
|
||||
}
|
||||
#dashboard_right_now .versions a {
|
||||
font-family: Tahoma, Arial;
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ div.postbox div.inside {
|
||||
|
||||
#dashboard_right_now .versions {
|
||||
padding: 6px 10px 12px;
|
||||
clear: both;
|
||||
clear: left;
|
||||
}
|
||||
|
||||
#dashboard_right_now .versions .b {
|
||||
@@ -277,14 +277,6 @@ div.postbox div.inside {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#dashboard_quick_press {
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
#dashboard_quick_press.closed {
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
#dashboard_quick_press .input-text-wrap,
|
||||
#dashboard_quick_press .textarea-wrap {
|
||||
margin: 0 0 1em 5em;
|
||||
|
||||
@@ -393,31 +393,6 @@ ol.ol-decimal > li {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.widefat thead th:first-of-type {
|
||||
-moz-border-radius-topleft: 3px;
|
||||
-khtml-border-top-left-radius: 3px;
|
||||
-webkit-border-top-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
}
|
||||
.widefat thead th:last-of-type {
|
||||
-moz-border-radius-topright: 3px;
|
||||
-khtml-border-top-right-radius: 3px;
|
||||
-webkit-border-top-right-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
}
|
||||
.widefat tfoot th:first-of-type {
|
||||
-moz-border-radius-bottomleft: 3px;
|
||||
-khtml-border-bottom-left-radius: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
}
|
||||
.widefat tfoot th:last-of-type {
|
||||
-moz-border-radius-bottomright: 3px;
|
||||
-khtml-border-bottom-right-radius: 3px;
|
||||
-webkit-border-bottom-right-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
}
|
||||
|
||||
.widefat td,
|
||||
.widefat th {
|
||||
border-bottom-width: 1px;
|
||||
@@ -425,10 +400,6 @@ ol.ol-decimal > li {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.widefat .no-items td {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
.widefat td {
|
||||
padding: 3px 7px;
|
||||
vertical-align: top;
|
||||
@@ -478,8 +449,8 @@ ol.ol-decimal > li {
|
||||
margin: 0 15px 0 5px;
|
||||
}
|
||||
|
||||
div.updated,
|
||||
div.error {
|
||||
.updated,
|
||||
.error {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 0 0.6em;
|
||||
@@ -490,14 +461,15 @@ div.error {
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
div.updated p,
|
||||
div.error p {
|
||||
.updated p,
|
||||
.error p {
|
||||
margin: 0.5em 0;
|
||||
line-height: 1;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.wrap div.updated,
|
||||
.wrap div.error {
|
||||
.wrap .updated,
|
||||
.wrap .error {
|
||||
margin: 5px 0 15px;
|
||||
}
|
||||
|
||||
|
||||
@@ -422,8 +422,7 @@ table.ie-fixed {
|
||||
background: #298CBA;
|
||||
}
|
||||
|
||||
#wpcontent #ajax-loading,
|
||||
#wpcontent .ajax-loading {
|
||||
#wpcontent #ajax-loading {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
html{background:#f9f9f9;}body{background:#fff;color:#333;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;margin:2em 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,dd,dt{padding-bottom:2px;font-size:12px;line-height:18px;}code,.code{font-size:13px;}ul,ol,dl{padding:5px 5px 5px 22px;}a img{border:0;}abbr{border:0;font-variant:normal;}#logo{margin:6px 0 14px 0;border-bottom:none;text-align:center;}.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;}textarea{border:1px solid #bbb;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.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:130px;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;}.form-table th p{font-weight:normal;}#error-page{margin-top:50px;}#error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}#error-page code,.code{font-family:Consolas,Monaco,Courier,monospace;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;border-style:solid;border-width:1px;margin:5px 5px 5px 1px;padding:5px;text-align:center;width:200px;display:none;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}.message{border:1px solid #e6db55;padding:.3em .6em;margin:5px 0 15px;background-color:#ffffe0;}
|
||||
html{background:#f9f9f9;}body{background:#fff;color:#333;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;margin:2em 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,dd,dt{padding-bottom:2px;font-size:12px;line-height:18px;}code,.code{font-size:13px;}ul,ol,dl{padding:5px 5px 5px 22px;}a img{border:0;}abbr{border:0;font-variant:normal;}#logo{margin:6px 0 14px 0;border-bottom:none;text-align:center;}.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;}textarea{border:1px solid #bbb;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.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:130px;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;}.form-table th p{font-weight:normal;}#error-page{margin-top:50px;}#error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}#error-page code,.code{font-family:Consolas,Monaco,Courier,monospace;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;border-style:solid;border-width:1px;margin:5px 5px 5px 1px;padding:5px;text-align:center;width:200px;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}.message{border:1px solid #e6db55;padding:.3em .6em;margin:5px 0 15px;background-color:#ffffe0;}
|
||||
@@ -182,7 +182,6 @@ textarea {
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
width: 200px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#pass-strength-result.bad {
|
||||
|
||||
@@ -1 +1 @@
|
||||
*{margin:0;padding:0;}body{padding-top:30px;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:11px;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{position:absolute;top:0;left:0;border-bottom:#c6c6c6 1px solid;background:#d9d9d9;background:-moz-linear-gradient(bottom,#d7d7d7,#e4e4e4);background:-webkit-gradient(linear,left bottom,left top,from(#d7d7d7),to(#e4e4e4));height:30px;width:100%;}#backtoblog a{text-decoration:none;display:block;padding:8px 0 0 15px;}#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;}body form .input{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;}#pass-strength-result{font-weight:bold;border-style:solid;border-width:1px;margin:12px 0 6px;padding:6px 5px;text-align:center;}
|
||||
*{margin:0;padding:0;}body{padding-top:30px;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{position:absolute;top:0;left:0;border-bottom:#c6c6c6 1px solid;background:#d9d9d9;background:-moz-linear-gradient(bottom,#d7d7d7,#e4e4e4);background:-webkit-gradient(linear,left bottom,left top,from(#d7d7d7),to(#e4e4e4));height:30px;width:100%;}#backtoblog a{text-decoration:none;display:block;padding:8px 0 0 15px;}#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;}
|
||||
@@ -12,7 +12,7 @@ form {
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 11px;
|
||||
border-radius: 5px;
|
||||
background: #fff;
|
||||
border: 1px solid #e5e5e5;
|
||||
-moz-box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
@@ -117,7 +117,9 @@ h1 a {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
body form .input {
|
||||
#user_pass,
|
||||
#user_login,
|
||||
#user_email {
|
||||
font-size: 24px;
|
||||
width: 97%;
|
||||
padding: 3px;
|
||||
@@ -135,13 +137,3 @@ input {
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#pass-strength-result {
|
||||
font-weight: bold;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 12px 0 6px;
|
||||
padding: 6px 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
div#media-upload-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;}body#media-upload ul#sidemenu{font-weight:normal;margin:0 5px;left:0;bottom:-1px;float:none;overflow:hidden;}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",Verdana,Arial,"Bitstream Vera Sans",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",Verdana,Arial,"Bitstream Vera Sans",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{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;}body#media-upload ul#sidemenu{font-weight:normal;margin:0 5px;left:0;bottom:-1px;float:none;overflow:hidden;}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{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;}
|
||||
@@ -34,7 +34,7 @@ th {
|
||||
}
|
||||
|
||||
.media-upload-form label.form-help, td.help {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
@@ -153,7 +153,7 @@ abbr.required {
|
||||
|
||||
#media-upload p.help,
|
||||
#media-upload label.help {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
#dashboard_right_now p.musub{margin-top:12px;border-top:1px solid #ececec;padding-left:16px;position:static;}#dashboard_right_now td.b a.musublink{font-size:16px;}#dashboard_right_now div.musubtable{border-top:none;}#dashboard_right_now div.musubtable .t{white-space:normal;}.site-deleted{background:#ff8573;}.site-spammed{background:#faafaa;}.site-archived{background:#ffebe8;}.site-mature{background:#fecac2;}
|
||||
#dashboard_right_now p.musub{margin-top:12px;border-top:1px solid #ececec;padding-left:16px;position:static;}#dashboard_right_now td.b a.musublink{font-size:16px;}#dashboard_right_now div.musubtable{border-top:none;}#dashboard_right_now div.musubtable .t{white-space:normal;}.ms-sites-php .postbox h3{cursor:auto;}.ms-sites-php .postbox .description{margin:10px 0 0;padding:0 10px 10px;border-bottom:1px solid #DFDFDF;}tr.site-deleted{background:#ff8573;}tr.site-spammed{background:#faa;}tr.site-archived{background:#ffebe8;}tr.site-mature{background:#fecac2;}
|
||||
@@ -18,16 +18,27 @@
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
/* No drag and drop on ms-sites.php */
|
||||
.ms-sites-php .postbox h3 {
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.ms-sites-php .postbox .description {
|
||||
margin:10px 0 0px;
|
||||
padding:0px 10px 10px;
|
||||
border-bottom:1px solid #DFDFDF;
|
||||
}
|
||||
|
||||
/* Background Color for Site Status */
|
||||
.site-deleted {
|
||||
tr.site-deleted {
|
||||
background: #ff8573;
|
||||
}
|
||||
.site-spammed {
|
||||
background: #faafaa;
|
||||
tr.site-spammed {
|
||||
background: #faa;
|
||||
}
|
||||
.site-archived {
|
||||
background: #ffebe8;
|
||||
tr.site-archived {
|
||||
background:#ffebe8;
|
||||
}
|
||||
.site-mature {
|
||||
tr.site-mature {
|
||||
background: #fecac2;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ body {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#nav-menu-header, #post-body, #nav-menu-footer {
|
||||
#nav-menu-header, #post-body {
|
||||
border-color: #ccc;
|
||||
border-style: solid;
|
||||
}
|
||||
@@ -81,7 +81,15 @@ body {
|
||||
#post-body {
|
||||
background: #fff;
|
||||
padding: 10px;
|
||||
border-width: 0 1px;
|
||||
border-width: 0 1px 1px 1px;
|
||||
-moz-border-radius-bottomleft: 6px;
|
||||
-webkit-border-bottom-left-radius: 6px;
|
||||
-khtml-border-bottom-left-radius: 6px;
|
||||
border-bottom-left-radius: 6px;
|
||||
-moz-border-radius-bottomright: 6px;
|
||||
-webkit-border-bottom-right-radius: 6px;
|
||||
-khtml-border-bottom-right-radius: 6px;
|
||||
border-bottom-right-radius: 6px;
|
||||
}
|
||||
|
||||
#post-body div.updated {
|
||||
@@ -96,18 +104,6 @@ body {
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
#nav-menu-footer {
|
||||
border-width: 0 1px 1px 1px;
|
||||
-moz-border-radius-bottomleft: 6px;
|
||||
-webkit-border-bottom-left-radius: 6px;
|
||||
-khtml-border-bottom-left-radius: 6px;
|
||||
border-bottom-left-radius: 6px;
|
||||
-moz-border-radius-bottomright: 6px;
|
||||
-webkit-border-bottom-right-radius: 6px;
|
||||
-khtml-border-bottom-right-radius: 6px;
|
||||
border-bottom-right-radius: 6px;
|
||||
}
|
||||
|
||||
/* Menu Tabs */
|
||||
|
||||
#menu-management .nav-tabs-nav {
|
||||
|
||||
@@ -1 +1 @@
|
||||
div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.action-links{font-weight:normal;margin:6px 0 0;}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;}
|
||||
div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.action-links{font-weight:normal;margin:6px 0 0;}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;}table#install-plugins th.num{white-space:nowrap;}#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;}
|
||||
@@ -42,6 +42,11 @@ div.star img {
|
||||
border-right: 1px solid #fff;
|
||||
}
|
||||
|
||||
/* Table layout CSS */
|
||||
table#install-plugins th.num {
|
||||
white-space: nowrap; /* Prevents long plugin titles from causing the version column to wrap */
|
||||
}
|
||||
|
||||
/* Header on thickbox */
|
||||
#plugin-information-header {
|
||||
margin: 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
body {
|
||||
font: 13px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
font: 13px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
|
||||
color: #333;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
@@ -147,7 +147,7 @@ h3.tb {
|
||||
|
||||
.postbox:hover .handlediv,
|
||||
.stuffbox:hover .handlediv {
|
||||
background: transparent url(../images/menu-bits.gif) no-repeat scroll left -111px;
|
||||
background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;
|
||||
}
|
||||
|
||||
.handlediv {
|
||||
@@ -312,7 +312,7 @@ h3.tb {
|
||||
|
||||
.category-add input {
|
||||
width: 94%;
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
|
||||
font-size: 12px;
|
||||
margin: 1px;
|
||||
}
|
||||
@@ -322,7 +322,7 @@ h3.tb {
|
||||
-x-system-font: none;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
font-family: "Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;
|
||||
font-size: 11px;
|
||||
height: 2em;
|
||||
line-height: 20px;
|
||||
@@ -475,7 +475,7 @@ ul.category-tabs li {
|
||||
.button-secondary,
|
||||
.button-highlighted,
|
||||
#postcustomstuff .submit input {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
|
||||
text-decoration: none;
|
||||
font-size: 11px !important;
|
||||
line-height: 16px;
|
||||
|
||||
@@ -1 +1 @@
|
||||
.alignleft h3{margin:0;}h3 span{font-weight:normal;}#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;}#templateside ul li a span.highlight{display:block;}.nonessential{font-size:11px;font-style:italic;padding-left:12px;}.highlight{padding:3px 3px 3px 12px;margin-left:-12px;font-weight:bold;-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;}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;}#templateside ul li a span.highlight{display:block;}.nonessential{font-size:11px;font-style:italic;padding-left:12px;}.highlight{padding:3px 3px 3px 12px;margin-left:-12px;font-weight:bold;-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;}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,11 +1,3 @@
|
||||
.alignleft h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
h3 span {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#template textarea {
|
||||
font-family: Consolas, Monaco, Courier, monospace;
|
||||
font-size: 12px;
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
div.star{left:auto;right:0;}.star img,div.star a,div.star a:hover,div.star a:visited{right:auto;left:0;}.theme-listing .theme-item h3{font-style:normal;}#theme-information .theme-preview-img{float:right;margin:5px 15px 10px 25px;}#theme-information .action-button #cancel{float:right;}#theme-information .action-button #install{float:left;}.feature-filter .feature-group{float:right;}.feature-filter .feature-name{float:right;text-align:left;}.feature-filter .feature-group li{float:right;padding-right:0;padding-left:25px;}
|
||||
@@ -1,41 +0,0 @@
|
||||
div.star {
|
||||
left:auto;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.star img, div.star a, div.star a:hover, div.star a:visited {
|
||||
right: auto;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.theme-listing .theme-item h3 {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
#theme-information .theme-preview-img {
|
||||
float: right;
|
||||
margin: 5px 15px 10px 25px;
|
||||
}
|
||||
|
||||
#theme-information .action-button #cancel {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#theme-information .action-button #install {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.feature-filter .feature-group {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.feature-filter .feature-name {
|
||||
float: right;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.feature-filter .feature-group li {
|
||||
float: right;
|
||||
padding-right: 0;
|
||||
padding-left: 25px;
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
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 0;}#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:725px;}.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;}.feature-container{width:100%;overflow:auto;margin-bottom:10px;}.feature-group{margin-bottom:0!important;}
|
||||
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 0;}#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;}
|
||||
@@ -127,7 +127,7 @@ body#theme-information {
|
||||
.feature-filter .feature-group {
|
||||
float: left;
|
||||
margin-bottom: 20px;
|
||||
width: 725px;
|
||||
width: 695px;
|
||||
}
|
||||
|
||||
.feature-filter .feature-name {
|
||||
@@ -143,13 +143,3 @@ body#theme-information {
|
||||
padding-right: 25px;
|
||||
min-width: 145px;
|
||||
}
|
||||
|
||||
.feature-container {
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.feature-group {
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
#widget-list .widget,#wp_inactive_widgets .widget{float:right;}ul#widget-list li.widget-list-item div.widget-description{margin:0 200px 0 0;padding:0 4em 0 0;}.widget-control-save,.widget-control-remove{margin-right:0;margin-left:8px;float:right;}
|
||||
ul#widget-list li.widget-list-item div.widget-description{margin:0 200px 0 0;padding:0 4em 0 0;}.widget-control-save,.widget-control-remove{margin-right:0;margin-left:8px;float:right;}
|
||||
@@ -1,7 +1,3 @@
|
||||
#widget-list .widget,
|
||||
#wp_inactive_widgets .widget {
|
||||
float: right;
|
||||
}
|
||||
ul#widget-list li.widget-list-item div.widget-description {
|
||||
margin: 0 200px 0 0;
|
||||
padding: 0 4em 0 0;
|
||||
|
||||
@@ -13,19 +13,9 @@ td.available-theme {
|
||||
}
|
||||
/* 200 - 500
|
||||
=================================== */
|
||||
#doaction,
|
||||
#doaction2,
|
||||
#post-query-submit {
|
||||
margin-right: 0;
|
||||
margin-left: 8px;
|
||||
}
|
||||
#save-post {
|
||||
float: right;
|
||||
}
|
||||
#minor-publishing .ajax-loading {
|
||||
padding: 3px 4px 0 0;
|
||||
float: right;
|
||||
}
|
||||
.preview {
|
||||
float: left;
|
||||
}
|
||||
@@ -78,13 +68,6 @@ td.available-theme {
|
||||
* html #template div {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.list-ajax-loading {
|
||||
float: left;
|
||||
margin-right: 0;
|
||||
margin-left: 9px;
|
||||
}
|
||||
|
||||
#your-profile legend {
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
}
|
||||
@@ -102,12 +85,7 @@ td.available-theme {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.tablenav a.button-secondary {
|
||||
margin-right: 0;
|
||||
margin-left: 8px;
|
||||
}
|
||||
.tablenav .actions {
|
||||
padding-right: 0;
|
||||
padding-left: 8px;
|
||||
margin: 8px 0 0 8px;
|
||||
}
|
||||
.tablenav .tablenav-pages {
|
||||
float: left;
|
||||
@@ -116,7 +94,6 @@ td.available-theme {
|
||||
margin-right: 0;
|
||||
margin-left: 10px;
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
font-style: normal;
|
||||
}
|
||||
#postcustomstuff table input,
|
||||
#postcustomstuff table select,
|
||||
@@ -268,18 +245,6 @@ td.available-theme {
|
||||
.description, .form-wrap p {
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
}
|
||||
.sorting-indicator {
|
||||
margin-left: 0;
|
||||
margin-right: 7px;
|
||||
}
|
||||
th.sortable a span,
|
||||
th.sorted a span {
|
||||
float: right;
|
||||
}
|
||||
.fixed .column-comments a {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* 1500 - 1800
|
||||
=================================== */
|
||||
.autosave-info {
|
||||
@@ -454,13 +419,9 @@ td.action-links, th.action-links {
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
margin: 0 0 0 6px;
|
||||
}
|
||||
#contextual-help-wrap li {
|
||||
margin-left: 0;
|
||||
margin-right: 18px;
|
||||
}
|
||||
#screen-meta a.show-settings {
|
||||
padding: 0 6px 0 16px;
|
||||
background-position: left top;
|
||||
background-position: left bottom;
|
||||
}
|
||||
.metabox-prefs label {
|
||||
padding-right: 0;
|
||||
@@ -478,13 +439,6 @@ td.action-links, th.action-links {
|
||||
.inline-edit-save img.waiting {
|
||||
float: left;
|
||||
}
|
||||
.trash-undo-inside,
|
||||
.spam-undo-inside,
|
||||
.spam-undo-inside .avatar,
|
||||
.trash-undo-inside .avatar {
|
||||
margin-right: 0;
|
||||
margin-left: 8px;
|
||||
}
|
||||
/* 2500 - 2700
|
||||
=================================== */
|
||||
#bulk-titles div a {
|
||||
@@ -632,14 +586,6 @@ ol {
|
||||
padding: 0 5px 0 0 ;
|
||||
}
|
||||
|
||||
.media-item .error-div a.dismiss,
|
||||
.describe-toggle-on,
|
||||
.describe-toggle-off {
|
||||
float: left;
|
||||
margin-right: 0;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.describe-toggle-on,
|
||||
.describe-toggle-off {
|
||||
float: left;
|
||||
@@ -647,11 +593,6 @@ ol {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.media-item .error-div {
|
||||
padding-left: 0;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.media-item .pinkynail {
|
||||
float: right;
|
||||
}
|
||||
@@ -662,6 +603,15 @@ ol {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
button.dismiss {
|
||||
right: auto;
|
||||
left: 5px;
|
||||
}
|
||||
|
||||
.file-error {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.bar {
|
||||
border-left-width: 3px;
|
||||
border-left-style: solid;
|
||||
@@ -699,18 +649,12 @@ ol {
|
||||
}
|
||||
|
||||
/* Custom Header */
|
||||
.appearance_page_custom-header #available-headers .default-header {
|
||||
float: right;
|
||||
margin: 0 0 20px 20px;
|
||||
table#available-headers td {
|
||||
padding: 0 0 10px 20px;
|
||||
}
|
||||
.appearance_page_custom-header #available-headers label input {
|
||||
table#available-headers label input {
|
||||
margin-right: 0;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#custom-background label {
|
||||
padding-right: 0;
|
||||
padding-left: 15px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
/* ltr
|
||||
|
||||
@@ -19,7 +19,7 @@ class Custom_Background {
|
||||
* Callback for administration header.
|
||||
*
|
||||
* @var callback
|
||||
* @since 3.0.0
|
||||
* @since unknown
|
||||
* @access private
|
||||
*/
|
||||
var $admin_header_callback;
|
||||
@@ -210,7 +210,7 @@ if ( get_background_image() ) {
|
||||
<td>
|
||||
<form method="post" action="">
|
||||
<?php wp_nonce_field('custom-background-remove', '_wpnonce-custom-background-remove'); ?>
|
||||
<?php submit_button( __( 'Remove Background Image' ), 'button', 'remove-background', false ); ?><br/>
|
||||
<input type="submit" class="button" name="remove-background" value="<?php esc_attr_e('Remove Background Image'); ?>" /><br/>
|
||||
<?php _e('This will remove the background image. You will not be able to restore any customizations.') ?>
|
||||
</form>
|
||||
</td>
|
||||
@@ -223,7 +223,7 @@ if ( get_background_image() ) {
|
||||
<td>
|
||||
<form method="post" action="">
|
||||
<?php wp_nonce_field('custom-background-reset', '_wpnonce-custom-background-reset'); ?>
|
||||
<?php submit_button( __( 'Restore Original Image' ), 'button', 'reset-background', false ); ?><br/>
|
||||
<input type="submit" class="button" name="reset-background" value="<?php esc_attr_e('Restore Original Image'); ?>" /><br/>
|
||||
<?php _e('This will restore the original background image. You will not be able to restore any customizations.') ?>
|
||||
</form>
|
||||
</td>
|
||||
@@ -236,7 +236,7 @@ if ( get_background_image() ) {
|
||||
<label for="upload"><?php _e('Choose an image from your computer:'); ?></label><br /><input type="file" id="upload" name="import" />
|
||||
<input type="hidden" name="action" value="save" />
|
||||
<?php wp_nonce_field('custom-background-upload', '_wpnonce-custom-background-upload') ?>
|
||||
<?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
|
||||
<input type="submit" class="button" value="<?php esc_attr_e('Upload'); ?>" />
|
||||
</p>
|
||||
</form>
|
||||
</td>
|
||||
@@ -303,7 +303,7 @@ if ( get_background_image() ) {
|
||||
</table>
|
||||
|
||||
<?php wp_nonce_field('custom-background'); ?>
|
||||
<?php submit_button( null, 'primary', 'save-background-options' ); ?>
|
||||
<p class="submit"><input type="submit" class="button-primary" name="save-background-options" value="<?php esc_attr_e('Save Changes'); ?>" /></p>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
@@ -311,7 +311,7 @@ if ( get_background_image() ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an Image upload for the background image.
|
||||
* Handle a Image upload for the background image.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
@@ -456,7 +456,7 @@ class Custom_Image_Header {
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ( current_theme_supports( 'custom-header-uploads' ) ) : ?>
|
||||
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e( 'Upload Image' ); ?></th>
|
||||
<td>
|
||||
@@ -468,12 +468,11 @@ class Custom_Image_Header {
|
||||
<input type="file" id="upload" name="import" />
|
||||
<input type="hidden" name="action" value="save" />
|
||||
<?php wp_nonce_field( 'custom-header-upload', '_wpnonce-custom-header-upload' ) ?>
|
||||
<?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
|
||||
<input type="submit" class="button" value="<?php esc_attr_e( 'Upload' ); ?>" />
|
||||
</p>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -484,11 +483,7 @@ class Custom_Image_Header {
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e( 'Default Images' ); ?></th>
|
||||
<td>
|
||||
<?php if ( current_theme_supports( 'custom-header-uploads' ) ) : ?>
|
||||
<p><?php _e( 'If you don‘t want to upload your own image, you can use one of these cool headers.' ) ?></p>
|
||||
<?php else: ?>
|
||||
<p><?php _e( 'You can use one of these cool headers.' ) ?>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
$this->show_default_header_selector();
|
||||
?>
|
||||
@@ -501,7 +496,7 @@ class Custom_Image_Header {
|
||||
<th scope="row"><?php _e( 'Remove Image' ); ?></th>
|
||||
<td>
|
||||
<p><?php _e( 'This will remove the header image. You will not be able to restore any customizations.' ) ?></p>
|
||||
<?php submit_button( __( 'Remove Header Image' ), 'button', 'removeheader', false ); ?>
|
||||
<input type="submit" class="button" name="removeheader" value="<?php esc_attr_e( 'Remove Header Image' ); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;
|
||||
@@ -511,7 +506,7 @@ class Custom_Image_Header {
|
||||
<th scope="row"><?php _e( 'Reset Image' ); ?></th>
|
||||
<td>
|
||||
<p><?php _e( 'This will restore the original header image. You will not be able to restore any customizations.' ) ?></p>
|
||||
<?php submit_button( __( 'Restore Original Header Image' ), 'button', 'resetheader', false ); ?>
|
||||
<input type="submit" class="button" name="resetheader" value="<?php esc_attr_e( 'Restore Original Header Image' ); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
@@ -550,7 +545,7 @@ class Custom_Image_Header {
|
||||
<th scope="row"><?php _e('Reset Text Color'); ?></th>
|
||||
<td>
|
||||
<p><?php _e( 'This will restore the original header text. You will not be able to restore any customizations.' ) ?></p>
|
||||
<?php submit_button( __( 'Restore Original Header Text' ), 'button', 'resettext', false ); ?>
|
||||
<input type="submit" class="button" name="resettext" value="<?php esc_attr_e( 'Restore Original Header Text' ); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@@ -559,11 +554,8 @@ class Custom_Image_Header {
|
||||
</table>
|
||||
<?php endif;
|
||||
|
||||
do_action( 'custom_header_options' );
|
||||
|
||||
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
|
||||
|
||||
<?php submit_button( null, 'primary', 'save-header-options' ); ?>
|
||||
<p class="submit"><input type="submit" class="button-primary" name="save-header-options" value="<?php esc_attr_e( 'Save Changes' ); ?>" /></p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -576,9 +568,6 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
|
||||
*/
|
||||
function step_2() {
|
||||
check_admin_referer('custom-header-upload', '_wpnonce-custom-header-upload');
|
||||
if ( ! current_theme_supports( 'custom-header-uploads' ) )
|
||||
wp_die( 'Cheatin’ uh?' );
|
||||
|
||||
$overrides = array('test_form' => false);
|
||||
$file = wp_handle_upload($_FILES['import'], $overrides);
|
||||
|
||||
@@ -637,6 +626,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
|
||||
<img src="<?php echo esc_url( $url ); ?>" id="upload" width="<?php echo $width; ?>" height="<?php echo $height; ?>" />
|
||||
</div>
|
||||
|
||||
<p class="submit">
|
||||
<input type="hidden" name="x1" id="x1" value="0"/>
|
||||
<input type="hidden" name="y1" id="y1" value="0"/>
|
||||
<input type="hidden" name="width" id="width" value="<?php echo esc_attr( $width ); ?>"/>
|
||||
@@ -644,8 +634,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
|
||||
<input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo esc_attr( $id ); ?>" />
|
||||
<input type="hidden" name="oitar" id="oitar" value="<?php echo esc_attr( $oitar ); ?>" />
|
||||
<?php wp_nonce_field( 'custom-header-crop-image' ) ?>
|
||||
|
||||
<?php submit_button( __( 'Crop and Publish' ) ); ?>
|
||||
<input type="submit" class="button-primary" value="<?php esc_attr_e( 'Crop and Publish' ); ?>" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
@@ -659,9 +648,6 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
|
||||
*/
|
||||
function step_3() {
|
||||
check_admin_referer('custom-header-crop-image');
|
||||
if ( ! current_theme_supports( 'custom-header-uploads' ) )
|
||||
wp_die( 'Cheatin’ uh?' );
|
||||
|
||||
if ( $_POST['oitar'] > 1 ) {
|
||||
$_POST['x1'] = $_POST['x1'] * $_POST['oitar'];
|
||||
$_POST['y1'] = $_POST['y1'] * $_POST['oitar'];
|
||||
|
||||
239
wp-admin/edit-attachment-rows.php
Normal file
@@ -0,0 +1,239 @@
|
||||
<?php
|
||||
/**
|
||||
* Edit attachments table for inclusion in administration panels.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
|
||||
if ( have_posts() ) { ?>
|
||||
<table class="widefat fixed" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php print_column_headers('upload'); ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<?php print_column_headers('upload', false); ?>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody id="the-list" class="list:post">
|
||||
<?php
|
||||
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;
|
||||
|
||||
$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">
|
||||
|
||||
<?php
|
||||
foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
$class = "class=\"$column_name column-$column_name\"";
|
||||
|
||||
$style = '';
|
||||
if ( in_array($column_name, $hidden) )
|
||||
$style = ' style="display:none;"';
|
||||
|
||||
$attributes = "$class$style";
|
||||
|
||||
switch($column_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>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'icon':
|
||||
$attributes = 'class="column-icon media-icon"' . $style;
|
||||
?>
|
||||
<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="<?php echo get_edit_post_link( $post->ID, true ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>">
|
||||
<?php echo $thumb; ?>
|
||||
</a>
|
||||
|
||||
<?php }
|
||||
}
|
||||
?></td>
|
||||
<?php
|
||||
// TODO
|
||||
break;
|
||||
|
||||
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, true ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $att_title; ?></a><?php } ?></strong>
|
||||
<p>
|
||||
<?php
|
||||
if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) )
|
||||
echo esc_html( strtoupper( $matches[1] ) );
|
||||
else
|
||||
echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) );
|
||||
?>
|
||||
</p>
|
||||
<?php
|
||||
$actions = array();
|
||||
if ( current_user_can('edit_post', $post->ID) && !$is_trash )
|
||||
$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-attachment_' . $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-attachment_' . $post->ID) . "'>" . __('Trash') . "</a>";
|
||||
if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) {
|
||||
$delete_ays = (!$is_trash && !MEDIA_TRASH) ? " onclick='return showNotice.warn();'" : '';
|
||||
$actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-attachment_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
|
||||
}
|
||||
}
|
||||
if ( !$is_trash ) {
|
||||
$title =_draft_or_post_title($post->post_parent);
|
||||
$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 );
|
||||
$action_count = count($actions);
|
||||
$i = 0;
|
||||
echo '<div class="row-actions">';
|
||||
foreach ( $actions as $action => $link ) {
|
||||
++$i;
|
||||
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
|
||||
echo "<span class='$action'>$link$sep</span>";
|
||||
}
|
||||
echo '</div>';
|
||||
?></td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'author':
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php the_author() ?></td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'tags':
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php
|
||||
$tags = get_the_tags();
|
||||
if ( !empty( $tags ) ) {
|
||||
$out = array();
|
||||
foreach ( $tags as $c )
|
||||
$out[] = "<a href='edit.php?tag=$c->slug'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . "</a>";
|
||||
echo join( ', ', $out );
|
||||
} else {
|
||||
_e('No Tags');
|
||||
}
|
||||
?></td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'desc':
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php echo has_excerpt() ? $post->post_excerpt : ''; ?></td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'date':
|
||||
if ( '0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name ) {
|
||||
$t_time = $h_time = __('Unpublished');
|
||||
} else {
|
||||
$t_time = get_the_time(__('Y/m/d g:i:s A'));
|
||||
$m_time = $post->post_date;
|
||||
$time = get_post_time( 'G', true, $post, false );
|
||||
if ( ( abs($t_diff = time() - $time) ) < 86400 ) {
|
||||
if ( $t_diff < 0 )
|
||||
$h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
|
||||
else
|
||||
$h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
|
||||
} else {
|
||||
$h_time = mysql2date(__('Y/m/d'), $m_time);
|
||||
}
|
||||
}
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php echo $h_time ?></td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'parent':
|
||||
if ( $post->post_parent > 0 ) {
|
||||
if ( get_post($post->post_parent) ) {
|
||||
$title =_draft_or_post_title($post->post_parent);
|
||||
}
|
||||
?>
|
||||
<td <?php echo $attributes ?>><strong><a href="<?php echo get_edit_post_link( $post->post_parent ); ?>"><?php echo $title ?></a></strong>, <?php echo get_the_time(__('Y/m/d')); ?></td>
|
||||
<?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>
|
||||
<?php
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'comments':
|
||||
$attributes = 'class="comments column-comments num"' . $style;
|
||||
?>
|
||||
<td <?php echo $attributes ?>><div class="post-com-count-wrapper">
|
||||
<?php
|
||||
$left = get_pending_comments_num( $post->ID );
|
||||
$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
|
||||
if ( $left )
|
||||
echo '<strong>';
|
||||
comments_number("<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . '</span></a>');
|
||||
if ( $left )
|
||||
echo '</strong>';
|
||||
?>
|
||||
</div></td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'actions':
|
||||
?>
|
||||
<td <?php echo $attributes ?>>
|
||||
<a href="media.php?action=edit&attachment_id=<?php the_ID(); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php _e('Edit'); ?></a> |
|
||||
<a href="<?php the_permalink(); ?>"><?php _e('Get permalink'); ?></a>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
default:
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php do_action('manage_media_custom_column', $column_name, $id); ?></td>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php endwhile; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } else { ?>
|
||||
|
||||
<p><?php _e('No media attachments found.') ?></p>
|
||||
|
||||
<?php
|
||||
} // end if ( have_posts() )
|
||||
?>
|
||||
|
||||
@@ -8,68 +8,69 @@
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once('./admin.php');
|
||||
|
||||
if ( !current_user_can('edit_posts') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
$wp_list_table = _get_list_table('WP_Comments_List_Table');
|
||||
$pagenum = $wp_list_table->get_pagenum();
|
||||
wp_enqueue_script('admin-comments');
|
||||
enqueue_comment_hotkeys_js();
|
||||
|
||||
$doaction = $wp_list_table->current_action();
|
||||
$post_id = isset($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
|
||||
|
||||
if ( $doaction ) {
|
||||
check_admin_referer( 'bulk-comments' );
|
||||
if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2']) ) {
|
||||
check_admin_referer('bulk-comments');
|
||||
|
||||
if ( 'delete_all' == $doaction && !empty( $_REQUEST['pagegen_timestamp'] ) ) {
|
||||
$comment_status = $wpdb->escape( $_REQUEST['comment_status'] );
|
||||
$delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] );
|
||||
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 ( isset( $_REQUEST['delete_comments'] ) ) {
|
||||
} 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 ( isset( $_REQUEST['ids'] ) ) {
|
||||
$comment_ids = array_map( 'absint', explode( ',', $_REQUEST['ids'] ) );
|
||||
} elseif ( wp_get_referer() ) {
|
||||
$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'];
|
||||
} else {
|
||||
wp_redirect( wp_get_referer() );
|
||||
exit;
|
||||
}
|
||||
|
||||
$approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0;
|
||||
$redirect_to = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids'), wp_get_referer() );
|
||||
|
||||
$redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() );
|
||||
$redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to );
|
||||
foreach ($comment_ids as $comment_id) { // Check the permissions on each
|
||||
$_post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment_id) );
|
||||
|
||||
foreach ( $comment_ids as $comment_id ) { // Check the permissions on each
|
||||
if ( !current_user_can( 'edit_comment', $comment_id ) )
|
||||
if ( !current_user_can('edit_post', $_post_id) )
|
||||
continue;
|
||||
|
||||
switch ( $doaction ) {
|
||||
switch( $doaction ) {
|
||||
case 'approve' :
|
||||
wp_set_comment_status( $comment_id, 'approve' );
|
||||
wp_set_comment_status($comment_id, 'approve');
|
||||
$approved++;
|
||||
break;
|
||||
case 'unapprove' :
|
||||
wp_set_comment_status( $comment_id, 'hold' );
|
||||
wp_set_comment_status($comment_id, 'hold');
|
||||
$unapproved++;
|
||||
break;
|
||||
case 'spam' :
|
||||
wp_spam_comment( $comment_id );
|
||||
wp_spam_comment($comment_id);
|
||||
$spammed++;
|
||||
break;
|
||||
case 'unspam' :
|
||||
wp_unspam_comment( $comment_id );
|
||||
wp_unspam_comment($comment_id);
|
||||
$unspammed++;
|
||||
break;
|
||||
case 'trash' :
|
||||
wp_trash_comment( $comment_id );
|
||||
wp_trash_comment($comment_id);
|
||||
$trashed++;
|
||||
break;
|
||||
case 'untrash' :
|
||||
wp_untrash_comment( $comment_id );
|
||||
wp_untrash_comment($comment_id);
|
||||
$untrashed++;
|
||||
break;
|
||||
case 'delete' :
|
||||
wp_delete_comment( $comment_id );
|
||||
wp_delete_comment($comment_id);
|
||||
$deleted++;
|
||||
break;
|
||||
}
|
||||
@@ -90,68 +91,55 @@ if ( $doaction ) {
|
||||
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 );
|
||||
$redirect_to = add_query_arg( 'ids', join(',', $comment_ids), $redirect_to );
|
||||
|
||||
wp_redirect( $redirect_to );
|
||||
exit;
|
||||
} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
|
||||
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
|
||||
} elseif ( ! empty($_GET['_wp_http_referer']) ) {
|
||||
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
|
||||
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
|
||||
if ( $pagenum > $total_pages && $total_pages > 0 ) {
|
||||
wp_redirect( add_query_arg( 'paged', $total_pages ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
wp_enqueue_script('admin-comments');
|
||||
enqueue_comment_hotkeys_js();
|
||||
|
||||
if ( $post_id )
|
||||
$title = sprintf(__('Comments on “%s”'), wp_html_excerpt(_draft_or_post_title($post_id), 50));
|
||||
else
|
||||
$title = __('Comments');
|
||||
|
||||
add_screen_option( 'per_page', array('label' => _x( 'Comments', 'comments per page (screen options)' )) );
|
||||
|
||||
add_contextual_help( $current_screen, '<p>' . __( 'You can manage comments made on your site similar to the way you manage Posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.' ) . '</p>' .
|
||||
'<p>' . __( 'A yellow row means the comment is waiting for you to moderate it.' ) . '</p>' .
|
||||
'<p>' . __( 'In the Author column, in addition to the author’s name, email address, and blog URL, the commenter’s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' .
|
||||
'<p>' . __( 'In the Comment column, above each comment it says “Submitted on,” followed by the date and time the comment was left on your site. Clicking on the date/time link will take you to that comment on your live site.' ) . '</p>' .
|
||||
'<p>' . __( 'In the In Response To column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The “#” permalink symbol below leads to that post on your live site. The small bubble with the number in it shows how many comments that post has received. If the bubble is gray, you have moderated all comments for that post. If it is blue, there are pending comments. Clicking the bubble will filter the comments screen to show only comments on that post.' ) . '</p>' .
|
||||
'<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link below to learn more.' ) . '</p>' .
|
||||
add_contextual_help( $current_screen, '<p>' . __('You can manage comments made on your site similar to the way you manage Posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.') . '</p>' .
|
||||
'<p>' . __('A yellow row means the comment is waiting for you to moderate it.') . '</p>' .
|
||||
'<p>' . __('In the Author column, in addition to the author’s name, email address, and blog URL, the commenter’s IP address is shown. Clicking on this link will show you all the comments made from this IP address.') . '</p>' .
|
||||
'<p>' . __('In the Comment column, above each comment it says “Submitted on,” followed by the date and time the comment was left on your site. Clicking on the date/time link will take you to that comment on your live site.') . '</p>' .
|
||||
'<p>' . __('In the In Response To column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The “#” permalink symbol below leads to that post on your live site. The small bubble with the number in it shows how many comments that post has received. If the bubble is gray, you have moderated all comments for that post. If it is blue, there are pending comments. Clicking the bubble will filter the comments screen to show only comments on that post.') . '</p>' .
|
||||
'<p>' . __('Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link below to learn more.') . '</p>' .
|
||||
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Administration_Panels#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Comment_Spam" target="_blank">Documentation on Comment Spam</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">Documentation on Keyboard Shortcuts</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Administration_Panels#Comments" target="_blank">Comments Documentation</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Comment_Spam" target="_blank">Comment Spam Documentation</a>') . '</p>' .
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">Keyboard Shortcuts Documentation</a>') . '</p>' .
|
||||
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
require_once('./admin-header.php');
|
||||
?>
|
||||
|
||||
$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')) )
|
||||
$comment_status = 'all';
|
||||
|
||||
$comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : '';
|
||||
|
||||
$search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : '';
|
||||
$search = esc_attr( $search_dirty ); ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php
|
||||
if ( $post_id )
|
||||
echo sprintf(__('Comments on “%s”'),
|
||||
sprintf('<a href="%s">%s</a>',
|
||||
get_edit_post_link($post_id),
|
||||
wp_html_excerpt(_draft_or_post_title($post_id), 50)
|
||||
)
|
||||
);
|
||||
else
|
||||
echo __('Comments');
|
||||
|
||||
if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
|
||||
printf( '<span class="subtitle">' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ) . '</span>' ); ?>
|
||||
<h2><?php echo esc_html( $title );
|
||||
if ( isset($_GET['s']) && $_GET['s'] )
|
||||
printf( '<span class="subtitle">' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( stripslashes( $_GET['s'] ) ), 50 ) ) . '</span>' ); ?>
|
||||
</h2>
|
||||
|
||||
<?php
|
||||
if ( isset( $_REQUEST['error'] ) ) {
|
||||
$error = (int) $_REQUEST['error'];
|
||||
if ( isset( $_GET['error'] ) ) {
|
||||
$error = (int) $_GET['error'];
|
||||
$error_msg = '';
|
||||
switch ( $error ) {
|
||||
case 1 :
|
||||
@@ -165,21 +153,21 @@ if ( isset( $_REQUEST['error'] ) ) {
|
||||
echo '<div id="moderated" class="error"><p>' . $error_msg . '</p></div>';
|
||||
}
|
||||
|
||||
if ( isset($_REQUEST['approved']) || isset($_REQUEST['deleted']) || isset($_REQUEST['trashed']) || isset($_REQUEST['untrashed']) || isset($_REQUEST['spammed']) || isset($_REQUEST['unspammed']) || isset($_REQUEST['same']) ) {
|
||||
$approved = isset( $_REQUEST['approved'] ) ? (int) $_REQUEST['approved'] : 0;
|
||||
$deleted = isset( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0;
|
||||
$trashed = isset( $_REQUEST['trashed'] ) ? (int) $_REQUEST['trashed'] : 0;
|
||||
$untrashed = isset( $_REQUEST['untrashed'] ) ? (int) $_REQUEST['untrashed'] : 0;
|
||||
$spammed = isset( $_REQUEST['spammed'] ) ? (int) $_REQUEST['spammed'] : 0;
|
||||
$unspammed = isset( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0;
|
||||
$same = isset( $_REQUEST['same'] ) ? (int) $_REQUEST['same'] : 0;
|
||||
if ( isset($_GET['approved']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) || isset($_GET['spammed']) || isset($_GET['unspammed']) || isset($_GET['same']) ) {
|
||||
$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;
|
||||
$same = isset( $_GET['same'] ) ? (int) $_GET['same'] : 0;
|
||||
|
||||
if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) {
|
||||
if ( $approved > 0 )
|
||||
$messages[] = sprintf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
|
||||
|
||||
if ( $spammed > 0 ) {
|
||||
$ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
|
||||
$ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
|
||||
$messages[] = sprintf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
}
|
||||
|
||||
@@ -187,7 +175,7 @@ if ( isset($_REQUEST['approved']) || isset($_REQUEST['deleted']) || isset($_REQU
|
||||
$messages[] = sprintf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed );
|
||||
|
||||
if ( $trashed > 0 ) {
|
||||
$ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
|
||||
$ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
|
||||
$messages[] = sprintf( _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), $trashed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
}
|
||||
|
||||
@@ -216,32 +204,282 @@ if ( isset($_REQUEST['approved']) || isset($_REQUEST['deleted']) || isset($_REQU
|
||||
}
|
||||
?>
|
||||
|
||||
<?php $wp_list_table->views(); ?>
|
||||
|
||||
<form id="comments-form" action="" method="get">
|
||||
<ul class="subsubsub">
|
||||
<?php
|
||||
$status_links = array();
|
||||
$num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments();
|
||||
//, number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"),
|
||||
//, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>")
|
||||
$stati = array(
|
||||
'all' => _nx_noop('All', 'All', 'comments'), // 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>'),
|
||||
'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>')
|
||||
);
|
||||
|
||||
<?php $wp_list_table->search_box( __( 'Search Comments' ), 'comment' ); ?>
|
||||
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 = ( $status == $comment_status ) ? ' class="current"' : '';
|
||||
|
||||
if ( !isset( $num_comments->$status ) )
|
||||
$num_comments->$status = 10;
|
||||
$link = add_query_arg( 'comment_status', $status, $link );
|
||||
if ( $post_id )
|
||||
$link = add_query_arg( 'p', absint( $post_id ), $link );
|
||||
/*
|
||||
// I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
|
||||
if ( !empty( $_GET['s'] ) )
|
||||
$link = add_query_arg( 's', esc_attr( stripslashes( $_GET['s'] ) ), $link );
|
||||
*/
|
||||
$status_links[] = "<li class='$status'><a href='$link'$class>" . sprintf(
|
||||
_n( $label[0], $label[1], $num_comments->$status ),
|
||||
number_format_i18n( $num_comments->$status )
|
||||
) . '</a>';
|
||||
}
|
||||
|
||||
$status_links = apply_filters( 'comment_status_links', $status_links );
|
||||
|
||||
echo implode( " |</li>\n", $status_links) . '</li>';
|
||||
unset($status_links);
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<p class="search-box">
|
||||
<label class="screen-reader-text" for="comment-search-input"><?php _e( 'Search Comments' ); ?>:</label>
|
||||
<input type="text" id="comment-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<input type="submit" value="<?php esc_attr_e( 'Search Comments' ); ?>" class="button" />
|
||||
</p>
|
||||
|
||||
<?php
|
||||
$comments_per_page = (int) get_user_option( 'edit_comments_per_page' );
|
||||
if ( empty( $comments_per_page ) || $comments_per_page < 1 )
|
||||
$comments_per_page = 20;
|
||||
$comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
|
||||
|
||||
if ( isset( $_GET['apage'] ) )
|
||||
$page = abs( (int) $_GET['apage'] );
|
||||
else
|
||||
$page = 1;
|
||||
|
||||
$start = $offset = ( $page - 1 ) * $comments_per_page;
|
||||
|
||||
list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 8, $post_id, $comment_type ); // Grab a few extra
|
||||
|
||||
$_comment_post_ids = array();
|
||||
foreach ( $_comments as $_c ) {
|
||||
$_comment_post_ids[] = $_c->comment_post_ID;
|
||||
}
|
||||
|
||||
$_comment_pending_count = get_pending_comments_num($_comment_post_ids);
|
||||
|
||||
$comments = array_slice($_comments, 0, $comments_per_page);
|
||||
$extra_comments = array_slice($_comments, $comments_per_page);
|
||||
|
||||
$page_links = paginate_links( array(
|
||||
'base' => add_query_arg( 'apage', '%#%' ),
|
||||
'format' => '',
|
||||
'prev_text' => __('«'),
|
||||
'next_text' => __('»'),
|
||||
'total' => ceil($total / $comments_per_page),
|
||||
'current' => $page
|
||||
));
|
||||
|
||||
?>
|
||||
|
||||
<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
|
||||
<?php if ( $post_id ) : ?>
|
||||
<input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
|
||||
<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr(current_time('mysql', 1)); ?>" />
|
||||
|
||||
<input type="hidden" name="_total" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('total_items') ); ?>" />
|
||||
<input type="hidden" name="_per_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('per_page') ); ?>" />
|
||||
<input type="hidden" name="_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('page') ); ?>" />
|
||||
<div class="tablenav">
|
||||
|
||||
<?php if ( isset($_REQUEST['paged']) ) { ?>
|
||||
<input type="hidden" name="paged" value="<?php echo esc_attr( absint( $_REQUEST['paged'] ) ); ?>" />
|
||||
<?php } ?>
|
||||
<?php 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( $start + 1 ),
|
||||
number_format_i18n( min( $page * $comments_per_page, $total ) ),
|
||||
'<span class="total-type-count">' . number_format_i18n( $total ) . '</span>',
|
||||
$page_links
|
||||
); echo $page_links_text; ?></div>
|
||||
<input type="hidden" name="_total" value="<?php echo esc_attr($total); ?>" />
|
||||
<input type="hidden" name="_per_page" value="<?php echo esc_attr($comments_per_page); ?>" />
|
||||
<input type="hidden" name="_page" value="<?php echo esc_attr($page); ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $wp_list_table->display(); ?>
|
||||
</form>
|
||||
<?php if ( $comments ) : ?>
|
||||
<div class="alignleft actions">
|
||||
<select name="action">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions') ?></option>
|
||||
<?php if ( 'all' == $comment_status || 'approved' == $comment_status ): ?>
|
||||
<option value="unapprove"><?php _e('Unapprove'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?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 _ex('Mark as Spam', 'comment'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'trash' == $comment_status ): ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php elseif ( 'spam' == $comment_status ): ?>
|
||||
<option value="unspam"><?php _ex('Not Spam', 'comment'); ?></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 endif; ?>
|
||||
</select>
|
||||
<input type="submit" name="doaction" id="doaction" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary apply" />
|
||||
<?php wp_nonce_field('bulk-comments'); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<select name="comment_type">
|
||||
<option value="all"><?php _e('Show all comment types'); ?></option>
|
||||
<?php
|
||||
$comment_types = apply_filters( 'admin_comment_types_dropdown', array(
|
||||
'comment' => __('Comments'),
|
||||
'pings' => __('Pings'),
|
||||
) );
|
||||
|
||||
foreach ( $comment_types as $type => $label ) {
|
||||
echo " <option value='" . esc_attr($type) . "'";
|
||||
selected( $comment_type, $type );
|
||||
echo ">$label</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
|
||||
|
||||
<?php if ( isset($_GET['apage']) ) { ?>
|
||||
<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 }
|
||||
} ?>
|
||||
<?php do_action('manage_comments_nav', $comment_status); ?>
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
<?php if ( $comments ) { ?>
|
||||
|
||||
<table class="widefat comments fixed" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php print_column_headers('edit-comments'); ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<?php print_column_headers('edit-comments', false); ?>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody id="the-comment-list" class="list:comment">
|
||||
<?php
|
||||
foreach ($comments as $comment)
|
||||
_wp_comment_row( $comment->comment_ID, $mode, $comment_status );
|
||||
?>
|
||||
</tbody>
|
||||
<tbody id="the-extra-comment-list" class="list:comment" style="display: none;">
|
||||
<?php
|
||||
foreach ($extra_comments as $comment)
|
||||
_wp_comment_row( $comment->comment_ID, $mode, $comment_status );
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="tablenav">
|
||||
<?php
|
||||
if ( $page_links )
|
||||
echo "<div class='tablenav-pages'>$page_links_text</div>";
|
||||
?>
|
||||
|
||||
<div class="alignleft actions">
|
||||
<select name="action2">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions') ?></option>
|
||||
<?php if ( 'all' == $comment_status || 'approved' == $comment_status ): ?>
|
||||
<option value="unapprove"><?php _e('Unapprove'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?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 _ex('Mark as Spam', 'comment'); ?></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 _ex('Not Spam', 'comment'); ?></option>
|
||||
<?php else: ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php endif; ?>
|
||||
</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 } ?>
|
||||
<?php do_action('manage_comments_nav', $comment_status); ?>
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<form id="get-extra-comments" method="post" action="" class="add:the-extra-comment-list:" style="display: none;">
|
||||
<input type="hidden" name="s" value="<?php echo esc_attr($search); ?>" />
|
||||
<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
|
||||
<input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
|
||||
<input type="hidden" name="page" value="<?php echo esc_attr($page); ?>" />
|
||||
<input type="hidden" name="per_page" value="<?php echo esc_attr($comments_per_page); ?>" />
|
||||
<input type="hidden" name="p" value="<?php echo esc_attr( $post_id ); ?>" />
|
||||
<input type="hidden" name="comment_type" value="<?php echo esc_attr( $comment_type ); ?>" />
|
||||
<?php wp_nonce_field( 'add-comment', '_ajax_nonce', false ); ?>
|
||||
</form>
|
||||
|
||||
<div id="ajax-response"></div>
|
||||
|
||||
<?php } elseif ( 'moderated' == $comment_status ) { ?>
|
||||
<p><?php _e('No comments awaiting moderation… yet.') ?></p>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php } else { ?>
|
||||
<p><?php _e('No comments found.') ?></p>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
wp_comment_reply('-1', true, 'detail');
|
||||
wp_comment_trashnotice();
|
||||
|
||||
@@ -108,9 +108,6 @@ require_once('./includes/meta-boxes.php');
|
||||
|
||||
add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', $post_type, 'side', 'core');
|
||||
|
||||
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) )
|
||||
add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', $post_type, 'side', 'core' );
|
||||
|
||||
// all taxonomies
|
||||
foreach ( get_object_taxonomies($post_type) as $tax_name ) {
|
||||
$taxonomy = get_taxonomy($tax_name);
|
||||
@@ -152,7 +149,10 @@ if ( !( 'pending' == $post->post_status && !current_user_can( $post_type_object-
|
||||
add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', $post_type, 'normal', 'core');
|
||||
|
||||
if ( post_type_supports($post_type, 'author') ) {
|
||||
if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) )
|
||||
$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 ) || is_super_admin() )
|
||||
add_meta_box('authordiv', __('Author'), 'post_author_meta_box', $post_type, 'normal', 'core');
|
||||
}
|
||||
|
||||
@@ -166,21 +166,18 @@ do_action('do_meta_boxes', $post_type, 'normal', $post);
|
||||
do_action('do_meta_boxes', $post_type, 'advanced', $post);
|
||||
do_action('do_meta_boxes', $post_type, 'side', $post);
|
||||
|
||||
add_screen_option('layout_columns', array('max' => 2) );
|
||||
|
||||
if ( 'post' == $post_type ) {
|
||||
add_contextual_help($current_screen,
|
||||
'<p>' . __('The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of the box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.') . '</p>' .
|
||||
'<p>' . __('The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes that allow you to add metadata to your post using drag and drop, and can minimize or expand them by clicking the title bar of the box. You can also hide any of the boxes by using the Screen Options tab, where you can also choose a 1- or 2-column layout for this screen.') . '</p>' .
|
||||
'<p>' . __('<strong>Title</strong> - Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '</p>' .
|
||||
'<p>' . __('<strong>Post editor</strong> - Enter the text for your post. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The screen icon just before that allows you to expand the edit box to full screen. The HTML mode allows you to enter raw HTML along with your post text. You can insert media files by clicking the icons above the post editor and following the directions.') . '</p>' .
|
||||
'<p>' . __('<strong>Post editor</strong> - Enter the text for your post. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The HTML mode allows you to enter raw HTML along with your post text. You can insert media files by clicking the icons above the post editor and following the directions.') . '</p>' .
|
||||
'<p>' . __('<strong>Publish</strong> - You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.') . '</p>' .
|
||||
( ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) ? '<p>' . __( '<strong>Post Format</strong> - This designates how your theme will display a specific post. For example, you could have a <em>standard</em> blog post with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="http://codex.wordpress.org/Post_Formats#Supported_Formats">descriptions of each post format</a>.' ) . '</p>' : '' ) .
|
||||
'<p>' . __('<strong>Featured Image</strong> - This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the featured image as a post thumbnail on the home page, a custom header, etc.') . '</p>' .
|
||||
'<p>' . __('<strong>Send Trackbacks</strong> - Trackbacks are a way to notify legacy blog systems that you’ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they’ll be notified automatically using pingbacks, and this field is unnecessary.') . '</p>' .
|
||||
'<p>' . __('<strong>Discussion</strong> - You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.') . '</p>' .
|
||||
'<p>' . sprintf(__('You can also create posts with the <a href="%s">Press This bookmarklet</a>.'), 'options-writing.php') . '</p>' .
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Posts_Add_New_SubPanel" target="_blank">Documentation on Writing and Editing Posts</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Writing_Posts" target="_blank">Documentation on Writing Posts</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
} elseif ( 'page' == $post_type ) {
|
||||
@@ -190,8 +187,7 @@ if ( 'post' == $post_type ) {
|
||||
'<p>' . __('<strong>Template</strong> - 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 in this dropdown menu.') . '</p>' .
|
||||
'<p>' . __('<strong>Order</strong> - Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.') . '</p>' .
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Add_New_SubPanel" target="_blank">Documentation on Adding New Pages</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Pages_SubPanel#Editing_Individual_Pages" target="_blank">Documentation on Editing Pages</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Add_New_SubPanel" target="_blank">Page Creation Documentation</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
}
|
||||
@@ -210,13 +206,12 @@ require_once('./admin-header.php');
|
||||
<?php endif; ?>
|
||||
<form name="post" action="post.php" method="post" id="post"<?php do_action('post_edit_form_tag'); ?>>
|
||||
<?php wp_nonce_field($nonce_action); ?>
|
||||
<input type="hidden" name="parent_id" value="<?php echo esc_attr( $post->post_parent ); ?>" />
|
||||
<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $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 ) ?>" />
|
||||
<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) ?>" />
|
||||
<input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
|
||||
<input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post_type ) ?>" />
|
||||
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status) ?>" />
|
||||
<input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr($post_type) ?>" />
|
||||
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr($post->post_status) ?>" />
|
||||
<input type="hidden" id="referredby" name="referredby" value="<?php echo esc_url(stripslashes(wp_get_referer())); ?>" />
|
||||
<?php
|
||||
if ( 'draft' != $post->post_status )
|
||||
@@ -243,17 +238,17 @@ $side_meta_boxes = do_meta_boxes($post_type, 'side', $post);
|
||||
<?php if ( post_type_supports($post_type, 'title') ) { ?>
|
||||
<div id="titlediv">
|
||||
<div id="titlewrap">
|
||||
<label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>
|
||||
<label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title"><?php _e('Enter title here') ?></label>
|
||||
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
|
||||
</div>
|
||||
<div class="inside">
|
||||
<?php
|
||||
$sample_permalink_html = ! empty( $post_type_object->publicly_queryable ) ? get_sample_permalink_html($post->ID) : '';
|
||||
$sample_permalink_html = get_sample_permalink_html($post->ID);
|
||||
$shortlink = wp_get_shortlink($post->ID, 'post');
|
||||
if ( !empty($shortlink) )
|
||||
$sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';
|
||||
|
||||
if ( ! empty( $post_type_object->publicly_queryable ) && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>
|
||||
if ( !( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>
|
||||
<div id="edit-slug-box">
|
||||
<?php
|
||||
if ( ! empty($post->ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status )
|
||||
|
||||
@@ -71,7 +71,7 @@ $date = date_i18n( $datef, strtotime( $comment->comment_date ) );
|
||||
<?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"; ?>
|
||||
</div>
|
||||
<div id="publishing-action">
|
||||
<?php submit_button( __( 'Update Comment' ), 'primary', 'save', false, array( 'tabindex' => '4' ) ); ?>
|
||||
<input type="submit" name="save" value="<?php esc_attr_e('Update Comment'); ?>" tabindex="4" class="button-primary" />
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
237
wp-admin/edit-link-categories.php
Normal file
@@ -0,0 +1,237 @@
|
||||
<?php
|
||||
/**
|
||||
* Edit Link Categories Administration Panel.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once('./admin.php');
|
||||
|
||||
// Handle bulk actions
|
||||
if ( isset($_GET['action']) && isset($_GET['delete']) ) {
|
||||
check_admin_referer('bulk-link-categories');
|
||||
$doaction = $_GET['action'] ? $_GET['action'] : $_GET['action2'];
|
||||
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
if ( 'delete' == $doaction ) {
|
||||
$cats = (array) $_GET['delete'];
|
||||
$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_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
|
||||
}
|
||||
|
||||
$location = 'edit-link-categories.php';
|
||||
if ( $referer = wp_get_referer() ) {
|
||||
if ( false !== strpos($referer, 'edit-link-categories.php') )
|
||||
$location = $referer;
|
||||
}
|
||||
|
||||
$location = add_query_arg('message', 6, $location);
|
||||
wp_redirect($location);
|
||||
exit();
|
||||
}
|
||||
} elseif ( ! empty($_GET['_wp_http_referer']) ) {
|
||||
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = __('Link Categories');
|
||||
|
||||
wp_enqueue_script('admin-categories');
|
||||
if ( current_user_can('manage_categories') )
|
||||
wp_enqueue_script('inline-edit-tax');
|
||||
|
||||
add_contextual_help($current_screen, '<p>' . __('You can create groups of links by using link categories. Link category names must be unique and link categories are separate from the categories you use for posts.') . '</p>' .
|
||||
'<p>' . __('You can delete link categories, but that action does not delete the links within the category. Instead, it moves them to the default link category.') . '</p>' .
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Links_Link_Categories_SubPanel" target="_blank">Link Categories Documentation</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
|
||||
require_once ('admin-header.php');
|
||||
|
||||
$messages[1] = __('Category added.');
|
||||
$messages[2] = __('Category deleted.');
|
||||
$messages[3] = __('Category updated.');
|
||||
$messages[4] = __('Category not added.');
|
||||
$messages[5] = __('Category not updated.');
|
||||
$messages[6] = __('Categories deleted.'); ?>
|
||||
|
||||
<div class="wrap nosubsub">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title );
|
||||
if ( isset($_GET['s']) && $_GET['s'] )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_GET['s']) ) ); ?>
|
||||
</h2>
|
||||
|
||||
<?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
|
||||
<div id="message" class="updated"><p><?php echo $messages[$msg]; ?></p></div>
|
||||
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
|
||||
endif; ?>
|
||||
|
||||
<form class="search-form" action="" method="get">
|
||||
<p class="search-box">
|
||||
<label class="screen-reader-text" for="link-category-search-input"><?php _e( 'Search Categories' ); ?>:</label>
|
||||
<input type="text" id="link-category-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<input type="submit" value="<?php esc_attr_e( 'Search Categories' ); ?>" class="button" />
|
||||
</p>
|
||||
</form>
|
||||
<br class="clear" />
|
||||
|
||||
<div id="col-container">
|
||||
|
||||
<div id="col-right">
|
||||
<div class="col-wrap">
|
||||
<form id="posts-filter" action="" method="get">
|
||||
<div class="tablenav">
|
||||
|
||||
<?php
|
||||
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
|
||||
if ( empty($pagenum) )
|
||||
$pagenum = 1;
|
||||
if ( ! isset( $catsperpage ) || $catsperpage < 0 )
|
||||
$catsperpage = 20;
|
||||
|
||||
$page_links = paginate_links( array(
|
||||
'base' => add_query_arg( 'pagenum', '%#%' ),
|
||||
'format' => '',
|
||||
'prev_text' => __('«'),
|
||||
'next_text' => __('»'),
|
||||
'total' => ceil(wp_count_terms('link_category') / $catsperpage),
|
||||
'current' => $pagenum
|
||||
));
|
||||
|
||||
if ( $page_links )
|
||||
echo "<div class='tablenav-pages'>$page_links</div>";
|
||||
?>
|
||||
|
||||
<div class="alignleft actions">
|
||||
<select name="action">
|
||||
<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<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-link-categories'); ?>
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<table class="widefat fixed" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php print_column_headers('edit-link-categories'); ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<?php print_column_headers('edit-link-categories', false); ?>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody id="the-list" class="list:link-cat">
|
||||
<?php
|
||||
$start = ($pagenum - 1) * $catsperpage;
|
||||
$args = array('offset' => $start, 'number' => $catsperpage, 'hide_empty' => 0);
|
||||
if ( !empty( $_GET['s'] ) )
|
||||
$args['search'] = $_GET['s'];
|
||||
|
||||
$categories = get_terms( 'link_category', $args );
|
||||
if ( $categories ) {
|
||||
$output = '';
|
||||
foreach ( $categories as $category ) {
|
||||
$output .= link_cat_row($category);
|
||||
}
|
||||
echo $output;
|
||||
unset($category);
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="tablenav">
|
||||
<?php
|
||||
if ( $page_links )
|
||||
echo "<div class='tablenav-pages'>$page_links</div>";
|
||||
?>
|
||||
|
||||
<div class="alignleft actions">
|
||||
<select name="action2">
|
||||
<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<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" />
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
</div>
|
||||
<br class="clear" />
|
||||
</form>
|
||||
|
||||
<div class="form-wrap">
|
||||
<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the links in that category. Instead, links that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), get_term_field('name', get_option('default_link_category'), 'link_category')) ?></p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div><!-- /col-right -->
|
||||
|
||||
<div id="col-left">
|
||||
<div class="col-wrap">
|
||||
|
||||
<?php if ( current_user_can('manage_categories') ) {
|
||||
$category = (object) array(); $category->parent = 0; do_action('add_link_category_form_pre', $category); ?>
|
||||
|
||||
<div class="form-wrap">
|
||||
<h3><?php _e('Add Link Category'); ?></h3>
|
||||
<div id="ajax-response"></div>
|
||||
<form name="addcat" id="addcat" class="add:the-list: validate" method="post" action="link-category.php">
|
||||
<input type="hidden" name="action" value="addcat" />
|
||||
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-link-category'); ?>
|
||||
|
||||
<div class="form-field form-required">
|
||||
<label for="name"><?php _e('Link Category name') ?></label>
|
||||
<input name="name" id="link-name" type="text" value="" size="40" aria-required="true" />
|
||||
</div>
|
||||
<?php if ( !global_terms_enabled() ) { ?>
|
||||
<div class="form-field">
|
||||
<label for="slug"><?php _e('Link Category slug') ?></label>
|
||||
<input name="slug" id="link-slug" type="text" value="" size="40" />
|
||||
<p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="form-field">
|
||||
<label for="description"><?php _e('Description (optional)') ?></label>
|
||||
<textarea name="description" id="link-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>
|
||||
<?php do_action('edit_link_category_form', $category); ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div><!-- /col-left -->
|
||||
|
||||
</div><!-- /col-container -->
|
||||
</div><!-- /wrap -->
|
||||
|
||||
<?php inline_edit_term_row('edit-link-categories', 'link_category'); ?>
|
||||
<?php include('./admin-footer.php'); ?>
|
||||
92
wp-admin/edit-link-category-form.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* Edit link category form for inclusion in administration panels.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('You do not have sufficient permissions to edit link categories for this site.'));
|
||||
|
||||
/**
|
||||
* @var object
|
||||
*/
|
||||
if ( ! isset( $category ) )
|
||||
$category = (object) array();
|
||||
|
||||
if ( ! empty($cat_ID) ) {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
$heading = '<h2>' . __('Edit Link Category') . '</h2>';
|
||||
$submit_text = __('Update Category');
|
||||
$form = '<form name="editcat" id="editcat" method="post" action="link-category.php" class="validate">';
|
||||
$action = 'editedcat';
|
||||
$nonce_action = 'update-link-category_' . $cat_ID;
|
||||
do_action('edit_link_category_form_pre', $category);
|
||||
} else {
|
||||
$heading = '<h2>' . __('Add Link Category') . '</h2>';
|
||||
$submit_text = __('Add Category');
|
||||
$form = '<form name="addcat" id="addcat" class="add:the-list: validate" method="post" action="link-category.php">';
|
||||
$action = 'addcat';
|
||||
$nonce_action = 'add-link-category';
|
||||
do_action('add_link_category_form_pre', $category);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
* @since 2.7
|
||||
* @internal Used to prevent errors in page when no category is being edited.
|
||||
*
|
||||
* @param object $category
|
||||
*/
|
||||
function _fill_empty_link_category(&$category) {
|
||||
if ( ! isset( $category->name ) )
|
||||
$category->name = '';
|
||||
|
||||
if ( ! isset( $category->slug ) )
|
||||
$category->slug = '';
|
||||
|
||||
if ( ! isset( $category->description ) )
|
||||
$category->description = '';
|
||||
}
|
||||
|
||||
_fill_empty_link_category($category);
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<?php echo $heading ?>
|
||||
<div id="ajax-response"></div>
|
||||
<?php echo $form ?>
|
||||
<input type="hidden" name="action" value="<?php echo esc_attr($action) ?>" />
|
||||
<input type="hidden" name="cat_ID" value="<?php echo esc_attr($category->term_id) ?>" />
|
||||
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field($nonce_action); ?>
|
||||
<table class="form-table">
|
||||
<tr class="form-field form-required">
|
||||
<th scope="row" valign="top"><label for="name"><?php _e('Link Category name') ?></label></th>
|
||||
<td><input name="name" id="name" type="text" value="<?php echo esc_attr($category->name); ?>" size="40" aria-required="true" /></td>
|
||||
</tr>
|
||||
<?php if ( !is_multisite() ) { ?>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="slug"><?php _e('Link Category slug') ?></label></th>
|
||||
<td><input name="slug" id="slug" type="text" value="<?php echo esc_attr(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
|
||||
<?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<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>
|
||||
</tr>
|
||||
<?php do_action('edit_link_category_form_fields', $category); ?>
|
||||
</table>
|
||||
<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo esc_attr($submit_text) ?>" /></p>
|
||||
<?php do_action('edit_link_category_form', $category); ?>
|
||||
</form>
|
||||
</div>
|
||||
@@ -37,8 +37,6 @@ do_action('do_meta_boxes', 'link', 'normal', $link);
|
||||
do_action('do_meta_boxes', 'link', 'advanced', $link);
|
||||
do_action('do_meta_boxes', 'link', 'side', $link);
|
||||
|
||||
add_screen_option('layout_columns', array('max' => 2) );
|
||||
|
||||
add_contextual_help($current_screen,
|
||||
'<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link’s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>' .
|
||||
'<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don’t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>' .
|
||||
|
||||
34
wp-admin/edit-post-rows.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Edit posts rows table for inclusion in administration panels.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
?>
|
||||
<table class="widefat <?php echo $post_type_object->hierarchical ? 'page' : 'post'; ?> fixed" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php print_column_headers( $current_screen ); ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<?php print_column_headers($current_screen, false); ?>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
if ( $post_type_object->hierarchical )
|
||||
page_rows($posts, $pagenum, $per_page);
|
||||
else
|
||||
post_rows();
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -16,14 +16,10 @@ if ( empty($tag_ID) ) { ?>
|
||||
return;
|
||||
}
|
||||
|
||||
// Back compat hooks
|
||||
if ( 'category' == $taxonomy )
|
||||
do_action('edit_category_form_pre', $tag );
|
||||
elseif ( 'link_category' == $taxonomy )
|
||||
do_action('edit_link_category_form_pre', $tag );
|
||||
else
|
||||
do_action('edit_tag_form_pre', $tag);
|
||||
|
||||
do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>
|
||||
|
||||
<div class="wrap">
|
||||
@@ -52,7 +48,7 @@ do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="parent"><?php _ex('Parent', 'Taxonomy Parent'); ?></label></th>
|
||||
<td>
|
||||
<?php wp_dropdown_categories(array('hide_empty' => 0, 'hide_if_empty' => false, 'name' => 'parent', 'orderby' => 'name', 'taxonomy' => $taxonomy, 'selected' => $tag->parent, 'exclude_tree' => $tag->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br />
|
||||
<?php wp_dropdown_categories(array('hide_empty' => 0, 'hide_if_empty' => false, 'name' => 'parent', 'orderby' => 'name', 'taxonomy' => $taxonomy, 'selected' => $tag->parent, 'exclude' => $tag->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br />
|
||||
<?php if ( 'category' == $taxonomy ) : ?>
|
||||
<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>
|
||||
<?php endif; ?>
|
||||
@@ -61,33 +57,24 @@ do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>
|
||||
<?php endif; // is_taxonomy_hierarchical() ?>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?></label></th>
|
||||
<td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $tag->description; // textarea_escaped ?></textarea><br />
|
||||
<td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo esc_html($tag->description); ?></textarea><br />
|
||||
<span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
|
||||
</tr>
|
||||
<?php
|
||||
// Back compat hooks
|
||||
if ( 'category' == $taxonomy )
|
||||
do_action('edit_category_form_fields', $tag);
|
||||
if ( 'link_category' == $taxonomy )
|
||||
do_action('edit_link_category_form_fields', $tag);
|
||||
else
|
||||
do_action('edit_tag_form_fields', $tag);
|
||||
|
||||
do_action($taxonomy . '_edit_form_fields', $tag, $taxonomy);
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
// Back compat hooks
|
||||
if ( 'category' == $taxonomy )
|
||||
do_action('edit_category_form', $tag);
|
||||
if ( 'link_category' == $taxonomy )
|
||||
do_action('edit_link_category_form', $tag);
|
||||
else
|
||||
do_action('edit_tag_form', $tag);
|
||||
|
||||
do_action($taxonomy . '_edit_form', $tag, $taxonomy);
|
||||
|
||||
submit_button( __('Update') );
|
||||
?>
|
||||
<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo esc_attr( __( 'Update' ) ); ?>" /></p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -8,52 +8,57 @@
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once('./admin.php');
|
||||
$tax = get_taxonomy( $taxnow );
|
||||
if ( !current_user_can( $tax->cap->manage_terms ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
|
||||
$wp_list_table = _get_list_table('WP_Terms_List_Table');
|
||||
$pagenum = $wp_list_table->get_pagenum();
|
||||
wp_reset_vars( array('action', 'tag', 'taxonomy', 'post_type') );
|
||||
|
||||
if ( empty($taxonomy) )
|
||||
$taxonomy = 'post_tag';
|
||||
|
||||
if ( !taxonomy_exists($taxonomy) )
|
||||
wp_die(__('Invalid taxonomy'));
|
||||
|
||||
$tax = get_taxonomy($taxonomy);
|
||||
|
||||
$title = $tax->labels->name;
|
||||
|
||||
if ( empty($post_type) || !in_array( $post_type, get_post_types( array('public' => true) ) ) )
|
||||
$post_type = 'post';
|
||||
|
||||
if ( 'post' != $post_type ) {
|
||||
$parent_file = "edit.php?post_type=$post_type";
|
||||
$submenu_file = "edit-tags.php?taxonomy=$taxonomy&post_type=$post_type";
|
||||
} else if ( 'link_category' == $tax->name ) {
|
||||
$parent_file = 'link-manager.php';
|
||||
$submenu_file = 'edit-tags.php?taxonomy=link_category';
|
||||
} else {
|
||||
$parent_file = 'edit.php';
|
||||
$submenu_file = "edit-tags.php?taxonomy=$taxonomy";
|
||||
}
|
||||
|
||||
add_screen_option( 'per_page', array('label' => $title, 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page') );
|
||||
if ( isset( $_GET['action'] ) && isset($_GET['delete_tags']) && ( 'delete' == $_GET['action'] || 'delete' == $_GET['action2'] ) )
|
||||
$action = 'bulk-delete';
|
||||
|
||||
switch ( $wp_list_table->current_action() ) {
|
||||
switch($action) {
|
||||
|
||||
case 'add-tag':
|
||||
|
||||
check_admin_referer( 'add-tag' );
|
||||
check_admin_referer('add-tag');
|
||||
|
||||
if ( !current_user_can( $tax->cap->edit_terms ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
if ( !current_user_can($tax->cap->edit_terms) )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
$ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
|
||||
$ret = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST);
|
||||
$location = 'edit-tags.php?taxonomy=' . $taxonomy;
|
||||
if ( 'post' != $post_type )
|
||||
$location .= '&post_type=' . $post_type;
|
||||
|
||||
if ( $referer = wp_get_original_referer() ) {
|
||||
if ( false !== strpos( $referer, 'edit-tags.php' ) )
|
||||
if ( false !== strpos($referer, 'edit-tags.php') )
|
||||
$location = $referer;
|
||||
}
|
||||
|
||||
if ( $ret && !is_wp_error( $ret ) )
|
||||
$location = add_query_arg( 'message', 1, $location );
|
||||
$location = add_query_arg('message', 1, $location);
|
||||
else
|
||||
$location = add_query_arg( 'message', 4, $location );
|
||||
wp_redirect( $location );
|
||||
$location = add_query_arg('message', 4, $location);
|
||||
wp_redirect($location);
|
||||
exit;
|
||||
break;
|
||||
|
||||
@@ -62,50 +67,50 @@ case 'delete':
|
||||
if ( 'post' != $post_type )
|
||||
$location .= '&post_type=' . $post_type;
|
||||
if ( $referer = wp_get_referer() ) {
|
||||
if ( false !== strpos( $referer, 'edit-tags.php' ) )
|
||||
if ( false !== strpos($referer, 'edit-tags.php') )
|
||||
$location = $referer;
|
||||
}
|
||||
|
||||
if ( !isset( $_REQUEST['tag_ID'] ) ) {
|
||||
wp_redirect( $location );
|
||||
if ( !isset( $_GET['tag_ID'] ) ) {
|
||||
wp_redirect($location);
|
||||
exit;
|
||||
}
|
||||
|
||||
$tag_ID = (int) $_REQUEST['tag_ID'];
|
||||
check_admin_referer( 'delete-tag_' . $tag_ID );
|
||||
$tag_ID = (int) $_GET['tag_ID'];
|
||||
check_admin_referer('delete-tag_' . $tag_ID);
|
||||
|
||||
if ( !current_user_can( $tax->cap->delete_terms ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
if ( !current_user_can($tax->cap->delete_terms) )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
wp_delete_term( $tag_ID, $taxonomy );
|
||||
wp_delete_term( $tag_ID, $taxonomy);
|
||||
|
||||
$location = add_query_arg( 'message', 2, $location );
|
||||
wp_redirect( $location );
|
||||
$location = add_query_arg('message', 2, $location);
|
||||
wp_redirect($location);
|
||||
exit;
|
||||
|
||||
break;
|
||||
|
||||
case 'bulk-delete':
|
||||
check_admin_referer( 'bulk-tags' );
|
||||
check_admin_referer('bulk-tags');
|
||||
|
||||
if ( !current_user_can( $tax->cap->delete_terms ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
if ( !current_user_can($tax->cap->delete_terms) )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
$tags = (array) $_REQUEST['delete_tags'];
|
||||
foreach ( $tags as $tag_ID ) {
|
||||
wp_delete_term( $tag_ID, $taxonomy );
|
||||
$tags = (array) $_GET['delete_tags'];
|
||||
foreach( $tags as $tag_ID ) {
|
||||
wp_delete_term( $tag_ID, $taxonomy);
|
||||
}
|
||||
|
||||
$location = 'edit-tags.php?taxonomy=' . $taxonomy;
|
||||
if ( 'post' != $post_type )
|
||||
$location .= '&post_type=' . $post_type;
|
||||
if ( $referer = wp_get_referer() ) {
|
||||
if ( false !== strpos( $referer, 'edit-tags.php' ) )
|
||||
if ( false !== strpos($referer, 'edit-tags.php') )
|
||||
$location = $referer;
|
||||
}
|
||||
|
||||
$location = add_query_arg( 'message', 6, $location );
|
||||
wp_redirect( $location );
|
||||
$location = add_query_arg('message', 6, $location);
|
||||
wp_redirect($location);
|
||||
exit;
|
||||
|
||||
break;
|
||||
@@ -113,107 +118,82 @@ break;
|
||||
case 'edit':
|
||||
$title = $tax->labels->edit_item;
|
||||
|
||||
require_once ( 'admin-header.php' );
|
||||
$tag_ID = (int) $_REQUEST['tag_ID'];
|
||||
require_once ('admin-header.php');
|
||||
$tag_ID = (int) $_GET['tag_ID'];
|
||||
|
||||
$tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' );
|
||||
include( './edit-tag-form.php' );
|
||||
$tag = get_term($tag_ID, $taxonomy, OBJECT, 'edit');
|
||||
include('./edit-tag-form.php');
|
||||
|
||||
break;
|
||||
|
||||
case 'editedtag':
|
||||
$tag_ID = (int) $_POST['tag_ID'];
|
||||
check_admin_referer( 'update-tag_' . $tag_ID );
|
||||
check_admin_referer('update-tag_' . $tag_ID);
|
||||
|
||||
if ( !current_user_can( $tax->cap->edit_terms ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
if ( !current_user_can($tax->cap->edit_terms) )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
$ret = wp_update_term( $tag_ID, $taxonomy, $_POST );
|
||||
$ret = wp_update_term($tag_ID, $taxonomy, $_POST);
|
||||
|
||||
$location = 'edit-tags.php?taxonomy=' . $taxonomy;
|
||||
if ( 'post' != $post_type )
|
||||
$location .= '&post_type=' . $post_type;
|
||||
|
||||
if ( $referer = wp_get_original_referer() ) {
|
||||
if ( false !== strpos( $referer, 'edit-tags.php' ) )
|
||||
if ( false !== strpos($referer, 'edit-tags.php') )
|
||||
$location = $referer;
|
||||
}
|
||||
|
||||
if ( $ret && !is_wp_error( $ret ) )
|
||||
$location = add_query_arg( 'message', 3, $location );
|
||||
$location = add_query_arg('message', 3, $location);
|
||||
else
|
||||
$location = add_query_arg( 'message', 5, $location );
|
||||
$location = add_query_arg('message', 5, $location);
|
||||
|
||||
wp_redirect( $location );
|
||||
wp_redirect($location);
|
||||
exit;
|
||||
break;
|
||||
|
||||
default:
|
||||
if ( ! empty($_REQUEST['_wp_http_referer']) ) {
|
||||
$location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) );
|
||||
|
||||
if ( ! empty( $_REQUEST['paged'] ) )
|
||||
$location = add_query_arg( 'paged', (int) $_REQUEST['paged'] );
|
||||
|
||||
wp_redirect( $location );
|
||||
exit;
|
||||
}
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
|
||||
|
||||
if ( $pagenum > $total_pages && $total_pages > 0 ) {
|
||||
wp_redirect( add_query_arg( 'paged', $total_pages ) );
|
||||
exit;
|
||||
if ( ! empty($_GET['_wp_http_referer']) ) {
|
||||
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
wp_enqueue_script('admin-tags');
|
||||
if ( current_user_can($tax->cap->edit_terms) )
|
||||
wp_enqueue_script('inline-edit-tax');
|
||||
|
||||
if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $taxonomy ) {
|
||||
$help ='';
|
||||
if ( 'category' == $taxonomy || 'post_tag' == $taxonomy ) {
|
||||
if ( 'category' == $taxonomy )
|
||||
$help = '<p>' . sprintf(__( 'You can use categories to define sections of your site and group related posts. The default category is “Uncategorized” until you change it in your <a href="%s">writing settings</a>.' ) , 'options-writing.php' ) . '</p>';
|
||||
elseif ( 'link_category' == $taxonomy )
|
||||
$help = '<p>' . __( 'You can create groups of links by using link categories. Link category names must be unique and link categories are separate from the categories you use for posts.' ) . '</p>';
|
||||
$help = '<p>' . sprintf(__('You can use categories to define sections of your site and group related posts. The default category is “Uncategorized” until you change it in your <a href="%s">writing settings</a>.'), 'options-writing.php') . '</p>';
|
||||
else
|
||||
$help = '<p>' . __( 'You can assign keywords to your posts using Post Tags. Unlike categories, tags have no hierarchy, meaning there’s no relationship from one tag to another.' ) . '</p>';
|
||||
$help = '<p>' . __('You can assign keywords to your posts using Post Tags. Unlike categories, tags have no hierarchy, meaning there’s no relationship from one tag to another.') . '</p>';
|
||||
|
||||
if ( 'link_category' == $taxonomy )
|
||||
$help .= '<p>' . __( 'You can delete link categories in the Bulk Action pulldown, but that action does not delete the links within the category. Instead, it moves them to the default link category.' ) . '</p>';
|
||||
$help .='<p>' . __('What’s the difference between categories and tags? Normally, tags are ad-hoc keywords that identify important information in your post (names, subjects, etc) that may or may not recur in other posts, while categories are pre-determined sections. If you think of your site like a book, the categories are like the Table of Contents and the tags are like the terms in the index.') . '</p>';
|
||||
|
||||
if ( 'category' == $taxonomy )
|
||||
$help .= '<p>' . __('When adding a new category on this screen, you’ll fill in the following fields:') . '</p>';
|
||||
else
|
||||
$help .='<p>' . __( 'What’s the difference between categories and tags? Normally, tags are ad-hoc keywords that identify important information in your post (names, subjects, etc) that may or may not recur in other posts, while categories are pre-determined sections. If you think of your site like a book, the categories are like the Table of Contents and the tags are like the terms in the index.' ) . '</p>';
|
||||
$help .= '<p>' . __('When adding a new tag on this screen, you’ll fill in the following fields:') . '</p>';
|
||||
|
||||
$help .= '<ul>' .
|
||||
'<li>' . __('<strong>Name</strong> - The name is how it appears on your site.') . '</li>';
|
||||
if ( ! global_terms_enabled() )
|
||||
$help .= '<li>' . __('<strong>Slug</strong> - The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.') . '</li>';
|
||||
|
||||
if ( 'category' == $taxonomy )
|
||||
$help .= '<p>' . __( 'When adding a new category on this screen, you’ll fill in the following fields:' ) . '</p>';
|
||||
elseif ( 'post_tag' == $taxonomy )
|
||||
$help .= '<p>' . __( 'When adding a new tag on this screen, you’ll fill in the following fields:' ) . '</p>';
|
||||
$help .= '<li>' . __('<strong>Parent</strong> - 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. To create a subcategory, just choose another category from the Parent dropdown.') . '</li>';
|
||||
|
||||
if ( 'category' == $taxonomy || 'post_tag' == $taxonomy )
|
||||
|
||||
$help .= '<ul>' .
|
||||
'<li>' . __( '<strong>Name</strong> - The name is how it appears on your site.' ) . '</li>';
|
||||
|
||||
if ( ! global_terms_enabled() )
|
||||
if ( 'category' == $taxonomy || 'post_tag' == $taxonomy )
|
||||
$help .= '<li>' . __( '<strong>Slug</strong> - The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . '</li>';
|
||||
|
||||
if ( 'category' == $taxonomy )
|
||||
$help .= '<li>' . __( '<strong>Parent</strong> - 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. To create a subcategory, just choose another category from the Parent dropdown.' ) . '</li>';
|
||||
|
||||
if ( 'category' == $taxonomy || 'post_tag' == $taxonomy )
|
||||
$help .= '<li>' . __( '<strong>Description</strong> - The description is not prominent by default; however, some themes may display it.' ) . '</li>' .
|
||||
$help .= '<li>' . __('<strong>Description</strong> - The description is not prominent by default; however, some themes may display it.') . '</li>' .
|
||||
'</ul>' .
|
||||
'<p>' . __( 'You can change the display of this screen using the Screen Options tab to set how many items are displayed per screen and to display/hide columns in the table.' ) . '</p>' .
|
||||
'<p><strong>' . __( 'For more information:' ) . '</strong></p>';
|
||||
'<p>' . __('You can change the display of this screen using the Screen Options tab to set how many items are displayed per screen and to display/hide columns in the table.') . '</p>' .
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>';
|
||||
|
||||
if ( 'category' == $taxonomy )
|
||||
$help .= '<p>' . __( '<a href="http://codex.wordpress.org/Posts_Categories_SubPanel" target="_blank">Documentation on Categories</a>' ) . '</p>';
|
||||
elseif ( 'link_category' == $taxonomy )
|
||||
$help .= '<p>' . __( '<a href="http://codex.wordpress.org/Links_Link_Categories_SubPanel" target="_blank">Documentation on Link Categories</a>' ) . '</p>';
|
||||
$help .= '<p>' . __('<a href="http://codex.wordpress.org/Manage_Categories_SubPanel" target="_blank">Categories Documentation</a>') . '</p>';
|
||||
else
|
||||
$help .= '<p>' . __( '<a href="http://codex.wordpress.org/Posts_Post_Tags_SubPanel" target="_blank">Documentation on Post Tags</a>' ) . '</p>';
|
||||
$help .= '<p>' . __('<a href="http://codex.wordpress.org/Post_Tags_SubPanel" target="_blank">Tags Documentation</a>') . '</p>';
|
||||
|
||||
$help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
|
||||
|
||||
@@ -223,9 +203,6 @@ if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $t
|
||||
|
||||
require_once ('admin-header.php');
|
||||
|
||||
if ( !current_user_can($tax->cap->edit_terms) )
|
||||
wp_die( __('You are not allowed to edit this item.') );
|
||||
|
||||
$messages[1] = __('Item added.');
|
||||
$messages[2] = __('Item deleted.');
|
||||
$messages[3] = __('Item updated.');
|
||||
@@ -238,11 +215,11 @@ $messages[6] = __('Items deleted.');
|
||||
<div class="wrap nosubsub">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title );
|
||||
if ( !empty($_REQUEST['s']) )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_REQUEST['s']) ) ); ?>
|
||||
if ( !empty($_GET['s']) )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_GET['s']) ) ); ?>
|
||||
</h2>
|
||||
|
||||
<?php if ( isset($_REQUEST['message']) && ( $msg = (int) $_REQUEST['message'] ) ) : ?>
|
||||
<?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
|
||||
<div id="message" class="updated"><p><?php echo $messages[$msg]; ?></p></div>
|
||||
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
|
||||
endif; ?>
|
||||
@@ -251,9 +228,11 @@ endif; ?>
|
||||
<form class="search-form" action="" method="get">
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
|
||||
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
|
||||
|
||||
<?php $wp_list_table->search_box( $tax->labels->search_items, 'tag' ); ?>
|
||||
|
||||
<p class="search-box">
|
||||
<label class="screen-reader-text" for="tag-search-input"><?php echo $tax->labels->search_items; ?>:</label>
|
||||
<input type="text" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<input type="submit" value="<?php echo esc_attr( $tax->labels->search_items ); ?>" class="button" />
|
||||
</p>
|
||||
</form>
|
||||
<br class="clear" />
|
||||
|
||||
@@ -261,11 +240,91 @@ endif; ?>
|
||||
|
||||
<div id="col-right">
|
||||
<div class="col-wrap">
|
||||
<form id="posts-filter" action="" method="post">
|
||||
<form id="posts-filter" action="" method="get">
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
|
||||
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
|
||||
<div class="tablenav">
|
||||
<?php
|
||||
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
|
||||
if ( empty($pagenum) )
|
||||
$pagenum = 1;
|
||||
|
||||
<?php $wp_list_table->display(); ?>
|
||||
$tags_per_page = (int) get_user_option( 'edit_' . $taxonomy . '_per_page' );
|
||||
|
||||
if ( empty($tags_per_page) || $tags_per_page < 1 )
|
||||
$tags_per_page = 20;
|
||||
|
||||
if ( 'post_tag' == $taxonomy ) {
|
||||
$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
|
||||
$tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
|
||||
} elseif ( 'category' == $taxonomy ) {
|
||||
$tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); // Old filter
|
||||
} else {
|
||||
$tags_per_page = apply_filters( 'edit_' . $taxonomy . '_per_page', $tags_per_page );
|
||||
}
|
||||
|
||||
$searchterms = !empty($_GET['s']) ? trim(stripslashes($_GET['s'])) : '';
|
||||
|
||||
$page_links = paginate_links( array(
|
||||
'base' => add_query_arg( 'pagenum', '%#%' ),
|
||||
'format' => '',
|
||||
'prev_text' => __('«'),
|
||||
'next_text' => __('»'),
|
||||
'total' => ceil(wp_count_terms($taxonomy, array('search' => $searchterms)) / $tags_per_page),
|
||||
'current' => $pagenum
|
||||
));
|
||||
|
||||
if ( $page_links )
|
||||
echo "<div class='tablenav-pages'>$page_links</div>";
|
||||
?>
|
||||
|
||||
<div class="alignleft actions">
|
||||
<select name="action">
|
||||
<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<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-tags'); ?>
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
<table class="widefat tag fixed" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php print_column_headers($current_screen); ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<?php print_column_headers($current_screen, false); ?>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody id="the-list" class="list:tag">
|
||||
<?php tag_rows( $pagenum, $tags_per_page, $searchterms, $taxonomy ); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="tablenav">
|
||||
<?php
|
||||
if ( $page_links )
|
||||
echo "<div class='tablenav-pages'>$page_links</div>";
|
||||
?>
|
||||
|
||||
<div class="alignleft actions">
|
||||
<select name="action2">
|
||||
<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<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" />
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
</form>
|
||||
@@ -293,7 +352,7 @@ do_action('after-' . $taxonomy . '-table', $taxonomy);
|
||||
|
||||
<?php
|
||||
|
||||
if ( !is_null( $tax->labels->popular_items ) ) {
|
||||
if ( !is_taxonomy_hierarchical($taxonomy) ) {
|
||||
if ( current_user_can( $tax->cap->edit_terms ) )
|
||||
$tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false, 'link' => 'edit' ) );
|
||||
else
|
||||
@@ -310,14 +369,10 @@ endif;
|
||||
}
|
||||
|
||||
if ( current_user_can($tax->cap->edit_terms) ) {
|
||||
// Back compat hooks. Deprecated in preference to {$taxonomy}_pre_add_form
|
||||
if ( 'category' == $taxonomy )
|
||||
do_action('add_category_form_pre', (object)array('parent' => 0) );
|
||||
elseif ( 'link_category' == $taxonomy )
|
||||
do_action('add_link_category_form_pre', (object)array('parent' => 0) );
|
||||
do_action('add_category_form_pre', (object)array('parent' => 0) ); // Back compat hook. Deprecated in preference to $taxonomy_pre_add_form
|
||||
else
|
||||
do_action('add_tag_form_pre', $taxonomy);
|
||||
|
||||
do_action('add_tag_form_pre', $taxonomy); // Back compat hook. Applies to all Taxonomies -not- categories
|
||||
do_action($taxonomy . '_pre_add_form', $taxonomy);
|
||||
?>
|
||||
|
||||
@@ -327,7 +382,6 @@ if ( current_user_can($tax->cap->edit_terms) ) {
|
||||
<input type="hidden" name="action" value="add-tag" />
|
||||
<input type="hidden" name="screen" value="<?php echo esc_attr($current_screen->id); ?>" />
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
|
||||
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
|
||||
<?php wp_nonce_field('add-tag'); ?>
|
||||
|
||||
<div class="form-field form-required">
|
||||
@@ -341,7 +395,7 @@ if ( current_user_can($tax->cap->edit_terms) ) {
|
||||
<input name="slug" id="tag-slug" type="text" value="" size="40" />
|
||||
<p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
|
||||
</div>
|
||||
<?php endif; // global_terms_enabled() ?>
|
||||
<?php endif; // is_multisite() ?>
|
||||
<?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
|
||||
<div class="form-field">
|
||||
<label for="parent"><?php _ex('Parent', 'Taxonomy Parent'); ?></label>
|
||||
@@ -361,17 +415,13 @@ if ( current_user_can($tax->cap->edit_terms) ) {
|
||||
if ( ! is_taxonomy_hierarchical($taxonomy) )
|
||||
do_action('add_tag_form_fields', $taxonomy);
|
||||
do_action($taxonomy . '_add_form_fields', $taxonomy);
|
||||
|
||||
submit_button( $tax->labels->add_new_item, 'button' );
|
||||
|
||||
// Back compat hooks. Deprecated in preference to {$taxonomy}_add_form
|
||||
?>
|
||||
<p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" /></p>
|
||||
<?php
|
||||
if ( 'category' == $taxonomy )
|
||||
do_action('edit_category_form', (object)array('parent' => 0) );
|
||||
elseif ( 'link_category' == $taxonomy )
|
||||
do_action('edit_link_category_form', (object)array('parent' => 0) );
|
||||
do_action('edit_category_form', (object)array('parent' => 0) ); // Back compat hook. Deprecated in preference to $taxonomy_add_form
|
||||
else
|
||||
do_action('add_tag_form', $taxonomy);
|
||||
|
||||
do_action('add_tag_form', $taxonomy); // Back compat hook. Applies to all Taxonomies -not- categories
|
||||
do_action($taxonomy . '_add_form', $taxonomy);
|
||||
?>
|
||||
</form></div>
|
||||
@@ -383,7 +433,7 @@ do_action($taxonomy . '_add_form', $taxonomy);
|
||||
</div><!-- /col-container -->
|
||||
</div><!-- /wrap -->
|
||||
|
||||
<?php $wp_list_table->inline_edit(); ?>
|
||||
<?php inline_edit_term_row('edit-tags', $taxonomy); ?>
|
||||
|
||||
<?php
|
||||
break;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once( './admin.php' );
|
||||
require_once('./admin.php');
|
||||
|
||||
if ( !isset($_GET['post_type']) )
|
||||
$post_type = 'post';
|
||||
@@ -15,25 +15,20 @@ elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true )
|
||||
$post_type = $_GET['post_type'];
|
||||
else
|
||||
wp_die( __('Invalid post type') );
|
||||
|
||||
$_GET['post_type'] = $post_type;
|
||||
|
||||
$post_type_object = get_post_type_object( $post_type );
|
||||
$post_type_object = get_post_type_object($post_type);
|
||||
|
||||
if ( !current_user_can($post_type_object->cap->edit_posts) )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
$wp_list_table = _get_list_table('WP_Posts_List_Table');
|
||||
$pagenum = $wp_list_table->get_pagenum();
|
||||
|
||||
// Back-compat for viewing comments of an entry
|
||||
foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) {
|
||||
if ( ! empty( $_REQUEST[ $_redirect ] ) ) {
|
||||
wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) );
|
||||
exit;
|
||||
}
|
||||
if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['page_id'] ) ) ) {
|
||||
wp_redirect( admin_url('edit-comments.php?p=' . $_redirect ) );
|
||||
exit;
|
||||
} else {
|
||||
unset( $_redirect );
|
||||
}
|
||||
unset( $_redirect );
|
||||
|
||||
if ( 'post' != $post_type ) {
|
||||
$parent_file = "edit.php?post_type=$post_type";
|
||||
@@ -45,32 +40,33 @@ if ( 'post' != $post_type ) {
|
||||
$post_new_file = 'post-new.php';
|
||||
}
|
||||
|
||||
$doaction = $wp_list_table->current_action();
|
||||
$pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
|
||||
if ( empty($pagenum) )
|
||||
$pagenum = 1;
|
||||
$per_page = 'edit_' . $post_type . '_per_page';
|
||||
$per_page = (int) get_user_option( $per_page );
|
||||
if ( empty( $per_page ) || $per_page < 1 )
|
||||
$per_page = 20;
|
||||
// @todo filter based on type
|
||||
$per_page = apply_filters( 'edit_posts_per_page', $per_page );
|
||||
|
||||
if ( $doaction ) {
|
||||
// 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() );
|
||||
$sendback = add_query_arg( 'paged', $pagenum, $sendback );
|
||||
|
||||
if ( strpos($sendback, 'post.php') !== false )
|
||||
$sendback = admin_url($post_new_file);
|
||||
|
||||
if ( 'delete_all' == $doaction ) {
|
||||
$post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_REQUEST['post_status']);
|
||||
if ( get_post_status_object($post_status) ) // Check the post status exists first
|
||||
$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s", $post_type, $post_status ) );
|
||||
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=%s AND post_status = %s", $post_type, $post_status ) );
|
||||
$doaction = 'delete';
|
||||
} elseif ( isset( $_REQUEST['media'] ) ) {
|
||||
$post_ids = $_REQUEST['media'];
|
||||
} elseif ( isset( $_REQUEST['ids'] ) ) {
|
||||
$post_ids = explode( ',', $_REQUEST['ids'] );
|
||||
} elseif ( !empty( $_REQUEST['post'] ) ) {
|
||||
$post_ids = array_map('intval', $_REQUEST['post']);
|
||||
}
|
||||
|
||||
if ( !isset( $post_ids ) ) {
|
||||
wp_redirect( $sendback );
|
||||
exit;
|
||||
} 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?post_type=$post_type") );
|
||||
}
|
||||
|
||||
switch ( $doaction ) {
|
||||
@@ -85,7 +81,7 @@ if ( $doaction ) {
|
||||
|
||||
$trashed++;
|
||||
}
|
||||
$sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids) ), $sendback );
|
||||
$sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids)), $sendback );
|
||||
break;
|
||||
case 'untrash':
|
||||
$untrashed = 0;
|
||||
@@ -120,7 +116,7 @@ if ( $doaction ) {
|
||||
$sendback = add_query_arg('deleted', $deleted, $sendback);
|
||||
break;
|
||||
case 'edit':
|
||||
$done = bulk_edit_posts($_REQUEST);
|
||||
$done = bulk_edit_posts($_GET);
|
||||
|
||||
if ( is_array($done) ) {
|
||||
$done['updated'] = count( $done['updated'] );
|
||||
@@ -131,24 +127,32 @@ if ( $doaction ) {
|
||||
break;
|
||||
}
|
||||
|
||||
$sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback );
|
||||
if ( isset($_GET['action']) )
|
||||
$sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback );
|
||||
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
} elseif ( ! empty($_REQUEST['_wp_http_referer']) ) {
|
||||
} elseif ( ! empty($_GET['_wp_http_referer']) ) {
|
||||
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
wp_enqueue_script('inline-edit-post');
|
||||
|
||||
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
|
||||
if ( $pagenum > $total_pages && $total_pages > 0 ) {
|
||||
wp_redirect( add_query_arg( 'paged', $total_pages ) );
|
||||
exit;
|
||||
$user_posts = false;
|
||||
if ( !current_user_can($post_type_object->cap->edit_others_posts) ) {
|
||||
$user_posts_count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(1) FROM $wpdb->posts WHERE post_type = '%s' AND post_status NOT IN ('trash', 'auto-draft') AND post_author = %d", $post_type, $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;
|
||||
}
|
||||
|
||||
wp_enqueue_script('inline-edit-post');
|
||||
$avail_post_stati = wp_edit_posts_query();
|
||||
|
||||
if ( $post_type_object->hierarchical )
|
||||
$num_pages = ceil($wp_query->post_count / $per_page);
|
||||
else
|
||||
$num_pages = $wp_query->max_num_pages;
|
||||
|
||||
$title = $post_type_object->labels->name;
|
||||
|
||||
@@ -170,67 +174,70 @@ if ( 'post' == $post_type ) {
|
||||
'</ul>' .
|
||||
'<p>' . __('You can also edit multiple posts at once. Select the posts you want to edit using the checkboxes, select Edit from the Bulk Actions menu and click Apply. You will be able to change the metadata (categories, author, etc.) for all selected posts at once. To remove a post from the grouping, just click the x next to its name in the Bulk Edit area that appears.') . '</p>' .
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Posts_Posts_SubPanel" target="_blank">Documentation on Managing Posts</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Posts_Edit_SubPanel" target="_blank">Edit Posts Documentation</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
} elseif ( 'page' == $post_type ) {
|
||||
add_contextual_help($current_screen,
|
||||
'<p>' . __('Pages are similar to Posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest Pages under other Pages by making one the “Parent” of the other, creating a group of Pages.') . '</p>' .
|
||||
'<p>' . __('Pages are similar to to Posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest Pages under other Pages by making one the “Parent” of the other, creating a group of Pages.') . '</p>' .
|
||||
'<p>' . __('Managing Pages is very similar to managing Posts, and the screens can be customized in the same way.') . '</p>' .
|
||||
'<p>' . __('You can also perform the same types of actions, including narrowing the list by using the filters, acting on a Page using the action links that appear when you hover over a row, or using the Bulk Actions menu to edit the metadata for multiple Pages at once.') . '</p>' .
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Pages_SubPanel" target="_blank">Documentation on Managing Pages</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Edit_SubPanel" target="_blank">Page Management Documentation</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
}
|
||||
|
||||
add_screen_option( 'per_page', array('label' => $title, 'default' => 20) );
|
||||
|
||||
require_once('./admin-header.php');
|
||||
?>
|
||||
|
||||
if ( empty($_GET['mode']) )
|
||||
$mode = 'list';
|
||||
else
|
||||
$mode = esc_attr($_GET['mode']); ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $post_type_object->labels->name ); ?> <a href="<?php echo $post_new_file ?>" class="button add-new-h2"><?php echo esc_html($post_type_object->labels->add_new); ?></a> <?php
|
||||
if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
|
||||
if ( isset($_GET['s']) && $_GET['s'] )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() ); ?>
|
||||
</h2>
|
||||
|
||||
<?php
|
||||
if ( isset($_REQUEST['posted']) && $_REQUEST['posted'] ) : $_REQUEST['posted'] = (int) $_REQUEST['posted']; ?>
|
||||
<div id="message" class="updated"><p><strong><?php _e('This has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_REQUEST['posted'] ); ?>"><?php _e('View Post'); ?></a> | <a href="<?php echo get_edit_post_link( $_REQUEST['posted'] ); ?>"><?php _e('Edit Post'); ?></a></p></div>
|
||||
if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
|
||||
<div id="message" class="updated"><p><strong><?php _e('This has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View Post'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit Post'); ?></a></p></div>
|
||||
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
|
||||
endif; ?>
|
||||
|
||||
<?php if ( isset($_REQUEST['locked']) || isset($_REQUEST['skipped']) || isset($_REQUEST['updated']) || isset($_REQUEST['deleted']) || isset($_REQUEST['trashed']) || isset($_REQUEST['untrashed']) ) { ?>
|
||||
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?>
|
||||
<div id="message" class="updated"><p>
|
||||
<?php if ( isset($_REQUEST['updated']) && (int) $_REQUEST['updated'] ) {
|
||||
printf( _n( '%s post updated.', '%s posts updated.', $_REQUEST['updated'] ), number_format_i18n( $_REQUEST['updated'] ) );
|
||||
unset($_REQUEST['updated']);
|
||||
<?php if ( isset($_GET['updated']) && (int) $_GET['updated'] ) {
|
||||
printf( _n( '%s post updated.', '%s posts updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
|
||||
unset($_GET['updated']);
|
||||
}
|
||||
|
||||
if ( isset($_REQUEST['skipped']) && (int) $_REQUEST['skipped'] )
|
||||
unset($_REQUEST['skipped']);
|
||||
if ( isset($_GET['skipped']) && (int) $_GET['skipped'] )
|
||||
unset($_GET['skipped']);
|
||||
|
||||
if ( isset($_REQUEST['locked']) && (int) $_REQUEST['locked'] ) {
|
||||
printf( _n( '%s item not updated, somebody is editing it.', '%s items not updated, somebody is editing them.', $_REQUEST['locked'] ), number_format_i18n( $_REQUEST['locked'] ) );
|
||||
unset($_REQUEST['locked']);
|
||||
if ( isset($_GET['locked']) && (int) $_GET['locked'] ) {
|
||||
printf( _n( '%s item not updated, somebody is editing it.', '%s items not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) );
|
||||
unset($_GET['locked']);
|
||||
}
|
||||
|
||||
if ( isset($_REQUEST['deleted']) && (int) $_REQUEST['deleted'] ) {
|
||||
printf( _n( 'Item permanently deleted.', '%s items permanently deleted.', $_REQUEST['deleted'] ), number_format_i18n( $_REQUEST['deleted'] ) );
|
||||
unset($_REQUEST['deleted']);
|
||||
if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
|
||||
printf( _n( 'Item permanently deleted.', '%s items permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
|
||||
unset($_GET['deleted']);
|
||||
}
|
||||
|
||||
if ( isset($_REQUEST['trashed']) && (int) $_REQUEST['trashed'] ) {
|
||||
printf( _n( 'Item moved to the Trash.', '%s items moved to the Trash.', $_REQUEST['trashed'] ), number_format_i18n( $_REQUEST['trashed'] ) );
|
||||
$ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
|
||||
if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
|
||||
printf( _n( 'Item moved to the trash.', '%s items 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?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", "bulk-posts" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
unset($_REQUEST['trashed']);
|
||||
unset($_GET['trashed']);
|
||||
}
|
||||
|
||||
if ( isset($_REQUEST['untrashed']) && (int) $_REQUEST['untrashed'] ) {
|
||||
printf( _n( 'Item restored from the Trash.', '%s items restored from the Trash.', $_REQUEST['untrashed'] ), number_format_i18n( $_REQUEST['untrashed'] ) );
|
||||
unset($_REQUEST['undeleted']);
|
||||
if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) {
|
||||
printf( _n( 'Item restored from the Trash.', '%s items 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'] );
|
||||
@@ -238,26 +245,217 @@ $_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated'
|
||||
</p></div>
|
||||
<?php } ?>
|
||||
|
||||
<?php $wp_list_table->views(); ?>
|
||||
<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_type, 'readable' );
|
||||
$class = '';
|
||||
$allposts = '';
|
||||
|
||||
<?php $wp_list_table->search_box( $post_type_object->labels->search_items, 'post' ); ?>
|
||||
if ( $user_posts ) {
|
||||
if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user->ID ) )
|
||||
$class = ' class="current"';
|
||||
$status_links[] = "<li><a href='edit.php?post_type=$post_type&author=$current_user->ID'$class>" . sprintf( _nx( 'Mine <span class="count">(%s)</span>', 'Mine <span class="count">(%s)</span>', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . '</a>';
|
||||
$allposts = '&all_posts=1';
|
||||
}
|
||||
|
||||
<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_REQUEST['post_status']) ? esc_attr($_REQUEST['post_status']) : 'all'; ?>" />
|
||||
$total_posts = array_sum( (array) $num_posts );
|
||||
|
||||
// Subtract post types that are not included in the admin all list.
|
||||
foreach ( get_post_stati( array('show_in_admin_all_list' => false) ) as $state )
|
||||
$total_posts -= $num_posts->$state;
|
||||
|
||||
$class = empty($class) && empty($_GET['post_status']) ? ' class="current"' : '';
|
||||
$status_links[] = "<li><a href='edit.php?post_type=$post_type{$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 ( get_post_stati(array('show_in_admin_status_list' => true), 'objects') as $status ) {
|
||||
$class = '';
|
||||
|
||||
$status_name = $status->name;
|
||||
|
||||
if ( !in_array( $status_name, $avail_post_stati ) )
|
||||
continue;
|
||||
|
||||
if ( empty( $num_posts->$status_name ) )
|
||||
continue;
|
||||
|
||||
if ( isset($_GET['post_status']) && $status_name == $_GET['post_status'] )
|
||||
$class = ' class="current"';
|
||||
|
||||
$status_links[] = "<li><a href='edit.php?post_status=$status_name&post_type=$post_type'$class>" . sprintf( _n( $status->label_count[0], $status->label_count[1], $num_posts->$status_name ), number_format_i18n( $num_posts->$status_name ) ) . '</a>';
|
||||
}
|
||||
echo implode( " |</li>\n", $status_links ) . '</li>';
|
||||
unset( $status_links );
|
||||
endif;
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<p class="search-box">
|
||||
<label class="screen-reader-text" for="post-search-input"><?php echo $post_type_object->labels->search_items; ?>:</label>
|
||||
<input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />
|
||||
<input type="submit" value="<?php echo esc_attr( $post_type_object->labels->search_items ); ?>" 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'; ?>" />
|
||||
<input type="hidden" name="post_type" class="post_type_page" value="<?php echo $post_type; ?>" />
|
||||
<?php if ( ! empty( $_REQUEST['show_sticky'] ) ) { ?>
|
||||
<input type="hidden" name="show_sticky" value="1" />
|
||||
<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
|
||||
|
||||
<?php if ( have_posts() ) { ?>
|
||||
|
||||
<div class="tablenav">
|
||||
<?php
|
||||
$page_links = paginate_links( array(
|
||||
'base' => add_query_arg( 'paged', '%#%' ),
|
||||
'format' => '',
|
||||
'prev_text' => __('«'),
|
||||
'next_text' => __('»'),
|
||||
'total' => $num_pages,
|
||||
'current' => $pagenum
|
||||
));
|
||||
|
||||
$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 } ?>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<?php wp_nonce_field('bulk-posts'); ?>
|
||||
|
||||
<?php // view filters
|
||||
if ( !is_singular() ) {
|
||||
$arc_query = $wpdb->prepare("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = %s ORDER BY post_date DESC", $post_type);
|
||||
|
||||
$arc_result = $wpdb->get_results( $arc_query );
|
||||
|
||||
$month_count = count($arc_result);
|
||||
|
||||
if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) {
|
||||
$m = isset($_GET['m']) ? (int)$_GET['m'] : 0;
|
||||
?>
|
||||
<select name='m'>
|
||||
<option<?php selected( $m, 0 ); ?> value='0'><?php _e('Show all dates'); ?></option>
|
||||
<?php
|
||||
foreach ($arc_result as $arc_row) {
|
||||
if ( $arc_row->yyear == 0 )
|
||||
continue;
|
||||
$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
|
||||
|
||||
if ( $arc_row->yyear . $arc_row->mmonth == $m )
|
||||
$default = ' selected="selected"';
|
||||
else
|
||||
$default = '';
|
||||
|
||||
echo "<option$default value='" . esc_attr("$arc_row->yyear$arc_row->mmonth") . "'>";
|
||||
echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";
|
||||
echo "</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php } ?>
|
||||
|
||||
<?php $wp_list_table->display(); ?>
|
||||
<?php
|
||||
if ( is_object_in_taxonomy($post_type, 'category') ) {
|
||||
$dropdown_options = array('show_option_all' => __('View all categories'), 'hide_empty' => 0, 'hierarchical' => 1,
|
||||
'show_count' => 0, 'orderby' => 'name', 'selected' => $cat);
|
||||
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($post_type_object->cap->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>
|
||||
|
||||
<?php if ( $page_links ) { ?>
|
||||
<div class="tablenav-pages"><?php
|
||||
$count_posts = $post_type_object->hierarchical ? $wp_query->post_count : $wp_query->found_posts;
|
||||
$page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
|
||||
number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
|
||||
number_format_i18n( min( $pagenum * $per_page, $count_posts ) ),
|
||||
number_format_i18n( $count_posts ),
|
||||
$page_links
|
||||
);
|
||||
echo $page_links_text;
|
||||
?></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( !$post_type_object->hierarchical ) {
|
||||
?>
|
||||
|
||||
<div class="view-switch">
|
||||
<a href="<?php echo esc_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'list' == $mode ) echo 'class="current"'; ?> id="view-switch-list" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e('List View') ?>" alt="<?php _e('List View') ?>" /></a>
|
||||
<a href="<?php echo esc_url(add_query_arg('mode', 'excerpt', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'excerpt' == $mode ) echo 'class="current"'; ?> id="view-switch-excerpt" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e('Excerpt View') ?>" alt="<?php _e('Excerpt View') ?>" /></a>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php include( './edit-post-rows.php' ); ?>
|
||||
|
||||
<div class="tablenav">
|
||||
|
||||
<?php
|
||||
if ( $page_links )
|
||||
echo "<div class='tablenav-pages'>$page_links_text</div>";
|
||||
?>
|
||||
|
||||
<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 } ?>
|
||||
</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($post_type_object->cap->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" />
|
||||
</div>
|
||||
|
||||
<?php } else { // have_posts() ?>
|
||||
<div class="clear"></div>
|
||||
<p><?php
|
||||
if ( isset($_GET['post_status']) && 'trash' == $_GET['post_status'] )
|
||||
echo $post_type_object->labels->not_found_in_trash;
|
||||
else
|
||||
echo $post_type_object->labels->not_found;
|
||||
?></p>
|
||||
<?php } ?>
|
||||
|
||||
</form>
|
||||
|
||||
<?php
|
||||
if ( $wp_list_table->has_items() )
|
||||
$wp_list_table->inline_edit();
|
||||
?>
|
||||
<?php inline_edit_row( $current_screen ); ?>
|
||||
|
||||
<div id="ajax-response"></div>
|
||||
<br class="clear" />
|
||||
|
||||
@@ -16,102 +16,52 @@ if ( !current_user_can('export') )
|
||||
require_once('./includes/export.php');
|
||||
$title = __('Export');
|
||||
|
||||
function add_js() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
jQuery(document).ready(function($){
|
||||
var form = $('#export-filters'),
|
||||
filters = form.find('.export-filters');
|
||||
filters.hide();
|
||||
form.find('input:radio').change(function() {
|
||||
filters.slideUp('fast');
|
||||
switch ( $(this).val() ) {
|
||||
case 'posts': $('#post-filters').slideDown(); break;
|
||||
case 'pages': $('#page-filters').slideDown(); break;
|
||||
}
|
||||
});
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
add_action( 'admin_head', 'add_js' );
|
||||
|
||||
add_contextual_help( $current_screen,
|
||||
'<p>' . __('You can export a file of your site’s content in order to import it into another installation or platform. The export file will be an XML file format called WXR. Posts, pages, comments, custom fields, categories, and tags can be included. You can choose for the WXR file to include only certain posts or pages by setting the dropdown filters to limit the export by category, author, date range by month, or publishing status.') . '</p>' .
|
||||
add_contextual_help($current_screen,
|
||||
'<p>' . __('You can export a file of your site’s content in order to import it into another installation or platform. The export file will be an XML file format called WXR. Posts, pages, comments, custom fields, categories, and tags can be included. You can set filters to have the WXR file only include a certain date, author, category, tag, all posts or all pages, certain publishing statuses.') . '</p>' .
|
||||
'<p>' . __('Once generated, your WXR file can be imported by another WordPress site or by another blogging platform able to access this format.') . '</p>' .
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Tools_Export_SubPanel" target="_blank">Documentation on Export</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Tools_Export_SubPanel" target="_blank">Export Documentation</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
|
||||
if ( isset( $_GET['download'] ) ) {
|
||||
$args = array();
|
||||
|
||||
if ( ! isset( $_GET['content'] ) || 'all' == $_GET['content'] ) {
|
||||
$args['content'] = 'all';
|
||||
} else if ( 'posts' == $_GET['content'] ) {
|
||||
$args['content'] = 'post';
|
||||
|
||||
if ( $_GET['cat'] )
|
||||
$args['category'] = (int) $_GET['cat'];
|
||||
|
||||
if ( $_GET['post_author'] )
|
||||
$args['author'] = (int) $_GET['post_author'];
|
||||
|
||||
if ( $_GET['post_start_date'] || $_GET['post_end_date'] ) {
|
||||
$args['start_date'] = $_GET['post_start_date'];
|
||||
$args['end_date'] = $_GET['post_end_date'];
|
||||
$author = isset($_GET['author']) ? $_GET['author'] : 'all';
|
||||
$taxonomy = array();
|
||||
foreach ( get_taxonomies( array( 'show_ui' => true ) ) as $tax )
|
||||
$taxonomy[ $tax ] = ! empty( $_GET['taxonomy'][ $tax ] ) ? $_GET['taxonomy'][ $tax ] : 'all';
|
||||
$post_type = isset($_GET['post_type']) ? stripslashes_deep($_GET['post_type']) : 'all';
|
||||
$status = isset($_GET['status']) ? stripslashes_deep($_GET['status']) : 'all';
|
||||
$mm_start = isset($_GET['mm_start']) ? $_GET['mm_start'] : 'all';
|
||||
$mm_end = isset($_GET['mm_end']) ? $_GET['mm_end'] : 'all';
|
||||
if( $mm_start != 'all' ) {
|
||||
$start_date = sprintf( "%04d-%02d-%02d", substr( $mm_start, 0, 4 ), substr( $mm_start, 5, 2 ), 1 );
|
||||
} else {
|
||||
$start_date = 'all';
|
||||
}
|
||||
if( $mm_end != 'all' ) {
|
||||
$end_date = sprintf( "%04d-%02d-%02d", substr( $mm_end, 0, 4 ), substr( $mm_end, 5, 2 ), 1 );
|
||||
} else {
|
||||
$end_date = 'all';
|
||||
}
|
||||
|
||||
if ( $_GET['post_status'] )
|
||||
$args['status'] = $_GET['post_status'];
|
||||
} else if ( 'pages' == $_GET['content'] ) {
|
||||
$args['content'] = 'page';
|
||||
|
||||
if ( $_GET['page_author'] )
|
||||
$args['author'] = (int) $_GET['page_author'];
|
||||
|
||||
if ( $_GET['page_start_date'] || $_GET['page_end_date'] ) {
|
||||
$args['start_date'] = $_GET['page_start_date'];
|
||||
$args['end_date'] = $_GET['page_end_date'];
|
||||
}
|
||||
|
||||
if ( $_GET['page_status'] )
|
||||
$args['status'] = $_GET['page_status'];
|
||||
} else {
|
||||
$args['content'] = $_GET['content'];
|
||||
}
|
||||
|
||||
export_wp( $args );
|
||||
export_wp( array( 'author' => $author, 'taxonomy' => $taxonomy, 'post_type' => $post_type, 'post_status' => $status, 'start_date' => $start_date, 'end_date' => $end_date ) );
|
||||
die();
|
||||
}
|
||||
|
||||
require_once ('admin-header.php');
|
||||
|
||||
function export_date_options() {
|
||||
global $wpdb, $wp_locale;
|
||||
|
||||
$months = $wpdb->get_results( "
|
||||
SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
|
||||
FROM $wpdb->posts
|
||||
WHERE post_type = 'post' AND post_status != 'auto-draft'
|
||||
ORDER BY post_date DESC
|
||||
" );
|
||||
|
||||
$month_count = count( $months );
|
||||
if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
|
||||
return;
|
||||
|
||||
foreach ( $months as $date ) {
|
||||
if ( 0 == $date->year )
|
||||
continue;
|
||||
|
||||
$month = zeroise( $date->month, 2 );
|
||||
echo '<option value="' . $date->year . '-' . $month . '" />' . $wp_locale->get_month( $month ) . ' ' . $date->year . '</option>';
|
||||
$dateoptions = $edateoptions = '';
|
||||
$types = "'" . implode("', '", get_post_types( array( 'public' => true, 'can_export' => true ), 'names' )) . "'";
|
||||
$stati = "'" . implode("', '", get_post_stati( array( 'internal' => false ), 'names' )) . "'";
|
||||
if ( $monthyears = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, YEAR(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `eyear`, MONTH(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `emonth` FROM $wpdb->posts WHERE post_type IN ($types) AND post_status IN ($stati) ORDER BY post_date ASC ") ) {
|
||||
foreach ( $monthyears as $k => $monthyear )
|
||||
$monthyears[$k]->lmonth = $wp_locale->get_month( $monthyear->month, 2 );
|
||||
for( $s = 0, $e = count( $monthyears ) - 1; $e >= 0; $s++, $e-- ) {
|
||||
$dateoptions .= "\t<option value=\"" . $monthyears[$s]->year . '-' . zeroise( $monthyears[$s]->month, 2 ) . '">' . $monthyears[$s]->lmonth . ' ' . $monthyears[$s]->year . "</option>\n";
|
||||
$edateoptions .= "\t<option value=\"" . $monthyears[$e]->eyear . '-' . zeroise( $monthyears[$e]->emonth, 2 ) . '">' . $monthyears[$e]->lmonth . ' ' . $monthyears[$e]->year . "</option>\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
@@ -120,87 +70,80 @@ function export_date_options() {
|
||||
|
||||
<p><?php _e('When you click the button below WordPress will create an XML file for you to save to your computer.'); ?></p>
|
||||
<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags.'); ?></p>
|
||||
<p><?php _e('Once you’ve saved the download file, you can use the Import function in another WordPress installation to import this site.'); ?></p>
|
||||
<p><?php _e('Once you’ve saved the download file, you can use the Import function on another WordPress site to import this site.'); ?></p>
|
||||
<form action="" method="get">
|
||||
<h3><?php _e('Filters'); ?></h3>
|
||||
|
||||
<h3><?php _e( 'Choose what to export' ); ?></h3>
|
||||
<form action="" method="get" id="export-filters">
|
||||
<table class="form-table">
|
||||
<tr>
|
||||
<th><label for="mm_start"><?php _e('Start Date'); ?></label></th>
|
||||
<td>
|
||||
<select name="mm_start" id="mm_start">
|
||||
<option value="all" selected="selected"><?php _e('All Dates'); ?></option>
|
||||
<?php echo $dateoptions; ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="mm_end" id="mm_end"><?php _e('End Date'); ?></label></th>
|
||||
<td>
|
||||
<select name="mm_end" id="mm_end">
|
||||
<option value="all" selected="selected"><?php _e('All Dates'); ?></option>
|
||||
<?php echo $edateoptions; ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="author"><?php _e('Authors'); ?></label></th>
|
||||
<td>
|
||||
<select name="author" id="author">
|
||||
<option value="all" selected="selected"><?php _e('All Authors'); ?></option>
|
||||
<?php
|
||||
$authors = $wpdb->get_results( "SELECT DISTINCT u.id, u.display_name FROM $wpdb->users u INNER JOIN $wpdb->posts p WHERE u.id = p.post_author ORDER BY u.display_name" );
|
||||
foreach ( (array) $authors as $author ) {
|
||||
echo "<option value='{$author->id}'>{$author->display_name}</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php foreach ( get_taxonomies( array( 'show_ui' => true ), 'objects' ) as $tax_obj ) {
|
||||
$term_dropdown = wp_dropdown_categories( array( 'taxonomy' => $tax_obj->name, 'hide_if_empty' => true, 'show_option_all' => __( 'All Terms' ), 'name' => 'taxonomy[' . $tax_obj->name . ']', 'id' => 'taxonomy-' . $tax_obj->name, 'class' => '', 'echo' => false ) );
|
||||
if ( $term_dropdown )
|
||||
echo '<tr><th><label for="taxonomy-' . $tax_obj->name . '">' . $tax_obj->labels->name . '</label></th><td>' . $term_dropdown . '</td></tr>';
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<th><label for="post_type"><?php _e('Content Types'); ?></label></th>
|
||||
<td>
|
||||
<select name="post_type" id="post_type">
|
||||
<option value="all" selected="selected"><?php _e('All Content'); ?></option>
|
||||
<?php foreach ( get_post_types( array( 'public' => true, 'can_export' => true ), 'objects' ) as $post_type_obj ) { ?>
|
||||
<option value="<?php echo $post_type_obj->name; ?>"><?php echo $post_type_obj->labels->name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="status"><?php _e('Statuses'); ?></label></th>
|
||||
<td>
|
||||
<select name="status" id="status">
|
||||
<option value="all" selected="selected"><?php _e('All Statuses'); ?></option>
|
||||
<?php foreach ( get_post_stati( array( 'internal' => false ), 'objects' ) as $post_status_obj ) { ?>
|
||||
<option value="<?php echo $post_status_obj->name; ?>"><?php echo $post_status_obj->label; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="submit"><input type="submit" name="submit" class="button" value="<?php esc_attr_e('Download Export File'); ?>" />
|
||||
<input type="hidden" name="download" value="true" />
|
||||
<p><label><input type="radio" name="content" value="all" checked="checked" /> <?php _e( 'All content' ); ?></label>
|
||||
<span class="description"><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus and custom posts.' ); ?></span></p>
|
||||
|
||||
<p><label><input type="radio" name="content" value="posts" /> <?php _e( 'Posts' ); ?></label></p>
|
||||
<ul id="post-filters" class="export-filters">
|
||||
<li>
|
||||
<label><?php _e( 'Categories:' ); ?></label>
|
||||
<?php wp_dropdown_categories( array( 'show_option_all' => __('All') ) ); ?>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php _e( 'Authors:' ); ?></label>
|
||||
<?php
|
||||
$authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" );
|
||||
wp_dropdown_users( array( 'include' => $authors, 'name' => 'post_author', 'multi' => true, 'show_option_all' => __('All') ) );
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php _e( 'Date range:' ); ?></label>
|
||||
<select name="post_start_date">
|
||||
<option value="0"><?php _e( 'Start Date' ); ?></option>
|
||||
<?php export_date_options(); ?>
|
||||
</select>
|
||||
<select name="post_end_date">
|
||||
<option value="0"><?php _e( 'End Date' ); ?></option>
|
||||
<?php export_date_options(); ?>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php _e( 'Status:' ); ?></label>
|
||||
<select name="post_status">
|
||||
<option value="0"><?php _e( 'All' ); ?></option>
|
||||
<?php $post_stati = get_post_stati( array( 'internal' => false ), 'objects' );
|
||||
foreach ( $post_stati as $status ) : ?>
|
||||
<option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p><label><input type="radio" name="content" value="pages" /> <?php _e( 'Pages' ); ?></label></p>
|
||||
<ul id="page-filters" class="export-filters">
|
||||
<li>
|
||||
<label><?php _e( 'Authors:' ); ?></label>
|
||||
<?php
|
||||
$authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" );
|
||||
wp_dropdown_users( array( 'include' => $authors, 'name' => 'page_author', 'multi' => true, 'show_option_all' => __('All') ) );
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php _e( 'Date range:' ); ?></label>
|
||||
<select name="page_start_date">
|
||||
<option value="0"><?php _e( 'Start Date' ); ?></option>
|
||||
<?php export_date_options(); ?>
|
||||
</select>
|
||||
<select name="page_end_date">
|
||||
<option value="0"><?php _e( 'End Date' ); ?></option>
|
||||
<?php export_date_options(); ?>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php _e( 'Status:' ); ?></label>
|
||||
<select name="page_status">
|
||||
<option value="0"><?php _e( 'All' ); ?></option>
|
||||
<?php foreach ( $post_stati as $status ) : ?>
|
||||
<option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php foreach ( get_post_types( array( '_builtin' => false, 'can_export' => true ), 'objects' ) as $post_type ) : ?>
|
||||
<p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php submit_button( __('Download Export File'), 'secondary' ); ?>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php include('admin-footer.php'); ?>
|
||||
<?php
|
||||
|
||||
|
||||
include ('admin-footer.php');
|
||||
?>
|
||||
|
||||
|
Before Width: | Height: | Size: 337 B After Width: | Height: | Size: 160 B |
BIN
wp-admin/images/button-grad-active-vs.png
Normal file
|
After Width: | Height: | Size: 152 B |
BIN
wp-admin/images/button-grad-vs.png
Normal file
|
After Width: | Height: | Size: 155 B |
|
Before Width: | Height: | Size: 444 B After Width: | Height: | Size: 291 B |
BIN
wp-admin/images/fav-arrow-vs-rtl.gif
Normal file
|
After Width: | Height: | Size: 338 B |
BIN
wp-admin/images/fav-arrow-vs.gif
Normal file
|
After Width: | Height: | Size: 338 B |
BIN
wp-admin/images/fav-top-vs.gif
Normal file
|
After Width: | Height: | Size: 101 B |
BIN
wp-admin/images/list-vs.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 245 B |
|
Before Width: | Height: | Size: 245 B |
BIN
wp-admin/images/screen-options-right-up.gif
Normal file
|
After Width: | Height: | Size: 125 B |
BIN
wp-admin/images/screen-options-right.gif
Normal file
|
After Width: | Height: | Size: 178 B |
|
Before Width: | Height: | Size: 152 B |
|
Before Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 54 B |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
BIN
wp-admin/images/visit-site-button-grad-vs.gif
Normal file
|
After Width: | Height: | Size: 193 B |
BIN
wp-admin/images/visit-site-button-grad.gif
Normal file
|
After Width: | Height: | Size: 136 B |
|
Before Width: | Height: | Size: 213 B |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -20,7 +20,7 @@ add_contextual_help($current_screen,
|
||||
'<p>' . __('This screen lists links to plugins to import data from blogging/content management platforms. Choose the platform you want to import from, and click Install Now when you are prompted in the popup window. If your platform is not listed, click the link to search the plugin directory for other importer plugins to see if there is one for your platform.') . '</p>' .
|
||||
'<p>' . __('In previous versions of WordPress, all the importers were built-in, but they have been turned into plugins as of version 3.0 since most people only use them once or infrequently.') . '</p>' .
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Tools_Import_SubPanel" target="_blank">Documentation on Import</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Tools_Import_SubPanel" target="_blank">Import Documentation</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
|
||||
@@ -37,14 +37,11 @@ if ( current_user_can('install_plugins') )
|
||||
);
|
||||
|
||||
if ( ! empty( $_GET['invalid'] ) && !empty($popular_importers[$_GET['invalid']][3]) ) {
|
||||
wp_redirect( admin_url('import.php?import=' . $popular_importers[$_GET['invalid']][3]) );
|
||||
wp_redirect("import.php?import=" . $popular_importers[$_GET['invalid']][3]);
|
||||
exit;
|
||||
}
|
||||
|
||||
add_thickbox();
|
||||
wp_enqueue_script( 'plugin-install' );
|
||||
wp_admin_css( 'plugin-install' );
|
||||
|
||||
require_once ('admin-header.php');
|
||||
$parent_file = 'tools.php';
|
||||
?>
|
||||
@@ -61,21 +58,18 @@ $parent_file = 'tools.php';
|
||||
|
||||
// Load all importers so that they can register.
|
||||
$import_loc = 'wp-admin/import';
|
||||
$import_root = ABSPATH . $import_loc;
|
||||
|
||||
if ( file_exists( $import_root ) ) {
|
||||
$imports_dir = opendir($import_root);
|
||||
if ($imports_dir) {
|
||||
while (($file = readdir($imports_dir)) !== false) {
|
||||
if ($file[0] == '.') {
|
||||
continue;
|
||||
} elseif (substr($file, -4) == '.php') {
|
||||
require_once($import_root . '/' . $file);
|
||||
}
|
||||
$import_root = ABSPATH.$import_loc;
|
||||
$imports_dir = @ opendir($import_root);
|
||||
if ($imports_dir) {
|
||||
while (($file = readdir($imports_dir)) !== false) {
|
||||
if ($file{0} == '.') {
|
||||
continue;
|
||||
} elseif (substr($file, -4) == '.php') {
|
||||
require_once($import_root . '/' . $file);
|
||||
}
|
||||
}
|
||||
closedir( $imports_dir );
|
||||
}
|
||||
@closedir($imports_dir);
|
||||
|
||||
$importers = get_importers();
|
||||
|
||||
@@ -114,8 +108,8 @@ if (empty ($importers)) {
|
||||
}
|
||||
}
|
||||
if ( empty($action) )
|
||||
$action = '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
|
||||
'&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox" title="' .
|
||||
$action = '<a href="' . esc_url(admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
|
||||
'&from=import&TB_iframe=true&width=600&height=550')) . '" class="thickbox" title="' .
|
||||
esc_attr__('Install importer') . '">' . $data[0] . '</a>';
|
||||
} else {
|
||||
$action = "<a href='" . esc_url("admin.php?import=$id") . "' title='" . esc_attr( wptexturize(strip_tags($data[1])) ) ."'>{$data[0]}</a>";
|
||||
@@ -136,7 +130,7 @@ if (empty ($importers)) {
|
||||
}
|
||||
|
||||
if ( current_user_can('install_plugins') )
|
||||
echo '<p>' . sprintf( __('If the importer you need is not listed, <a href="%s">search the plugins directory</a> to see if an importer is available.'), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '</p>';
|
||||
echo '<p>' . sprintf('If the importer you need is not listed, <a href="%s">search the plugins directory</a> to see if an importer is available.', esc_url(admin_url('plugin-install.php?tab=search&type=tag&s=importer')) ) . '</p>';
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -39,10 +39,6 @@ require_once(ABSPATH . 'wp-admin/includes/taxonomy.php');
|
||||
/** WordPress Template Administration API */
|
||||
require_once(ABSPATH . 'wp-admin/includes/template.php');
|
||||
|
||||
/** WordPress List Table Administration API and base class */
|
||||
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
|
||||
require_once(ABSPATH . 'wp-admin/includes/list-table.php');
|
||||
|
||||
/** WordPress Theme Administration API */
|
||||
require_once(ABSPATH . 'wp-admin/includes/theme.php');
|
||||
|
||||
@@ -52,6 +48,9 @@ require_once(ABSPATH . 'wp-admin/includes/user.php');
|
||||
/** WordPress Update Administration API */
|
||||
require_once(ABSPATH . 'wp-admin/includes/update.php');
|
||||
|
||||
/** WordPress Registration API */
|
||||
require_once(ABSPATH . WPINC . '/registration.php');
|
||||
|
||||
/** WordPress Deprecated Administration API */
|
||||
require_once(ABSPATH . 'wp-admin/includes/deprecated.php');
|
||||
|
||||
|
||||
@@ -7,27 +7,27 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Add a link to using values provided in $_POST.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @since unknown
|
||||
*
|
||||
* @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.
|
||||
* @return unknown
|
||||
*/
|
||||
function add_link() {
|
||||
return edit_link();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update or insert a link using values provided in $_POST.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @since unknown
|
||||
*
|
||||
* @param int $link_id Optional. ID of the link to edit.
|
||||
* @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.
|
||||
* @param unknown_type $link_id
|
||||
* @return unknown
|
||||
*/
|
||||
function edit_link( $link_id = 0 ) {
|
||||
if ( !current_user_can( 'manage_links' ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
function edit_link( $link_id = '' ) {
|
||||
if (!current_user_can( 'manage_links' ))
|
||||
wp_die( __( 'Cheatin’ uh?' ));
|
||||
|
||||
$_POST['link_url'] = esc_html( $_POST['link_url'] );
|
||||
$_POST['link_url'] = esc_url($_POST['link_url']);
|
||||
@@ -39,27 +39,27 @@ function edit_link( $link_id = 0 ) {
|
||||
|
||||
if ( !empty( $link_id ) ) {
|
||||
$_POST['link_id'] = $link_id;
|
||||
return wp_update_link( $_POST );
|
||||
return wp_update_link( $_POST);
|
||||
} else {
|
||||
return wp_insert_link( $_POST );
|
||||
return wp_insert_link( $_POST);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the default link for editing.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @since unknown
|
||||
*
|
||||
* @return object Default link
|
||||
* @return unknown
|
||||
*/
|
||||
function get_default_link_to_edit() {
|
||||
if ( isset( $_GET['linkurl'] ) )
|
||||
$link->link_url = esc_url( $_GET['linkurl'] );
|
||||
$link->link_url = esc_url( $_GET['linkurl']);
|
||||
else
|
||||
$link->link_url = '';
|
||||
|
||||
if ( isset( $_GET['name'] ) )
|
||||
$link->link_name = esc_attr( $_GET['name'] );
|
||||
$link->link_name = esc_attr( $_GET['name']);
|
||||
else
|
||||
$link->link_name = '';
|
||||
|
||||
@@ -69,12 +69,12 @@ function get_default_link_to_edit() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete link specified from database
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @since unknown
|
||||
*
|
||||
* @param int $link_id ID of the link to delete
|
||||
* @return bool True
|
||||
* @param unknown_type $link_id
|
||||
* @return unknown
|
||||
*/
|
||||
function wp_delete_link( $link_id ) {
|
||||
global $wpdb;
|
||||
@@ -93,12 +93,12 @@ function wp_delete_link( $link_id ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the link categories associated with the link specified.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.1.0
|
||||
* @since unknown
|
||||
*
|
||||
* @param int $link_id Link ID to look up
|
||||
* @return array The requested link's categories
|
||||
* @param unknown_type $link_id
|
||||
* @return unknown
|
||||
*/
|
||||
function wp_get_link_cats( $link_id = 0 ) {
|
||||
|
||||
@@ -108,28 +108,27 @@ function wp_get_link_cats( $link_id = 0 ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve link data based on ID.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @since unknown
|
||||
*
|
||||
* @param int $link_id ID of link to retrieve
|
||||
* @return object Link for editing
|
||||
* @param unknown_type $link_id
|
||||
* @return unknown
|
||||
*/
|
||||
function get_link_to_edit( $link_id ) {
|
||||
return get_bookmark( $link_id, OBJECT, 'edit' );
|
||||
}
|
||||
|
||||
/**
|
||||
* This function inserts/updates links into/in the database.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @since unknown
|
||||
*
|
||||
* @param array $linkdata Elements that make up the link to insert.
|
||||
* @param bool $wp_error Optional. If true return WP_Error object on failure.
|
||||
* @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.
|
||||
* @param unknown_type $linkdata
|
||||
* @return unknown
|
||||
*/
|
||||
function wp_insert_link( $linkdata, $wp_error = false ) {
|
||||
global $wpdb;
|
||||
global $wpdb, $current_user;
|
||||
|
||||
$defaults = array( 'link_id' => 0, 'link_name' => '', 'link_url' => '', 'link_rating' => 0 );
|
||||
|
||||
@@ -167,7 +166,7 @@ function wp_insert_link( $linkdata, $wp_error = false ) {
|
||||
$link_visible = 'Y';
|
||||
|
||||
if ( empty( $link_owner ) )
|
||||
$link_owner = get_current_user_id();
|
||||
$link_owner = $current_user->id;
|
||||
|
||||
if ( empty( $link_notes ) )
|
||||
$link_notes = '';
|
||||
@@ -182,7 +181,7 @@ function wp_insert_link( $linkdata, $wp_error = false ) {
|
||||
$link_rel = '';
|
||||
|
||||
// Make sure we set a valid category
|
||||
if ( ! isset( $link_category ) || 0 == count( $link_category ) || !is_array( $link_category ) ) {
|
||||
if ( ! isset( $link_category ) ||0 == count( $link_category ) || !is_array( $link_category ) ) {
|
||||
$link_category = array( get_option( 'default_link_category' ) );
|
||||
}
|
||||
|
||||
@@ -216,12 +215,12 @@ function wp_insert_link( $linkdata, $wp_error = false ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Update link with the specified link categories.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.1.0
|
||||
* @since unknown
|
||||
*
|
||||
* @param int $link_id ID of link to update
|
||||
* @param array $link_categories Array of categories to
|
||||
* @param unknown_type $link_id
|
||||
* @param unknown_type $link_categories
|
||||
*/
|
||||
function wp_set_link_cats( $link_id = 0, $link_categories = array() ) {
|
||||
// If $link_categories isn't already an array, make it one:
|
||||
@@ -234,15 +233,15 @@ function wp_set_link_cats( $link_id = 0, $link_categories = array() ) {
|
||||
wp_set_object_terms( $link_id, $link_categories, 'link_category' );
|
||||
|
||||
clean_bookmark_cache( $link_id );
|
||||
}
|
||||
} // wp_set_link_cats()
|
||||
|
||||
/**
|
||||
* Update a link in the database.
|
||||
* {@internal Missing Short Description}}
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @since unknown
|
||||
*
|
||||
* @param array $linkdata Link data to update.
|
||||
* @return int|WP_Error Value 0 or WP_Error on failure. The updated link ID on success.
|
||||
* @param unknown_type $linkdata
|
||||
* @return unknown
|
||||
*/
|
||||
function wp_update_link( $linkdata ) {
|
||||
$link_id = (int) $linkdata['link_id'];
|
||||
|
||||
@@ -1,557 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Comments and Post Comments List Table classes.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Comments List Table class.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
*/
|
||||
class WP_Comments_List_Table extends WP_List_Table {
|
||||
|
||||
var $checkbox = true;
|
||||
|
||||
var $pending_count = array();
|
||||
|
||||
function WP_Comments_List_Table() {
|
||||
global $post_id;
|
||||
|
||||
$post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0;
|
||||
|
||||
if ( get_option('show_avatars') )
|
||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
||||
|
||||
parent::WP_List_Table( array(
|
||||
'plural' => 'comments',
|
||||
'singular' => 'comment',
|
||||
'ajax' => true,
|
||||
) );
|
||||
}
|
||||
|
||||
function ajax_user_can() {
|
||||
return current_user_can('edit_posts');
|
||||
}
|
||||
|
||||
function prepare_items() {
|
||||
global $post_id, $comment_status, $search, $comment_type;
|
||||
|
||||
$comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
|
||||
if ( !in_array( $comment_status, array( 'all', 'moderated', 'approved', 'spam', 'trash' ) ) )
|
||||
$comment_status = 'all';
|
||||
|
||||
$comment_type = !empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : '';
|
||||
|
||||
$search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : '';
|
||||
|
||||
$user_id = ( isset( $_REQUEST['user_id'] ) ) ? $_REQUEST['user_id'] : '';
|
||||
|
||||
$orderby = ( isset( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : '';
|
||||
$order = ( isset( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : '';
|
||||
|
||||
$comments_per_page = $this->get_per_page( $comment_status );
|
||||
|
||||
$doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
|
||||
|
||||
if ( isset( $_REQUEST['number'] ) ) {
|
||||
$number = (int) $_REQUEST['number'];
|
||||
}
|
||||
else {
|
||||
$number = $comments_per_page + min( 8, $comments_per_page ); // Grab a few extra
|
||||
}
|
||||
|
||||
$page = $this->get_pagenum();
|
||||
|
||||
if ( isset( $_REQUEST['start'] ) ) {
|
||||
$start = $_REQUEST['start'];
|
||||
} else {
|
||||
$start = ( $page - 1 ) * $comments_per_page;
|
||||
}
|
||||
|
||||
if ( $doing_ajax && isset( $_REQUEST['offset'] ) ) {
|
||||
$start += $_REQUEST['offset'];
|
||||
}
|
||||
|
||||
$status_map = array(
|
||||
'moderated' => 'hold',
|
||||
'approved' => 'approve'
|
||||
);
|
||||
|
||||
$args = array(
|
||||
'status' => isset( $status_map[$comment_status] ) ? $status_map[$comment_status] : $comment_status,
|
||||
'search' => $search,
|
||||
'user_id' => $user_id,
|
||||
'offset' => $start,
|
||||
'number' => $number,
|
||||
'post_id' => $post_id,
|
||||
'type' => $comment_type,
|
||||
'orderby' => $orderby,
|
||||
'order' => $order,
|
||||
);
|
||||
|
||||
$_comments = get_comments( $args );
|
||||
|
||||
update_comment_cache( $_comments );
|
||||
|
||||
$this->items = array_slice( $_comments, 0, $comments_per_page );
|
||||
$this->extra_items = array_slice( $_comments, $comments_per_page );
|
||||
|
||||
$total_comments = get_comments( array_merge( $args, array('count' => true, 'offset' => 0, 'number' => 0) ) );
|
||||
|
||||
$_comment_post_ids = array();
|
||||
foreach ( $_comments as $_c ) {
|
||||
$_comment_post_ids[] = $_c->comment_post_ID;
|
||||
}
|
||||
|
||||
$this->pending_count = get_pending_comments_num( $_comment_post_ids );
|
||||
|
||||
$this->set_pagination_args( array(
|
||||
'total_items' => $total_comments,
|
||||
'per_page' => $comments_per_page,
|
||||
) );
|
||||
}
|
||||
|
||||
function get_per_page( $comment_status = 'all' ) {
|
||||
$comments_per_page = $this->get_items_per_page( 'edit_comments_per_page' );
|
||||
$comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
|
||||
return $comments_per_page;
|
||||
}
|
||||
|
||||
function no_items() {
|
||||
global $comment_status;
|
||||
|
||||
if ( 'moderated' == $comment_status )
|
||||
_e( 'No comments awaiting moderation… yet.' );
|
||||
else
|
||||
_e( 'No comments found.' );
|
||||
}
|
||||
|
||||
function get_views() {
|
||||
global $post_id, $comment_status;
|
||||
|
||||
$status_links = array();
|
||||
$num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments();
|
||||
//, number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"),
|
||||
//, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>")
|
||||
$stati = array(
|
||||
'all' => _nx_noop('All', 'All', 'comments'), // 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>'),
|
||||
'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>')
|
||||
);
|
||||
|
||||
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 = ( $status == $comment_status ) ? ' class="current"' : '';
|
||||
|
||||
if ( !isset( $num_comments->$status ) )
|
||||
$num_comments->$status = 10;
|
||||
$link = add_query_arg( 'comment_status', $status, $link );
|
||||
if ( $post_id )
|
||||
$link = add_query_arg( 'p', absint( $post_id ), $link );
|
||||
/*
|
||||
// I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
|
||||
if ( !empty( $_REQUEST['s'] ) )
|
||||
$link = add_query_arg( 's', esc_attr( stripslashes( $_REQUEST['s'] ) ), $link );
|
||||
*/
|
||||
$status_links[$status] = "<a href='$link'$class>" . sprintf(
|
||||
translate_nooped_plural( $label, $num_comments->$status ),
|
||||
number_format_i18n( $num_comments->$status )
|
||||
) . '</a>';
|
||||
}
|
||||
|
||||
$status_links = apply_filters( 'comment_status_links', $status_links );
|
||||
return $status_links;
|
||||
}
|
||||
|
||||
function get_bulk_actions() {
|
||||
global $comment_status;
|
||||
|
||||
$actions = array();
|
||||
if ( in_array( $comment_status, array( 'all', 'approved' ) ) )
|
||||
$actions['unapprove'] = __( 'Unapprove' );
|
||||
if ( in_array( $comment_status, array( 'all', 'moderated', 'spam' ) ) )
|
||||
$actions['approve'] = __( 'Approve' );
|
||||
if ( in_array( $comment_status, array( 'all', 'moderated', 'approved' ) ) )
|
||||
$actions['spam'] = _x( 'Mark as Spam', 'comment' );
|
||||
|
||||
if ( 'trash' == $comment_status )
|
||||
$actions['untrash'] = __( 'Restore' );
|
||||
elseif ( 'spam' == $comment_status )
|
||||
$actions['unspam'] = _x( 'Not Spam', 'comment' );
|
||||
|
||||
if ( in_array( $comment_status, array( 'trash', 'spam' ) ) || !EMPTY_TRASH_DAYS )
|
||||
$actions['delete'] = __( 'Delete Permanently' );
|
||||
else
|
||||
$actions['trash'] = __( 'Move to Trash' );
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
function extra_tablenav( $which ) {
|
||||
global $comment_status, $comment_type;
|
||||
?>
|
||||
<div class="alignleft actions">
|
||||
<?php
|
||||
if ( 'top' == $which ) {
|
||||
?>
|
||||
<select name="comment_type">
|
||||
<option value=""><?php _e( 'Show all comment types' ); ?></option>
|
||||
<?php
|
||||
$comment_types = apply_filters( 'admin_comment_types_dropdown', array(
|
||||
'comment' => __( 'Comments' ),
|
||||
'pings' => __( 'Pings' ),
|
||||
) );
|
||||
|
||||
foreach ( $comment_types as $type => $label )
|
||||
echo "\t<option value='" . esc_attr( $type ) . "'" . selected( $comment_type, $type, false ) . ">$label</option>\n";
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
submit_button( __( 'Filter' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) );
|
||||
}
|
||||
|
||||
if ( ( 'spam' == $comment_status || 'trash' == $comment_status ) && current_user_can( 'moderate_comments' ) ) {
|
||||
wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
|
||||
$title = ( 'spam' == $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
|
||||
submit_button( $title, 'button-secondary apply', 'delete_all', false );
|
||||
}
|
||||
do_action( 'manage_comments_nav', $comment_status );
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function current_action() {
|
||||
if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) )
|
||||
return 'delete_all';
|
||||
|
||||
return parent::current_action();
|
||||
}
|
||||
|
||||
function get_columns() {
|
||||
global $post_id;
|
||||
|
||||
$columns = array();
|
||||
|
||||
if ( $this->checkbox )
|
||||
$columns['cb'] = '<input type="checkbox" />';
|
||||
|
||||
$columns['author'] = __( 'Author' );
|
||||
$columns['comment'] = _x( 'Comment', 'column name' );
|
||||
|
||||
if ( !$post_id )
|
||||
$columns['response'] = _x( 'In Response To', 'column name' );
|
||||
|
||||
return $columns;
|
||||
}
|
||||
|
||||
function get_sortable_columns() {
|
||||
return array(
|
||||
'author' => 'comment_author',
|
||||
'response' => 'comment_post_ID'
|
||||
);
|
||||
}
|
||||
|
||||
function display() {
|
||||
extract( $this->_args );
|
||||
|
||||
wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
|
||||
|
||||
$this->display_tablenav( 'top' );
|
||||
|
||||
?>
|
||||
<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php $this->print_column_headers(); ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<?php $this->print_column_headers( false ); ?>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody id="the-comment-list" class="list:comment">
|
||||
<?php $this->display_rows_or_placeholder(); ?>
|
||||
</tbody>
|
||||
|
||||
<tbody id="the-extra-comment-list" class="list:comment" style="display: none;">
|
||||
<?php $this->items = $this->extra_items; $this->display_rows(); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
|
||||
$this->display_tablenav( 'bottom' );
|
||||
}
|
||||
|
||||
function single_row( $a_comment ) {
|
||||
global $post, $comment, $the_comment_status;
|
||||
|
||||
$comment = $a_comment;
|
||||
$the_comment_status = wp_get_comment_status( $comment->comment_ID );
|
||||
|
||||
$post = get_post( $comment->comment_post_ID );
|
||||
|
||||
$this->user_can = current_user_can( 'edit_comment', $comment->comment_ID );
|
||||
|
||||
echo "<tr id='comment-$comment->comment_ID' class='$the_comment_status'>";
|
||||
echo $this->single_row_columns( $comment );
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
function column_cb( $comment ) {
|
||||
if ( $this->user_can )
|
||||
echo "<input type='checkbox' name='delete_comments[]' value='$comment->comment_ID' />";
|
||||
}
|
||||
|
||||
function column_comment( $comment ) {
|
||||
global $post, $comment_status, $the_comment_status;
|
||||
|
||||
$user_can = $this->user_can;
|
||||
|
||||
$comment_url = esc_url( get_comment_link( $comment->comment_ID ) );
|
||||
|
||||
$ptime = date( 'G', strtotime( $comment->comment_date ) );
|
||||
if ( ( abs( time() - $ptime ) ) < 86400 )
|
||||
$ptime = sprintf( __( '%s ago' ), human_time_diff( $ptime ) );
|
||||
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" ) );
|
||||
|
||||
$url = "comment.php?c=$comment->comment_ID";
|
||||
|
||||
$approve_url = esc_url( $url . "&action=approvecomment&$approve_nonce" );
|
||||
$unapprove_url = esc_url( $url . "&action=unapprovecomment&$approve_nonce" );
|
||||
$spam_url = esc_url( $url . "&action=spamcomment&$del_nonce" );
|
||||
$unspam_url = esc_url( $url . "&action=unspamcomment&$del_nonce" );
|
||||
$trash_url = esc_url( $url . "&action=trashcomment&$del_nonce" );
|
||||
$untrash_url = esc_url( $url . "&action=untrashcomment&$del_nonce" );
|
||||
$delete_url = esc_url( $url . "&action=deletecomment&$del_nonce" );
|
||||
}
|
||||
|
||||
echo '<div class="submitted-on">';
|
||||
/* translators: 2: comment date, 3: comment time */
|
||||
printf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ), $comment_url,
|
||||
/* translators: comment date format. See http://php.net/date */ get_comment_date( __( 'Y/m/d' ) ),
|
||||
/* translators: comment time format. See http://php.net/date */ get_comment_date( get_option( 'time_format' ) ) );
|
||||
|
||||
if ( $comment->comment_parent ) {
|
||||
$parent = get_comment( $comment->comment_parent );
|
||||
$parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
|
||||
$name = get_comment_author( $parent->comment_ID );
|
||||
printf( ' | '.__( 'In reply to <a href="%1$s">%2$s</a>.' ), $parent_link, $name );
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
comment_text();
|
||||
if ( $user_can ) { ?>
|
||||
<div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
|
||||
<textarea class="comment" rows="1" cols="1"><?php echo esc_textarea( apply_filters( 'comment_edit_pre', $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>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( $user_can ) {
|
||||
// preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash
|
||||
$actions = array(
|
||||
'approve' => '', 'unapprove' => '',
|
||||
'reply' => '',
|
||||
'quickedit' => '',
|
||||
'edit' => '',
|
||||
'spam' => '', 'unspam' => '',
|
||||
'trash' => '', 'untrash' => '', 'delete' => ''
|
||||
);
|
||||
|
||||
if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments
|
||||
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='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
|
||||
else if ( 'unapproved' == $the_comment_status )
|
||||
$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='" . esc_attr__( '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='" . esc_attr__( '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='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
|
||||
}
|
||||
|
||||
if ( 'spam' != $the_comment_status && 'trash' != $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='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
|
||||
} elseif ( 'spam' == $the_comment_status ) {
|
||||
$actions['unspam'] = "<a href='$unspam_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1 vim-z vim-destructive'>" . _x( 'Not Spam', 'comment' ) . '</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>';
|
||||
}
|
||||
|
||||
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='" . esc_attr__( '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='" . esc_attr__( 'Edit comment' ) . "'>". __( 'Edit' ) . '</a>';
|
||||
$actions['quickedit'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\' );return false;" class="vim-q" title="'.esc_attr__( '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="'.esc_attr__( 'Reply to this comment' ).'" href="#">' . __( 'Reply' ) . '</a>';
|
||||
}
|
||||
|
||||
$actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );
|
||||
|
||||
$i = 0;
|
||||
echo '<div class="row-actions">';
|
||||
foreach ( $actions as $action => $link ) {
|
||||
++$i;
|
||||
( ( ( 'approve' == $action || 'unapprove' == $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
|
||||
|
||||
// Reply and quickedit need a hide-if-no-js span when not added with ajax
|
||||
if ( ( 'reply' == $action || 'quickedit' == $action ) && ! defined('DOING_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->comment_ID, '_wp_trash_meta_status', true ) )
|
||||
$action .= ' approve';
|
||||
else
|
||||
$action .= ' unapprove';
|
||||
}
|
||||
|
||||
echo "<span class='$action'>$sep$link</span>";
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
function column_author( $comment ) {
|
||||
global $comment_status;
|
||||
|
||||
$author_url = get_comment_author_url();
|
||||
if ( 'http://' == $author_url )
|
||||
$author_url = '';
|
||||
$author_url_display = preg_replace( '|http://(www\.)?|i', '', $author_url );
|
||||
if ( strlen( $author_url_display ) > 50 )
|
||||
$author_url_display = substr( $author_url_display, 0, 49 ) . '...';
|
||||
|
||||
echo "<strong>"; comment_author(); echo '</strong><br />';
|
||||
if ( !empty( $author_url ) )
|
||||
echo "<a title='$author_url' href='$author_url'>$author_url_display</a><br />";
|
||||
|
||||
if ( $this->user_can ) {
|
||||
if ( !empty( $comment->comment_author_email ) ) {
|
||||
comment_author_email_link();
|
||||
echo '<br />';
|
||||
}
|
||||
echo '<a href="edit-comments.php?s=';
|
||||
comment_author_IP();
|
||||
echo '&mode=detail';
|
||||
if ( 'spam' == $comment_status )
|
||||
echo '&comment_status=spam';
|
||||
echo '">';
|
||||
comment_author_IP();
|
||||
echo '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
function column_date( $comment ) {
|
||||
return get_comment_date( __( 'Y/m/d \a\t g:ia' ) );
|
||||
}
|
||||
|
||||
function column_response( $comment ) {
|
||||
global $post;
|
||||
|
||||
if ( isset( $this->pending_count[$post->ID] ) ) {
|
||||
$pending_comments = $this->pending_count[$post->ID];
|
||||
} else {
|
||||
$_pending_count_temp = get_pending_comments_num( array( $post->ID ) );
|
||||
$pending_comments = $this->pending_count[$post->ID] = $_pending_count_temp[$post->ID];
|
||||
}
|
||||
|
||||
if ( current_user_can( 'edit_post', $post->ID ) ) {
|
||||
$post_link = "<a href='" . get_edit_post_link( $post->ID ) . "'>";
|
||||
$post_link .= get_the_title( $post->ID ) . '</a>';
|
||||
} else {
|
||||
$post_link = get_the_title( $post->ID );
|
||||
}
|
||||
|
||||
echo '<div class="response-links"><span class="post-com-count-wrapper">';
|
||||
echo $post_link . '<br />';
|
||||
$this->comments_bubble( $post->ID, $pending_comments );
|
||||
echo '</span> ';
|
||||
echo "<a href='" . get_permalink( $post->ID ) . "'>#</a>";
|
||||
echo '</div>';
|
||||
if ( 'attachment' == $post->post_type && ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) )
|
||||
echo $thumb;
|
||||
}
|
||||
|
||||
function column_default( $comment, $column_name ) {
|
||||
do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Comments List Table class.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
*
|
||||
* @see WP_Comments_Table
|
||||
*/
|
||||
class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
|
||||
|
||||
function get_column_info() {
|
||||
$this->_column_headers = array(
|
||||
array(
|
||||
'author' => __( 'Author' ),
|
||||
'comment' => _x( 'Comment', 'column name' ),
|
||||
),
|
||||
array(),
|
||||
array(),
|
||||
);
|
||||
|
||||
return $this->_column_headers;
|
||||
}
|
||||
|
||||
function get_table_classes() {
|
||||
$classes = parent::get_table_classes();
|
||||
$classes[] = 'comments-box';
|
||||
return $classes;
|
||||
}
|
||||
|
||||
function display( $output_empty = false ) {
|
||||
extract( $this->_args );
|
||||
|
||||
wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
|
||||
?>
|
||||
<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0" style="display:none;">
|
||||
<tbody id="the-comment-list"<?php if ( $singular ) echo " class='list:$singular'"; ?>>
|
||||
<?php if ( ! $output_empty ) $this->display_rows_or_placeholder(); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
function get_per_page( $comment_status = false ) {
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -19,7 +19,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param mixed $arg ingored argument
|
||||
* @param $arg mixed ingored argument
|
||||
*/
|
||||
function WP_Filesystem_Direct($arg) {
|
||||
$this->method = 'direct';
|
||||
@@ -36,7 +36,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
/**
|
||||
* Reads entire file into a string
|
||||
*
|
||||
* @param string $file Name of the file to read.
|
||||
* @param $file string Name of the file to read.
|
||||
* @return string|bool The function returns the read data or false on failure.
|
||||
*/
|
||||
function get_contents($file) {
|
||||
@@ -45,7 +45,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
/**
|
||||
* Reads entire file into an array
|
||||
*
|
||||
* @param string $file Path to the file.
|
||||
* @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) {
|
||||
@@ -54,9 +54,9 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
/**
|
||||
* Write a string to a file
|
||||
*
|
||||
* @param string $file Remote path to the file where to write the data.
|
||||
* @param string $contents The data to write.
|
||||
* @param int $mode (optional) The file permissions as octal number, usually 0644.
|
||||
* @param $file string Remote 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.
|
||||
* @return bool False upon failure.
|
||||
*/
|
||||
function put_contents($file, $contents, $mode = false ) {
|
||||
@@ -78,7 +78,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
/**
|
||||
* Change directory
|
||||
*
|
||||
* @param string $dir The new current directory.
|
||||
* @param $dir string The new current directory.
|
||||
* @return bool Returns true on success or false on failure.
|
||||
*/
|
||||
function chdir($dir) {
|
||||
@@ -87,9 +87,9 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
/**
|
||||
* Changes file group
|
||||
*
|
||||
* @param string $file Path to the file.
|
||||
* @param mixed $group A group name or number.
|
||||
* @param bool $recursive (optional) If set True changes file group recursivly. Defaults to False.
|
||||
* @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) {
|
||||
@@ -110,9 +110,9 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
/**
|
||||
* Changes filesystem permissions
|
||||
*
|
||||
* @param string $file Path to the file.
|
||||
* @param int $mode (optional) The permissions as octal number, usually 0644 for files, 0755 for dirs.
|
||||
* @param bool $recursive (optional) If set True changes file group recursivly. Defaults to False.
|
||||
* @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) {
|
||||
@@ -138,9 +138,9 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
/**
|
||||
* Changes file owner
|
||||
*
|
||||
* @param string $file Path to the file.
|
||||
* @param mixed $owner A user name or number.
|
||||
* @param bool $recursive (optional) If set True changes file owner recursivly. Defaults to False.
|
||||
* @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) {
|
||||
@@ -160,7 +160,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
/**
|
||||
* Gets file owner
|
||||
*
|
||||
* @param string $file Path to the file.
|
||||
* @param $file string Path to the file.
|
||||
* @return string Username of the user.
|
||||
*/
|
||||
function owner($file) {
|
||||
@@ -177,7 +177,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
*
|
||||
* FIXME does not handle errors in fileperms()
|
||||
*
|
||||
* @param string $file Path to the file.
|
||||
* @param $file string Path to the file.
|
||||
* @return string Mode of the file (last 4 digits).
|
||||
*/
|
||||
function getchmod($file) {
|
||||
|
||||
@@ -130,8 +130,7 @@ class WP_Importer {
|
||||
}
|
||||
if ( empty( $parsed['path'] ) )
|
||||
$parsed['path'] = '/';
|
||||
$blog = get_blog_details( array( 'domain' => $parsed['host'], 'path' => $parsed['path'] ) );
|
||||
if ( !$blog ) {
|
||||
if ( !$blog = get_blog_info( $parsed['host'], $parsed['path'] ) ) {
|
||||
fwrite( STDERR, "Error: Could not find blog\n" );
|
||||
exit();
|
||||
}
|
||||
@@ -216,7 +215,7 @@ class WP_Importer {
|
||||
* @return bool
|
||||
*/
|
||||
function is_user_over_quota() {
|
||||
global $current_blog;
|
||||
global $current_user, $current_blog;
|
||||
|
||||
if ( function_exists( 'upload_is_user_over_quota' ) ) {
|
||||
if ( upload_is_user_over_quota( 1 ) ) {
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Links Manager List Table class.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
*/
|
||||
class WP_Links_List_Table extends WP_List_Table {
|
||||
|
||||
function WP_Links_List_Table() {
|
||||
parent::WP_List_Table( array(
|
||||
'plural' => 'bookmarks',
|
||||
) );
|
||||
}
|
||||
|
||||
function ajax_user_can() {
|
||||
return current_user_can( 'manage_links' );
|
||||
}
|
||||
|
||||
function prepare_items() {
|
||||
global $cat_id, $s, $orderby, $order;
|
||||
|
||||
wp_reset_vars( array( 'action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'orderby', 'order', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]', 's' ) );
|
||||
|
||||
$args = array( 'hide_invisible' => 0, 'hide_empty' => 0 );
|
||||
|
||||
if ( 'all' != $cat_id )
|
||||
$args['category'] = $cat_id;
|
||||
if ( !empty( $s ) )
|
||||
$args['search'] = $s;
|
||||
if ( !empty( $orderby ) )
|
||||
$args['orderby'] = $orderby;
|
||||
if ( !empty( $order ) )
|
||||
$args['order'] = $order;
|
||||
|
||||
$this->items = get_bookmarks( $args );
|
||||
}
|
||||
|
||||
function no_items() {
|
||||
_e( 'No links found.' );
|
||||
}
|
||||
|
||||
function get_bulk_actions() {
|
||||
$actions = array();
|
||||
$actions['delete'] = __( 'Delete' );
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
function extra_tablenav( $which ) {
|
||||
global $cat_id;
|
||||
|
||||
if ( 'top' != $which )
|
||||
return;
|
||||
?>
|
||||
<div class="alignleft actions">
|
||||
<?php
|
||||
$dropdown_options = array(
|
||||
'selected' => $cat_id,
|
||||
'name' => 'cat_id',
|
||||
'taxonomy' => 'link_category',
|
||||
'show_option_all' => __( 'View all categories' ),
|
||||
'hide_empty' => true,
|
||||
'hierarchical' => 1,
|
||||
'show_count' => 0,
|
||||
'orderby' => 'name',
|
||||
);
|
||||
wp_dropdown_categories( $dropdown_options );
|
||||
submit_button( __( 'Filter' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) );
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
function get_columns() {
|
||||
return array(
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'name' => __( 'Name' ),
|
||||
'url' => __( 'URL' ),
|
||||
'categories' => __( 'Categories' ),
|
||||
'rel' => __( 'Relationship' ),
|
||||
'visible' => __( 'Visible' ),
|
||||
'rating' => __( 'Rating' )
|
||||
);
|
||||
}
|
||||
|
||||
function get_sortable_columns() {
|
||||
return array(
|
||||
'name' => 'name',
|
||||
'url' => 'url',
|
||||
'visible' => 'visible',
|
||||
'rating' => 'rating'
|
||||
);
|
||||
}
|
||||
|
||||
function display_rows() {
|
||||
global $cat_id;
|
||||
|
||||
$alt = 0;
|
||||
|
||||
foreach ( $this->items as $link ) {
|
||||
$link = sanitize_bookmark( $link );
|
||||
$link->link_name = esc_attr( $link->link_name );
|
||||
$link->link_category = wp_get_link_cats( $link->link_id );
|
||||
|
||||
$short_url = url_shorten( $link->link_url );
|
||||
|
||||
$visible = ( $link->link_visible == 'Y' ) ? __( 'Yes' ) : __( 'No' );
|
||||
$rating = $link->link_rating;
|
||||
$style = ( $alt++ % 2 ) ? '' : ' class="alternate"';
|
||||
|
||||
$edit_link = get_edit_bookmark_link( $link );
|
||||
?>
|
||||
<tr id="link-<?php echo $link->link_id; ?>" valign="middle" <?php echo $style; ?>>
|
||||
<?php
|
||||
|
||||
list( $columns, $hidden ) = $this->get_column_info();
|
||||
|
||||
foreach ( $columns as $column_name => $column_display_name ) {
|
||||
$class = "class='column-$column_name'";
|
||||
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) )
|
||||
$style = ' style="display:none;"';
|
||||
|
||||
$attributes = $class . $style;
|
||||
|
||||
switch ( $column_name ) {
|
||||
case 'cb':
|
||||
echo '<th scope="row" class="check-column"><input type="checkbox" name="linkcheck[]" value="'. esc_attr( $link->link_id ) .'" /></th>';
|
||||
break;
|
||||
|
||||
case 'name':
|
||||
echo "<td $attributes><strong><a class='row-title' href='$edit_link' title='" . esc_attr( sprintf( __( 'Edit “%s”' ), $link->link_name ) ) . "'>$link->link_name</a></strong><br />";
|
||||
|
||||
$actions = array();
|
||||
$actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
|
||||
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ) . "' onclick=\"if ( confirm( '" . 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;\">" . __( 'Delete' ) . "</a>";
|
||||
echo $this->row_actions( $actions );
|
||||
|
||||
echo '</td>';
|
||||
break;
|
||||
case 'url':
|
||||
echo "<td $attributes><a href='$link->link_url' title='". esc_attr( sprintf( __( 'Visit %s' ), $link->link_name ) )."'>$short_url</a></td>";
|
||||
break;
|
||||
case 'categories':
|
||||
?><td <?php echo $attributes ?>><?php
|
||||
$cat_names = array();
|
||||
foreach ( $link->link_category as $category ) {
|
||||
$cat = get_term( $category, 'link_category', OBJECT, 'display' );
|
||||
if ( is_wp_error( $cat ) )
|
||||
echo $cat->get_error_message();
|
||||
$cat_name = $cat->name;
|
||||
if ( $cat_id != $category )
|
||||
$cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>";
|
||||
$cat_names[] = $cat_name;
|
||||
}
|
||||
echo implode( ', ', $cat_names );
|
||||
?></td><?php
|
||||
break;
|
||||
case 'rel':
|
||||
?><td <?php echo $attributes ?>><?php echo empty( $link->link_rel ) ? '<br />' : $link->link_rel; ?></td><?php
|
||||
break;
|
||||
case 'visible':
|
||||
?><td <?php echo $attributes ?>><?php echo $visible; ?></td><?php
|
||||
break;
|
||||
case 'rating':
|
||||
?><td <?php echo $attributes ?>><?php echo $rating; ?></td><?php
|
||||
break;
|
||||
default:
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php do_action( 'manage_link_custom_column', $column_name, $link->link_id ); ?></td>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,894 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Base class for displaying a list of items in an ajaxified HTML table.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Base class for displaying a list of items in an ajaxified HTML table.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
*/
|
||||
class WP_List_Table {
|
||||
|
||||
/**
|
||||
* The current list of items
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @var array
|
||||
* @access protected
|
||||
*/
|
||||
var $items;
|
||||
|
||||
/**
|
||||
* Various information about the current table
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @var array
|
||||
* @access private
|
||||
*/
|
||||
var $_args;
|
||||
|
||||
/**
|
||||
* Various information needed for displaying the pagination
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @var array
|
||||
* @access private
|
||||
*/
|
||||
var $_pagination_args = array();
|
||||
|
||||
/**
|
||||
* The current screen
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @var object
|
||||
* @access protected
|
||||
*/
|
||||
var $screen;
|
||||
|
||||
/**
|
||||
* Cached bulk actions
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @var array
|
||||
* @access private
|
||||
*/
|
||||
var $_actions;
|
||||
|
||||
/**
|
||||
* Cached pagination output
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $_pagination;
|
||||
|
||||
/**
|
||||
* Constructor. The child class should call this constructor from it's own constructor
|
||||
*
|
||||
* @param array $args An associative array with information about the current table
|
||||
* @access protected
|
||||
*/
|
||||
function WP_List_Table( $args = array() ) {
|
||||
$args = wp_parse_args( $args, array(
|
||||
'plural' => '',
|
||||
'singular' => '',
|
||||
'ajax' => false
|
||||
) );
|
||||
|
||||
$screen = get_current_screen();
|
||||
|
||||
add_filter( "manage_{$screen->id}_columns", array( &$this, 'get_columns' ), 0 );
|
||||
|
||||
if ( !$args['plural'] )
|
||||
$args['plural'] = $screen->base;
|
||||
|
||||
$this->_args = $args;
|
||||
|
||||
if ( $args['ajax'] ) {
|
||||
// wp_enqueue_script( 'list-table' );
|
||||
add_action( 'admin_footer', array( &$this, '_js_vars' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the current user's permissions
|
||||
* @uses wp_die()
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access public
|
||||
* @abstract
|
||||
*/
|
||||
function ajax_user_can() {
|
||||
die( 'function WP_List_Table::ajax_user_can() must be over-ridden in a sub-class.' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares the list of items for displaying.
|
||||
* @uses WP_List_Table::set_pagination_args()
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access public
|
||||
* @abstract
|
||||
*/
|
||||
function prepare_items() {
|
||||
die( 'function WP_List_Table::prepare_items() must be over-ridden in a sub-class.' );
|
||||
}
|
||||
|
||||
/**
|
||||
* An internal method that sets all the necessary pagination arguments
|
||||
*
|
||||
* @param array $args An associative array with information about the pagination
|
||||
* @access protected
|
||||
*/
|
||||
function set_pagination_args( $args ) {
|
||||
$args = wp_parse_args( $args, array(
|
||||
'total_items' => 0,
|
||||
'total_pages' => 0,
|
||||
'per_page' => 0,
|
||||
) );
|
||||
|
||||
if ( !$args['total_pages'] && $args['per_page'] > 0 )
|
||||
$args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
|
||||
|
||||
$this->_pagination_args = $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the pagination args
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $key
|
||||
* @return array
|
||||
*/
|
||||
function get_pagination_arg( $key ) {
|
||||
if ( 'page' == $key )
|
||||
return $this->get_pagenum();
|
||||
|
||||
if ( isset( $this->_pagination_args[$key] ) )
|
||||
return $this->_pagination_args[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the table has items to display or not
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access public
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_items() {
|
||||
return !empty( $this->items );
|
||||
}
|
||||
|
||||
/**
|
||||
* Message to be displayed when there are no items
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access public
|
||||
*/
|
||||
function no_items() {
|
||||
_e( 'No items found.' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the search box.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access public
|
||||
*
|
||||
* @param string $text The search button text
|
||||
* @param string $input_id The search input id
|
||||
*/
|
||||
function search_box( $text, $input_id ) {
|
||||
if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
|
||||
return;
|
||||
|
||||
$input_id = $input_id . '-search-input';
|
||||
|
||||
if ( ! empty( $_REQUEST['orderby'] ) )
|
||||
echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
|
||||
if ( ! empty( $_REQUEST['order'] ) )
|
||||
echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
|
||||
?>
|
||||
<p class="search-box">
|
||||
<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
|
||||
<input type="text" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<?php submit_button( $text, 'button', false, false, array('id' => 'search-submit') ); ?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an associative array ( id => link ) with the list
|
||||
* of views available on this table.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_views() {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the bulk actions dropdown.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access public
|
||||
*/
|
||||
function views() {
|
||||
$screen = get_current_screen();
|
||||
|
||||
$views = $this->get_views();
|
||||
$views = apply_filters( 'views_' . $screen->id, $views );
|
||||
|
||||
if ( empty( $views ) )
|
||||
return;
|
||||
|
||||
echo "<ul class='subsubsub'>\n";
|
||||
foreach ( $views as $class => $view ) {
|
||||
$views[ $class ] = "\t<li class='$class'>$view";
|
||||
}
|
||||
echo implode( " |</li>\n", $views ) . "</li>\n";
|
||||
echo "</ul>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an associative array ( option_name => option_title ) with the list
|
||||
* of bulk actions available on this table.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_bulk_actions() {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the bulk actions dropdown.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access public
|
||||
*/
|
||||
function bulk_actions() {
|
||||
$screen = get_current_screen();
|
||||
|
||||
if ( is_null( $this->_actions ) ) {
|
||||
$no_new_actions = $this->_actions = $this->get_bulk_actions();
|
||||
// This filter can currently only be used to remove actions.
|
||||
$this->_actions = apply_filters( 'bulk_actions-' . $screen->id, $this->_actions );
|
||||
$this->_actions = array_intersect_assoc( $this->_actions, $no_new_actions );
|
||||
$two = '';
|
||||
} else {
|
||||
$two = '2';
|
||||
}
|
||||
|
||||
if ( empty( $this->_actions ) )
|
||||
return;
|
||||
|
||||
echo "<select name='action$two'>\n";
|
||||
echo "<option value='-1' selected='selected'>" . __( 'Bulk Actions' ) . "</option>\n";
|
||||
foreach ( $this->_actions as $name => $title )
|
||||
echo "\t<option value='$name'>$title</option>\n";
|
||||
echo "</select>\n";
|
||||
|
||||
submit_button( __( 'Apply' ), 'button-secondary action', false, false, array( 'id' => "doaction$two" ) );
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current action selected from the bulk actions dropdown.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access public
|
||||
*
|
||||
* @return string|bool The action name or False if no action was selected
|
||||
*/
|
||||
function current_action() {
|
||||
if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
|
||||
return $_REQUEST['action'];
|
||||
|
||||
if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] )
|
||||
return $_REQUEST['action2'];
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate row actions div
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*
|
||||
* @param array $actions The list of actions
|
||||
* @param bool $always_visible Wether the actions should be always visible
|
||||
* @return string
|
||||
*/
|
||||
function row_actions( $actions, $always_visible = false ) {
|
||||
$action_count = count( $actions );
|
||||
$i = 0;
|
||||
|
||||
if ( !$action_count )
|
||||
return '';
|
||||
|
||||
$out = '<div class="' . ( $always_visible ? 'row-actions-visible' : 'row-actions' ) . '">';
|
||||
foreach ( $actions as $action => $link ) {
|
||||
++$i;
|
||||
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
|
||||
$out .= "<span class='$action'>$link$sep</span>";
|
||||
}
|
||||
$out .= '</div>';
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a monthly dropdown for filtering items
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*/
|
||||
function months_dropdown( $post_type ) {
|
||||
global $wpdb, $wp_locale;
|
||||
|
||||
$months = $wpdb->get_results( $wpdb->prepare( "
|
||||
SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
|
||||
FROM $wpdb->posts
|
||||
WHERE post_type = %s
|
||||
ORDER BY post_date DESC
|
||||
", $post_type ) );
|
||||
|
||||
$month_count = count( $months );
|
||||
|
||||
if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
|
||||
return;
|
||||
|
||||
$m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
|
||||
?>
|
||||
<select name='m'>
|
||||
<option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Show all dates' ); ?></option>
|
||||
<?php
|
||||
foreach ( $months as $arc_row ) {
|
||||
if ( 0 == $arc_row->year )
|
||||
continue;
|
||||
|
||||
$month = zeroise( $arc_row->month, 2 );
|
||||
$year = $arc_row->year;
|
||||
|
||||
printf( "<option %s value='%s'>%s</option>\n",
|
||||
selected( $m, $year . $month, false ),
|
||||
esc_attr( $arc_row->year . $month ),
|
||||
$wp_locale->get_month( $month ) . " $year"
|
||||
);
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a view switcher
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*/
|
||||
function view_switcher( $current_mode ) {
|
||||
$modes = array(
|
||||
'list' => __( 'List View' ),
|
||||
'excerpt' => __( 'Excerpt View' )
|
||||
);
|
||||
|
||||
?>
|
||||
<input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
|
||||
<div class="view-switch">
|
||||
<?php
|
||||
foreach ( $modes as $mode => $title ) {
|
||||
$class = ( $current_mode == $mode ) ? 'class="current"' : '';
|
||||
echo "<a href='" . esc_url( add_query_arg( 'mode', $mode, $_SERVER['REQUEST_URI'] ) ) . "' $class><img id='view-switch-$mode' src='" . esc_url( includes_url( 'images/blank.gif' ) ) . "' width='20' height='20' title='$title' alt='$title' /></a>\n";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a comment count bubble
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*
|
||||
* @param int $post_id
|
||||
* @param int $pending_comments
|
||||
*/
|
||||
function comments_bubble( $post_id, $pending_comments ) {
|
||||
$pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) );
|
||||
|
||||
if ( $pending_comments )
|
||||
echo '<strong>';
|
||||
|
||||
echo "<a href='" . esc_url( add_query_arg( 'p', $post_id, admin_url( 'edit-comments.php' ) ) ) . "' title='" . esc_attr( $pending_phrase ) . "' class='post-com-count'><span class='comment-count'>" . number_format_i18n( get_comments_number() ) . "</span></a>";
|
||||
|
||||
if ( $pending_comments )
|
||||
echo '</strong>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current page number
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function get_pagenum() {
|
||||
$pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
|
||||
|
||||
if( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] )
|
||||
$pagenum = $this->_pagination_args['total_pages'];
|
||||
|
||||
return max( 1, $pagenum );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get number of items to display on a single page
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function get_items_per_page( $option, $default = 20 ) {
|
||||
$per_page = (int) get_user_option( $option );
|
||||
if ( empty( $per_page ) || $per_page < 1 )
|
||||
$per_page = $default;
|
||||
|
||||
return (int) apply_filters( $option, $per_page );
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the pagination.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*/
|
||||
function pagination( $which ) {
|
||||
if ( empty( $this->_pagination_args ) )
|
||||
return;
|
||||
|
||||
extract( $this->_pagination_args );
|
||||
|
||||
$output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
|
||||
|
||||
$current = $this->get_pagenum();
|
||||
|
||||
$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
|
||||
$current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
|
||||
|
||||
$page_links = array();
|
||||
|
||||
$disable_first = $disable_last = '';
|
||||
if ( $current == 1 )
|
||||
$disable_first = ' disabled';
|
||||
if ( $current == $total_pages )
|
||||
$disable_last = ' disabled';
|
||||
|
||||
$page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
|
||||
'first-page' . $disable_first,
|
||||
esc_attr__( 'Go to the first page' ),
|
||||
esc_url( remove_query_arg( 'paged', $current_url ) ),
|
||||
'«'
|
||||
);
|
||||
|
||||
$page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
|
||||
'prev-page' . $disable_first,
|
||||
esc_attr__( 'Go to the previous page' ),
|
||||
esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
|
||||
'‹'
|
||||
);
|
||||
|
||||
if ( 'bottom' == $which )
|
||||
$html_current_page = $current;
|
||||
else
|
||||
$html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' />",
|
||||
esc_attr__( 'Current page' ),
|
||||
esc_attr( 'paged' ),
|
||||
$current,
|
||||
strlen( $total_pages )
|
||||
);
|
||||
|
||||
$html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
|
||||
$page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>';
|
||||
|
||||
$page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
|
||||
'next-page' . $disable_last,
|
||||
esc_attr__( 'Go to the next page' ),
|
||||
esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
|
||||
'›'
|
||||
);
|
||||
|
||||
$page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
|
||||
'last-page' . $disable_last,
|
||||
esc_attr__( 'Go to the last page' ),
|
||||
esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
|
||||
'»'
|
||||
);
|
||||
|
||||
$output .= "\n" . join( "\n", $page_links );
|
||||
|
||||
$page_class = $total_pages < 2 ? ' one-page' : '';
|
||||
|
||||
$this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
|
||||
|
||||
echo $this->_pagination;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of columns. The format is:
|
||||
* 'internal-name' => 'Title'
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
* @abstract
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_columns() {
|
||||
die( 'function WP_List_Table::get_columns() must be over-ridden in a sub-class.' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of sortable columns. The format is:
|
||||
* 'internal-name' => 'orderby'
|
||||
* or
|
||||
* 'internal-name' => array( 'orderby', true )
|
||||
*
|
||||
* The second format will make the initial sorting order be descending
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_sortable_columns() {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of all, hidden and sortable columns, with filter applied
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_column_info() {
|
||||
if ( isset( $this->_column_headers ) )
|
||||
return $this->_column_headers;
|
||||
|
||||
$screen = get_current_screen();
|
||||
|
||||
$columns = get_column_headers( $screen );
|
||||
$hidden = get_hidden_columns( $screen );
|
||||
|
||||
$_sortable = apply_filters( "manage_{$screen->id}_sortable_columns", $this->get_sortable_columns() );
|
||||
|
||||
$sortable = array();
|
||||
foreach ( $_sortable as $id => $data ) {
|
||||
if ( empty( $data ) )
|
||||
continue;
|
||||
|
||||
$data = (array) $data;
|
||||
if ( !isset( $data[1] ) )
|
||||
$data[1] = false;
|
||||
|
||||
$sortable[$id] = $data;
|
||||
}
|
||||
|
||||
$this->_column_headers = array( $columns, $hidden, $sortable );
|
||||
|
||||
return $this->_column_headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return number of visible columns
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access public
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function get_column_count() {
|
||||
list ( $columns, $hidden ) = $this->get_column_info();
|
||||
$hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
|
||||
return count( $columns ) - count( $hidden );
|
||||
}
|
||||
|
||||
/**
|
||||
* Print column headers, accounting for hidden and sortable columns.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*
|
||||
* @param bool $with_id Whether to set the id attribute or not
|
||||
*/
|
||||
function print_column_headers( $with_id = true ) {
|
||||
$screen = get_current_screen();
|
||||
|
||||
list( $columns, $hidden, $sortable ) = $this->get_column_info();
|
||||
|
||||
$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
$current_url = remove_query_arg( 'paged', $current_url );
|
||||
|
||||
if ( isset( $_GET['orderby'] ) )
|
||||
$current_orderby = $_GET['orderby'];
|
||||
else
|
||||
$current_orderby = '';
|
||||
|
||||
if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] )
|
||||
$current_order = 'desc';
|
||||
else
|
||||
$current_order = 'asc';
|
||||
|
||||
foreach ( $columns as $column_key => $column_display_name ) {
|
||||
$class = array( 'manage-column', "column-$column_key" );
|
||||
|
||||
$style = '';
|
||||
if ( in_array( $column_key, $hidden ) )
|
||||
$style = 'display:none;';
|
||||
|
||||
$style = ' style="' . $style . '"';
|
||||
|
||||
if ( 'cb' == $column_key )
|
||||
$class[] = 'check-column';
|
||||
elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
|
||||
$class[] = 'num';
|
||||
|
||||
if ( isset( $sortable[$column_key] ) ) {
|
||||
list( $orderby, $desc_first ) = $sortable[$column_key];
|
||||
|
||||
if ( $current_orderby == $orderby ) {
|
||||
$order = 'asc' == $current_order ? 'desc' : 'asc';
|
||||
$class[] = 'sorted';
|
||||
$class[] = $current_order;
|
||||
} else {
|
||||
$order = $desc_first ? 'desc' : 'asc';
|
||||
$class[] = 'sortable';
|
||||
$class[] = $desc_first ? 'asc' : 'desc';
|
||||
}
|
||||
|
||||
$column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
|
||||
}
|
||||
|
||||
$id = $with_id ? "id='$column_key'" : '';
|
||||
|
||||
if ( !empty( $class ) )
|
||||
$class = "class='" . join( ' ', $class ) . "'";
|
||||
|
||||
echo "<th scope='col' $id $class $style>$column_display_name</th>";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the table
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access public
|
||||
*/
|
||||
function display() {
|
||||
extract( $this->_args );
|
||||
|
||||
$this->display_tablenav( 'top' );
|
||||
|
||||
?>
|
||||
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php $this->print_column_headers(); ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<?php $this->print_column_headers( false ); ?>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody id="the-list"<?php if ( $singular ) echo " class='list:$singular'"; ?>>
|
||||
<?php $this->display_rows_or_placeholder(); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
$this->display_tablenav( 'bottom' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of CSS classes for the <table> tag
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_table_classes() {
|
||||
return array( 'widefat', 'fixed', $this->_args['plural'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the table navigation above or below the table
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*/
|
||||
function display_tablenav( $which ) {
|
||||
if ( 'top' == $which )
|
||||
wp_nonce_field( 'bulk-' . $this->_args['plural'] );
|
||||
?>
|
||||
<div class="tablenav <?php echo esc_attr( $which ); ?>">
|
||||
|
||||
<div class="alignleft actions">
|
||||
<?php $this->bulk_actions( $which ); ?>
|
||||
</div>
|
||||
<?php
|
||||
$this->extra_tablenav( $which );
|
||||
$this->pagination( $which );
|
||||
?>
|
||||
|
||||
<br class="clear" />
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Extra controls to be displayed between bulk actions and pagination
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*/
|
||||
function extra_tablenav( $which ) {}
|
||||
|
||||
/**
|
||||
* Generate the <tbody> part of the table
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*/
|
||||
function display_rows_or_placeholder() {
|
||||
if ( $this->has_items() ) {
|
||||
$this->display_rows();
|
||||
} else {
|
||||
list( $columns, $hidden ) = $this->get_column_info();
|
||||
echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
|
||||
$this->no_items();
|
||||
echo '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the table rows
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*/
|
||||
function display_rows() {
|
||||
foreach ( $this->items as $item )
|
||||
$this->single_row( $item );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates content for a single row of the table
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*
|
||||
* @param object $item The current item
|
||||
*/
|
||||
function single_row( $item ) {
|
||||
static $row_class = '';
|
||||
$row_class = ( $row_class == '' ? ' class="alternate"' : '' );
|
||||
|
||||
echo '<tr' . $row_class . '>';
|
||||
echo $this->single_row_columns( $item );
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the columns for a single row of the table
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access protected
|
||||
*
|
||||
* @param object $item The current item
|
||||
*/
|
||||
function single_row_columns( $item ) {
|
||||
list( $columns, $hidden ) = $this->get_column_info();
|
||||
|
||||
foreach ( $columns as $column_name => $column_display_name ) {
|
||||
$class = "class='$column_name column-$column_name'";
|
||||
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) )
|
||||
$style = ' style="display:none;"';
|
||||
|
||||
$attributes = "$class$style";
|
||||
|
||||
if ( 'cb' == $column_name ) {
|
||||
echo '<th scope="row" class="check-column">';
|
||||
echo $this->column_cb( $item );
|
||||
echo '</th>';
|
||||
}
|
||||
elseif ( method_exists( $this, 'column_' . $column_name ) ) {
|
||||
echo "<td $attributes>";
|
||||
echo call_user_func( array( &$this, 'column_' . $column_name ), $item );
|
||||
echo "</td>";
|
||||
}
|
||||
else {
|
||||
echo "<td $attributes>";
|
||||
echo $this->column_default( $item, $column_name );
|
||||
echo "</td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming ajax request (called from admin-ajax.php)
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access public
|
||||
*/
|
||||
function ajax_response() {
|
||||
$this->prepare_items();
|
||||
|
||||
extract( $this->_args );
|
||||
extract( $this->_pagination_args );
|
||||
|
||||
ob_start();
|
||||
if ( ! empty( $_REQUEST['no_placeholder'] ) )
|
||||
$this->display_rows();
|
||||
else
|
||||
$this->display_rows_or_placeholder();
|
||||
|
||||
$rows = ob_get_clean();
|
||||
|
||||
$response = array( 'rows' => $rows );
|
||||
|
||||
if ( isset( $total_items ) )
|
||||
$response['total_items_i18n'] = sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) );
|
||||
|
||||
if ( isset( $total_pages ) ) {
|
||||
$response['total_pages'] = $total_pages;
|
||||
$response['total_pages_i18n'] = number_format_i18n( $total_pages );
|
||||
}
|
||||
|
||||
die( json_encode( $response ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Send required variables to JavaScript land
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
function _js_vars() {
|
||||
$args = array(
|
||||
'class' => get_class( $this ),
|
||||
'screen' => get_current_screen()
|
||||
);
|
||||
|
||||
printf( "<script type='text/javascript'>list_args = %s;</script>\n", json_encode( $args ) );
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,374 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Media Library List Table class.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
*/
|
||||
class WP_Media_List_Table extends WP_List_Table {
|
||||
|
||||
function WP_Media_List_Table() {
|
||||
$this->detached = isset( $_REQUEST['detached'] ) || isset( $_REQUEST['find_detached'] );
|
||||
|
||||
parent::WP_List_Table( array(
|
||||
'plural' => 'media'
|
||||
) );
|
||||
}
|
||||
|
||||
function ajax_user_can() {
|
||||
return current_user_can('upload_files');
|
||||
}
|
||||
|
||||
function prepare_items() {
|
||||
global $lost, $wpdb, $wp_query, $post_mime_types, $avail_post_mime_types;
|
||||
|
||||
$q = $_REQUEST;
|
||||
|
||||
if ( !empty( $lost ) )
|
||||
$q['post__in'] = implode( ',', $lost );
|
||||
|
||||
list( $post_mime_types, $avail_post_mime_types ) = wp_edit_attachments_query( $q );
|
||||
|
||||
$this->is_trash = isset( $_REQUEST['status'] ) && 'trash' == $_REQUEST['status'];
|
||||
|
||||
$this->set_pagination_args( array(
|
||||
'total_items' => $wp_query->found_posts,
|
||||
'total_pages' => $wp_query->max_num_pages,
|
||||
'per_page' => $wp_query->query_vars['posts_per_page'],
|
||||
) );
|
||||
}
|
||||
|
||||
function get_views() {
|
||||
global $wpdb, $post_mime_types, $avail_post_mime_types;
|
||||
|
||||
$type_links = array();
|
||||
$_num_posts = (array) wp_count_attachments();
|
||||
$_total_posts = array_sum($_num_posts) - $_num_posts['trash'];
|
||||
if ( !isset( $total_orphans ) )
|
||||
$total_orphans = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1" );
|
||||
$matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
|
||||
foreach ( $matches as $type => $reals )
|
||||
foreach ( $reals as $real )
|
||||
$num_posts[$type] = ( isset( $num_posts[$type] ) ) ? $num_posts[$type] + $_num_posts[$real] : $_num_posts[$real];
|
||||
|
||||
$class = ( empty($_GET['post_mime_type']) && !$this->detached && !isset($_GET['status']) ) ? ' class="current"' : '';
|
||||
$type_links['all'] = "<a href='upload.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $_total_posts, 'uploaded files' ), number_format_i18n( $_total_posts ) ) . '</a>';
|
||||
foreach ( $post_mime_types as $mime_type => $label ) {
|
||||
$class = '';
|
||||
|
||||
if ( !wp_match_mime_types($mime_type, $avail_post_mime_types) )
|
||||
continue;
|
||||
|
||||
if ( !empty($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
|
||||
$class = ' class="current"';
|
||||
if ( !empty( $num_posts[$mime_type] ) )
|
||||
$type_links[$mime_type] = "<a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
|
||||
}
|
||||
$type_links['detached'] = '<a href="upload.php?detached=1"' . ( $this->detached ? ' class="current"' : '' ) . '>' . sprintf( _nx( 'Unattached <span class="count">(%s)</span>', 'Unattached <span class="count">(%s)</span>', $total_orphans, 'detached files' ), number_format_i18n( $total_orphans ) ) . '</a>';
|
||||
|
||||
if ( !empty($_num_posts['trash']) )
|
||||
$type_links['trash'] = '<a href="upload.php?status=trash"' . ( (isset($_GET['status']) && $_GET['status'] == 'trash' ) ? ' class="current"' : '') . '>' . sprintf( _nx( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '</a>';
|
||||
|
||||
return $type_links;
|
||||
}
|
||||
|
||||
function get_bulk_actions() {
|
||||
$actions = array();
|
||||
$actions['delete'] = __( 'Delete Permanently' );
|
||||
if ( $this->detached )
|
||||
$actions['attach'] = __( 'Attach to a post' );
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
function extra_tablenav( $which ) {
|
||||
global $post_type;
|
||||
$post_type_obj = get_post_type_object( $post_type );
|
||||
?>
|
||||
<div class="alignleft actions">
|
||||
<?php
|
||||
if ( 'top' == $which && !is_singular() && !$this->detached && !$this->is_trash ) {
|
||||
$this->months_dropdown( $post_type );
|
||||
|
||||
do_action( 'restrict_manage_posts' );
|
||||
submit_button( __( 'Filter' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) );
|
||||
}
|
||||
|
||||
if ( $this->detached ) {
|
||||
submit_button( __( 'Scan for lost attachments' ), 'secondary', 'find_detached', false );
|
||||
} elseif ( $this->is_trash && current_user_can( 'edit_others_posts' ) ) {
|
||||
submit_button( __( 'Empty Trash' ), 'button-secondary apply', 'delete_all', false );
|
||||
} ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
function current_action() {
|
||||
if ( isset( $_REQUEST['find_detached'] ) )
|
||||
return 'find_detached';
|
||||
|
||||
if ( isset( $_REQUEST['found_post_id'] ) && isset( $_REQUEST['media'] ) )
|
||||
return 'attach';
|
||||
|
||||
if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) )
|
||||
return 'delete_all';
|
||||
|
||||
return parent::current_action();
|
||||
}
|
||||
|
||||
function has_items() {
|
||||
return have_posts();
|
||||
}
|
||||
|
||||
function no_items() {
|
||||
_e( 'No media attachments found.' );
|
||||
}
|
||||
|
||||
function get_columns() {
|
||||
$posts_columns = array();
|
||||
$posts_columns['cb'] = '<input type="checkbox" />';
|
||||
$posts_columns['icon'] = '';
|
||||
/* translators: column name */
|
||||
$posts_columns['title'] = _x( 'File', 'column name' );
|
||||
$posts_columns['author'] = __( 'Author' );
|
||||
//$posts_columns['tags'] = _x( 'Tags', 'column name' );
|
||||
/* translators: column name */
|
||||
if ( !$this->detached ) {
|
||||
$posts_columns['parent'] = _x( 'Attached to', 'column name' );
|
||||
$posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>';
|
||||
}
|
||||
/* translators: column name */
|
||||
$posts_columns['date'] = _x( 'Date', 'column name' );
|
||||
$posts_columns = apply_filters( 'manage_media_columns', $posts_columns, $this->detached );
|
||||
|
||||
return $posts_columns;
|
||||
}
|
||||
|
||||
function get_sortable_columns() {
|
||||
return array(
|
||||
'title' => 'title',
|
||||
'author' => 'author',
|
||||
'parent' => 'parent',
|
||||
'comments' => 'comment_count',
|
||||
'date' => array( 'date', true ),
|
||||
);
|
||||
}
|
||||
|
||||
function display_rows() {
|
||||
global $post, $id;
|
||||
|
||||
add_filter( 'the_title','esc_html' );
|
||||
$alt = '';
|
||||
|
||||
while ( have_posts() ) : the_post();
|
||||
|
||||
if ( $this->is_trash && $post->post_status != 'trash'
|
||||
|| !$this->is_trash && $post->post_status == 'trash' )
|
||||
continue;
|
||||
|
||||
$alt = ( 'alternate' == $alt ) ? '' : 'alternate';
|
||||
$post_owner = ( get_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">
|
||||
<?php
|
||||
|
||||
list( $columns, $hidden ) = $this->get_column_info();
|
||||
foreach ( $columns as $column_name => $column_display_name ) {
|
||||
$class = "class='$column_name column-$column_name'";
|
||||
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) )
|
||||
$style = ' style="display:none;"';
|
||||
|
||||
$attributes = $class . $style;
|
||||
|
||||
switch ( $column_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>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'icon':
|
||||
$attributes = 'class="column-icon media-icon"' . $style;
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php
|
||||
if ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) {
|
||||
if ( $this->is_trash ) {
|
||||
echo $thumb;
|
||||
} else {
|
||||
?>
|
||||
<a href="<?php echo get_edit_post_link( $post->ID, true ); ?>" title="<?php echo esc_attr( sprintf( __( 'Edit “%s”' ), $att_title ) ); ?>">
|
||||
<?php echo $thumb; ?>
|
||||
</a>
|
||||
|
||||
<?php }
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'title':
|
||||
?>
|
||||
<td <?php echo $attributes ?>><strong><?php if ( $this->is_trash ) echo $att_title; else { ?><a href="<?php echo get_edit_post_link( $post->ID, true ); ?>" title="<?php echo esc_attr( sprintf( __( 'Edit “%s”' ), $att_title ) ); ?>"><?php echo $att_title; ?></a><?php } ?></strong>
|
||||
<p>
|
||||
<?php
|
||||
if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) )
|
||||
echo esc_html( strtoupper( $matches[1] ) );
|
||||
else
|
||||
echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) );
|
||||
?>
|
||||
</p>
|
||||
<?php
|
||||
echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) );
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'author':
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php the_author() ?></td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'tags':
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php
|
||||
$tags = get_the_tags();
|
||||
if ( !empty( $tags ) ) {
|
||||
$out = array();
|
||||
foreach ( $tags as $c )
|
||||
$out[] = "<a href='edit.php?tag=$c->slug'> " . esc_html( sanitize_term_field( 'name', $c->name, $c->term_id, 'post_tag', 'display' ) ) . "</a>";
|
||||
echo join( ', ', $out );
|
||||
} else {
|
||||
_e( 'No Tags' );
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'desc':
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php echo has_excerpt() ? $post->post_excerpt : ''; ?></td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'date':
|
||||
if ( '0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name ) {
|
||||
$t_time = $h_time = __( 'Unpublished' );
|
||||
} else {
|
||||
$t_time = get_the_time( __( 'Y/m/d g:i:s A' ) );
|
||||
$m_time = $post->post_date;
|
||||
$time = get_post_time( 'G', true, $post, false );
|
||||
if ( ( abs( $t_diff = time() - $time ) ) < 86400 ) {
|
||||
if ( $t_diff < 0 )
|
||||
$h_time = sprintf( __( '%s from now' ), human_time_diff( $time ) );
|
||||
else
|
||||
$h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
|
||||
} else {
|
||||
$h_time = mysql2date( __( 'Y/m/d' ), $m_time );
|
||||
}
|
||||
}
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php echo $h_time ?></td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'parent':
|
||||
if ( $post->post_parent > 0 ) {
|
||||
if ( get_post( $post->post_parent ) ) {
|
||||
$title =_draft_or_post_title( $post->post_parent );
|
||||
}
|
||||
?>
|
||||
<td <?php echo $attributes ?>>
|
||||
<strong><a href="<?php echo get_edit_post_link( $post->post_parent ); ?>"><?php echo $title ?></a></strong>,
|
||||
<?php echo get_the_time( __( 'Y/m/d' ) ); ?>
|
||||
</td>
|
||||
<?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>
|
||||
<?php
|
||||
}
|
||||
break;
|
||||
|
||||
case 'comments':
|
||||
$attributes = 'class="comments column-comments num"' . $style;
|
||||
?>
|
||||
<td <?php echo $attributes ?>>
|
||||
<div class="post-com-count-wrapper">
|
||||
<?php
|
||||
$pending_comments = get_pending_comments_num( $post->ID );
|
||||
|
||||
$this->comments_bubble( $post->ID, $pending_comments );
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
default:
|
||||
?>
|
||||
<td <?php echo $attributes ?>>
|
||||
<?php do_action( 'manage_media_custom_column', $column_name, $id ); ?>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php endwhile;
|
||||
}
|
||||
|
||||
function _get_row_actions( $post, $att_title ) {
|
||||
$actions = array();
|
||||
|
||||
if ( $this->detached ) {
|
||||
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 ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
|
||||
$actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url( "post.php?action=trash&post=$post->ID", 'trash-attachment_' . $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
|
||||
} else {
|
||||
$delete_ays = !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
|
||||
$actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url( "post.php?action=delete&post=$post->ID", 'delete-attachment_' . $post->ID ) . "'>" . __( 'Delete Permanently' ) . "</a>";
|
||||
}
|
||||
$actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $att_title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
|
||||
if ( current_user_can( 'edit_post', $post->ID ) )
|
||||
$actions['attach'] = '<a href="#the-list" onclick="findPosts.open( \'media[]\',\''.$post->ID.'\' );return false;" class="hide-if-no-js">'.__( 'Attach' ).'</a>';
|
||||
}
|
||||
else {
|
||||
if ( current_user_can( 'edit_post', $post->ID ) && !$this->is_trash )
|
||||
$actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '">' . __( 'Edit' ) . '</a>';
|
||||
if ( current_user_can( 'delete_post', $post->ID ) ) {
|
||||
if ( $this->is_trash )
|
||||
$actions['untrash'] = "<a class='submitdelete' href='" . wp_nonce_url( "post.php?action=untrash&post=$post->ID", 'untrash-attachment_' . $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-attachment_' . $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
|
||||
if ( $this->is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) {
|
||||
$delete_ays = ( !$this->is_trash && !MEDIA_TRASH ) ? " onclick='return showNotice.warn();'" : '';
|
||||
$actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url( "post.php?action=delete&post=$post->ID", 'delete-attachment_' . $post->ID ) . "'>" . __( 'Delete Permanently' ) . "</a>";
|
||||
}
|
||||
}
|
||||
if ( !$this->is_trash ) {
|
||||
$title =_draft_or_post_title( $post->post_parent );
|
||||
$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, $this->detached );
|
||||
|
||||
return $actions;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,340 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Sites List Table class.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
*/
|
||||
class WP_MS_Sites_List_Table extends WP_List_Table {
|
||||
|
||||
function WP_MS_Sites_List_Table() {
|
||||
parent::WP_List_Table( array(
|
||||
'plural' => 'sites',
|
||||
) );
|
||||
}
|
||||
|
||||
function ajax_user_can() {
|
||||
return current_user_can( 'manage_sites' );
|
||||
}
|
||||
|
||||
function prepare_items() {
|
||||
global $s, $mode, $wpdb, $current_site;
|
||||
|
||||
$mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode'];
|
||||
|
||||
$per_page = $this->get_items_per_page( 'sites_network_per_page' );
|
||||
|
||||
$pagenum = $this->get_pagenum();
|
||||
|
||||
$s = isset( $_REQUEST['s'] ) ? stripslashes( trim( $_REQUEST[ 's' ] ) ) : '';
|
||||
$wild = '';
|
||||
if ( false !== strpos($s, '*') ) {
|
||||
$wild = '%';
|
||||
$s = trim($s, '*');
|
||||
}
|
||||
|
||||
$like_s = esc_sql( like_escape( $s ) );
|
||||
|
||||
$large_network = false;
|
||||
// If the network is large and a search is not being performed, show only the latest blogs with no paging in order
|
||||
// to avoid expensive count queries.
|
||||
if ( !$s && ( get_blog_count() >= 10000 ) ) {
|
||||
if ( !isset($_REQUEST['orderby']) )
|
||||
$_GET['orderby'] = $_REQUEST['orderby'] = '';
|
||||
if ( !isset($_REQUEST['order']) )
|
||||
$_GET['order'] = $_REQUEST['order'] = 'DESC';
|
||||
$large_network = true;
|
||||
}
|
||||
|
||||
$query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ";
|
||||
|
||||
if ( empty($s) ) {
|
||||
// Nothing to do.
|
||||
} elseif ( preg_match('/^[0-9]+\./', $s) ) {
|
||||
// IP address
|
||||
$reg_blog_ids = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.IP LIKE ( '{$like_s}$wild' )" );
|
||||
|
||||
if ( !$reg_blog_ids )
|
||||
$reg_blog_ids = array( 0 );
|
||||
|
||||
$query = "SELECT *
|
||||
FROM {$wpdb->blogs}
|
||||
WHERE site_id = '{$wpdb->siteid}'
|
||||
AND {$wpdb->blogs}.blog_id IN (" . implode( ', ', $reg_blog_ids ) . ")";
|
||||
} else {
|
||||
if ( is_numeric($s) ) {
|
||||
$query .= " AND ( {$wpdb->blogs}.blog_id = '{$like_s}' )";
|
||||
} elseif ( is_subdomain_install() ) {
|
||||
$blog_s = str_replace( '.' . $current_site->domain, '', $like_s );
|
||||
$blog_s .= $wild . '.' . $current_site->domain;
|
||||
$query .= " AND ( {$wpdb->blogs}.domain LIKE '$blog_s' ) ";
|
||||
} else {
|
||||
if ( $like_s != trim('/', $current_site->path) )
|
||||
$blog_s = $current_site->path .= $like_s . $wild . '/';
|
||||
else
|
||||
$blog_s = $like_s;
|
||||
$query .= " AND ( {$wpdb->blogs}.path LIKE '$blog_s' )";
|
||||
}
|
||||
}
|
||||
|
||||
$order_by = isset( $_REQUEST['orderby'] ) ? $_REQUEST['orderby'] : '';
|
||||
if ( $order_by == 'registered' ) {
|
||||
$query .= ' ORDER BY registered ';
|
||||
} elseif ( $order_by == 'lastupdated' ) {
|
||||
$query .= ' ORDER BY last_updated ';
|
||||
} elseif ( $order_by == 'blogname' ) {
|
||||
if ( is_subdomain_install() )
|
||||
$query .= ' ORDER BY domain ';
|
||||
else
|
||||
$query .= ' ORDER BY path ';
|
||||
} elseif ( $order_by == 'blog_id' ) {
|
||||
$query .= ' ORDER BY blog_id ';
|
||||
} else {
|
||||
$order_by = null;
|
||||
}
|
||||
|
||||
if ( isset( $order_by ) ) {
|
||||
$order = ( isset( $_REQUEST['order'] ) && 'DESC' == strtoupper( $_REQUEST['order'] ) ) ? "DESC" : "ASC";
|
||||
$query .= $order;
|
||||
}
|
||||
|
||||
// Don't do an unbounded count on large networks
|
||||
if ( ! $large_network )
|
||||
$total = $wpdb->get_var( str_replace( 'SELECT *', 'SELECT COUNT( blog_id )', $query ) );
|
||||
|
||||
$query .= " LIMIT " . intval( ( $pagenum - 1 ) * $per_page ) . ", " . intval( $per_page );
|
||||
$this->items = $wpdb->get_results( $query, ARRAY_A );
|
||||
|
||||
if ( $large_network )
|
||||
$total = count($this->items);
|
||||
|
||||
$this->set_pagination_args( array(
|
||||
'total_items' => $total,
|
||||
'per_page' => $per_page,
|
||||
) );
|
||||
}
|
||||
|
||||
function no_items() {
|
||||
_e( 'No sites found.' );
|
||||
}
|
||||
|
||||
function get_bulk_actions() {
|
||||
$actions = array();
|
||||
if ( current_user_can( 'delete_sites' ) )
|
||||
$actions['delete'] = __( 'Delete' );
|
||||
$actions['spam'] = _x( 'Mark as Spam', 'site' );
|
||||
$actions['notspam'] = _x( 'Not Spam', 'site' );
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
function pagination( $which ) {
|
||||
global $mode;
|
||||
|
||||
parent::pagination( $which );
|
||||
|
||||
if ( 'top' == $which )
|
||||
$this->view_switcher( $mode );
|
||||
}
|
||||
|
||||
function get_columns() {
|
||||
$blogname_columns = ( is_subdomain_install() ) ? __( 'Domain' ) : __( 'Path' );
|
||||
$sites_columns = array(
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'blogname' => $blogname_columns,
|
||||
'lastupdated' => __( 'Last Updated' ),
|
||||
'registered' => _x( 'Registered', 'site' ),
|
||||
'users' => __( 'Users' )
|
||||
);
|
||||
|
||||
if ( has_filter( 'wpmublogsaction' ) )
|
||||
$sites_columns['plugins'] = __( 'Actions' );
|
||||
|
||||
$sites_columns = apply_filters( 'wpmu_blogs_columns', $sites_columns );
|
||||
|
||||
return $sites_columns;
|
||||
}
|
||||
|
||||
function get_sortable_columns() {
|
||||
return array(
|
||||
'blogname' => 'blogname',
|
||||
'lastupdated' => 'lastupdated',
|
||||
'registered' => 'blog_id',
|
||||
);
|
||||
}
|
||||
|
||||
function display_rows() {
|
||||
global $current_site, $mode;
|
||||
|
||||
$status_list = array(
|
||||
'archived' => array( 'site-archived', __( 'Archived' ) ),
|
||||
'spam' => array( 'site-spammed', _x( 'Spam', 'site' ) ),
|
||||
'deleted' => array( 'site-deleted', __( 'Deleted' ) ),
|
||||
'mature' => array( 'site-mature', __( 'Mature' ) )
|
||||
);
|
||||
|
||||
$class = '';
|
||||
foreach ( $this->items as $blog ) {
|
||||
$class = ( 'alternate' == $class ) ? '' : 'alternate';
|
||||
reset( $status_list );
|
||||
|
||||
$blog_states = array();
|
||||
foreach ( $status_list as $status => $col ) {
|
||||
if ( get_blog_status( $blog['blog_id'], $status ) == 1 ) {
|
||||
$class = $col[0];
|
||||
$blog_states[] = $col[1];
|
||||
}
|
||||
}
|
||||
$blog_state = '';
|
||||
if ( ! empty( $blog_states ) ) {
|
||||
$state_count = count( $blog_states );
|
||||
$i = 0;
|
||||
$blog_state .= ' - ';
|
||||
foreach ( $blog_states as $state ) {
|
||||
++$i;
|
||||
( $i == $state_count ) ? $sep = '' : $sep = ', ';
|
||||
$blog_state .= "<span class='post-state'>$state$sep</span>";
|
||||
}
|
||||
}
|
||||
echo "<tr class='$class'>";
|
||||
|
||||
$blogname = ( is_subdomain_install() ) ? str_replace( '.'.$current_site->domain, '', $blog['domain'] ) : $blog['path'];
|
||||
|
||||
list( $columns, $hidden ) = $this->get_column_info();
|
||||
|
||||
foreach ( $columns as $column_name => $column_display_name ) {
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) )
|
||||
$style = ' style="display:none;"';
|
||||
|
||||
switch ( $column_name ) {
|
||||
case 'cb': ?>
|
||||
<th scope="row" class="check-column">
|
||||
<input type="checkbox" id="blog_<?php echo $blog['blog_id'] ?>" name="allblogs[]" value="<?php echo esc_attr( $blog['blog_id'] ) ?>" />
|
||||
</th>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'id':?>
|
||||
<th valign="top" scope="row">
|
||||
<?php echo $blog['blog_id'] ?>
|
||||
</th>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'blogname':
|
||||
echo "<td class='column-$column_name $column_name'$style>"; ?>
|
||||
<a href="<?php echo esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ); ?>" class="edit"><?php echo $blogname . $blog_state; ?></a>
|
||||
<?php
|
||||
if ( 'list' != $mode )
|
||||
echo '<p>' . sprintf( _x( '%1$s – <em>%2$s</em>', '%1$s: site name. %2$s: site tagline.' ), get_blog_option( $blog['blog_id'], 'blogname' ), get_blog_option( $blog['blog_id'], 'blogdescription ' ) ) . '</p>';
|
||||
|
||||
// Preordered.
|
||||
$actions = array(
|
||||
'edit' => '', 'backend' => '',
|
||||
'activate' => '', 'deactivate' => '',
|
||||
'archive' => '', 'unarchive' => '',
|
||||
'spam' => '', 'unspam' => '',
|
||||
'delete' => '',
|
||||
'visit' => '',
|
||||
);
|
||||
|
||||
$actions['edit'] = '<span class="edit"><a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>';
|
||||
$actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>';
|
||||
if ( $current_site->blog_id != $blog['blog_id'] ) {
|
||||
if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' )
|
||||
$actions['activate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ), 'confirm' ) ) . '">' . __( 'Activate' ) . '</a></span>';
|
||||
else
|
||||
$actions['deactivate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to deactivate the site %s' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Deactivate' ) . '</a></span>';
|
||||
|
||||
if ( get_blog_status( $blog['blog_id'], 'archived' ) == '1' )
|
||||
$actions['unarchive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unarchive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Unarchive' ) . '</a></span>';
|
||||
else
|
||||
$actions['archive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to archive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></span>';
|
||||
|
||||
if ( get_blog_status( $blog['blog_id'], 'spam' ) == '1' )
|
||||
$actions['unspam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unspam the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Not Spam', 'site' ) . '</a></span>';
|
||||
else
|
||||
$actions['spam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to mark the site %s as spam.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Spam', 'site' ) . '</a></span>';
|
||||
|
||||
if ( current_user_can( 'delete_site', $blog['blog_id'] ) )
|
||||
$actions['delete'] = '<span class="delete"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Delete' ) . '</a></span>';
|
||||
}
|
||||
|
||||
$actions['visit'] = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'] ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>';
|
||||
|
||||
$actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );
|
||||
echo $this->row_actions( $actions );
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'lastupdated':
|
||||
echo "<td valign='top' class='$column_name column-$column_name'$style>";
|
||||
if ( 'list' == $mode )
|
||||
$date = 'Y/m/d';
|
||||
else
|
||||
$date = 'Y/m/d \<\b\r \/\> g:i:s a';
|
||||
echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] ); ?>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
case 'registered':
|
||||
echo "<td valign='top' class='$column_name column-$column_name'$style>";
|
||||
if ( $blog['registered'] == '0000-00-00 00:00:00' )
|
||||
echo '—';
|
||||
else
|
||||
echo mysql2date( $date, $blog['registered'] );
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
case 'users':
|
||||
echo "<td valign='top' class='$column_name column-$column_name'$style>";
|
||||
$blogusers = get_users( array( 'blog_id' => $blog['blog_id'], 'number' => 6) );
|
||||
if ( is_array( $blogusers ) ) {
|
||||
$blogusers_warning = '';
|
||||
if ( count( $blogusers ) > 5 ) {
|
||||
$blogusers = array_slice( $blogusers, 0, 5 );
|
||||
$blogusers_warning = __( 'Only showing first 5 users.' ) . ' <a href="' . esc_url( network_admin_url( 'site-users.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'More' ) . '</a>';
|
||||
}
|
||||
foreach ( $blogusers as $user_object ) {
|
||||
echo '<a href="' . esc_url( network_admin_url( 'user-edit.php?user_id=' . $user_object->ID ) ) . '">' . esc_html( $user_object->user_login ) . '</a> ';
|
||||
if ( 'list' != $mode )
|
||||
echo '( ' . $user_object->user_email . ' )';
|
||||
echo '<br />';
|
||||
}
|
||||
if ( $blogusers_warning != '' )
|
||||
echo '<strong>' . $blogusers_warning . '</strong><br />';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'plugins': ?>
|
||||
<?php if ( has_filter( 'wpmublogsaction' ) ) {
|
||||
echo "<td valign='top' class='$column_name column-$column_name'$style>";
|
||||
do_action( 'wpmublogsaction', $blog['blog_id'] ); ?>
|
||||
</td>
|
||||
<?php }
|
||||
break;
|
||||
|
||||
default:
|
||||
echo "<td class='$column_name column-$column_name'$style>";
|
||||
do_action( 'manage_sites_custom_column', $column_name, $blog['blog_id'] );
|
||||
echo "</td>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,361 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* MS Themes List Table class.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
*/
|
||||
class WP_MS_Themes_List_Table extends WP_List_Table {
|
||||
|
||||
var $site_id;
|
||||
var $is_site_themes;
|
||||
|
||||
function WP_MS_Themes_List_Table() {
|
||||
global $status, $page;
|
||||
|
||||
$default_status = get_user_option( 'themes_last_view' );
|
||||
if ( empty( $default_status ) )
|
||||
$default_status = 'all';
|
||||
$status = isset( $_REQUEST['theme_status'] ) ? $_REQUEST['theme_status'] : $default_status;
|
||||
if ( !in_array( $status, array( 'all', 'enabled', 'disabled', 'upgrade', 'search' ) ) )
|
||||
$status = 'all';
|
||||
if ( $status != $default_status && 'search' != $status )
|
||||
update_user_meta( get_current_user_id(), 'themes_last_view', $status );
|
||||
|
||||
$page = $this->get_pagenum();
|
||||
|
||||
$screen = get_current_screen();
|
||||
$this->is_site_themes = ( 'site-themes-network' == $screen->id ) ? true : false;
|
||||
|
||||
if ( $this->is_site_themes )
|
||||
$this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
|
||||
|
||||
parent::WP_List_Table( array(
|
||||
'plural' => 'themes'
|
||||
) );
|
||||
}
|
||||
|
||||
function get_table_classes() {
|
||||
return array( 'widefat', 'plugins' ); // todo: remove and add CSS for .themes
|
||||
}
|
||||
|
||||
function ajax_user_can() {
|
||||
$menu_perms = get_site_option( 'menu_items', array() );
|
||||
|
||||
if ( empty( $menu_perms['themes'] ) && ! is_super_admin() )
|
||||
return false;
|
||||
|
||||
if ( $this->is_site_themes && !current_user_can('manage_sites') )
|
||||
return false;
|
||||
elseif ( !$this->is_site_themes && !current_user_can('manage_network_themes') )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function prepare_items() {
|
||||
global $status, $themes, $totals, $page, $orderby, $order, $s;
|
||||
|
||||
wp_reset_vars( array( 'orderby', 'order', 's' ) );
|
||||
|
||||
$themes = array(
|
||||
'all' => apply_filters( 'all_themes', get_themes() ),
|
||||
'search' => array(),
|
||||
'enabled' => array(),
|
||||
'disabled' => array(),
|
||||
'upgrade' => array()
|
||||
);
|
||||
|
||||
$site_allowed_themes = get_site_allowed_themes();
|
||||
if ( !$this->is_site_themes ) {
|
||||
$allowed_themes = $site_allowed_themes;
|
||||
$themes_per_page = $this->get_items_per_page( 'themes_network_per_page' );
|
||||
} else {
|
||||
$allowed_themes = wpmu_get_blog_allowedthemes( $this->site_id );
|
||||
$themes_per_page = $this->get_items_per_page( 'site_themes_network_per_page' );
|
||||
}
|
||||
|
||||
$current = get_site_transient( 'update_themes' );
|
||||
|
||||
foreach ( (array) $themes['all'] as $key => $theme ) {
|
||||
$theme_key = $theme['Stylesheet'];
|
||||
|
||||
if ( isset( $allowed_themes [ $theme_key ] ) ) {
|
||||
$themes['all'][$key]['enabled'] = true;
|
||||
$themes['enabled'][$key] = $themes['all'][$key];
|
||||
}
|
||||
else {
|
||||
$themes['all'][$key]['enabled'] = false;
|
||||
$themes['disabled'][$key] = $themes['all'][$key];
|
||||
}
|
||||
if ( isset( $current->response[ $theme['Template'] ] ) )
|
||||
$themes['upgrade'][$key] = $themes['all'][$key];
|
||||
|
||||
if ( $this->is_site_themes && isset( $site_allowed_themes[$theme_key] ) ) {
|
||||
unset( $themes['all'][$key] );
|
||||
unset( $themes['enabled'][$key] );
|
||||
unset( $themes['disabled'][$key] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !current_user_can( 'update_themes' ) || $this->is_site_themes )
|
||||
$themes['upgrade'] = array();
|
||||
|
||||
if ( $s ) {
|
||||
$status = 'search';
|
||||
$themes['search'] = array_filter( $themes['all'], array( &$this, '_search_callback' ) );
|
||||
}
|
||||
|
||||
$totals = array();
|
||||
foreach ( $themes as $type => $list )
|
||||
$totals[ $type ] = count( $list );
|
||||
|
||||
if ( empty( $themes[ $status ] ) && !in_array( $status, array( 'all', 'search' ) ) )
|
||||
$status = 'all';
|
||||
|
||||
$this->items = $themes[ $status ];
|
||||
$total_this_page = $totals[ $status ];
|
||||
|
||||
if ( $orderby ) {
|
||||
$orderby = ucfirst( $orderby );
|
||||
$order = strtoupper( $order );
|
||||
|
||||
uasort( $this->items, array( &$this, '_order_callback' ) );
|
||||
}
|
||||
|
||||
$start = ( $page - 1 ) * $themes_per_page;
|
||||
|
||||
if ( $total_this_page > $themes_per_page )
|
||||
$this->items = array_slice( $this->items, $start, $themes_per_page );
|
||||
|
||||
$this->set_pagination_args( array(
|
||||
'total_items' => $total_this_page,
|
||||
'per_page' => $themes_per_page,
|
||||
) );
|
||||
}
|
||||
|
||||
function _search_callback( $theme ) {
|
||||
static $term;
|
||||
if ( is_null( $term ) )
|
||||
$term = stripslashes( $_REQUEST['s'] );
|
||||
|
||||
$search_fields = array( 'Name', 'Title', 'Description', 'Author', 'Author Name', 'Author URI', 'Template', 'Stylesheet' );
|
||||
foreach ( $search_fields as $field )
|
||||
if ( stripos( $theme[ $field ], $term ) !== false )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function _order_callback( $theme_a, $theme_b ) {
|
||||
global $orderby, $order;
|
||||
|
||||
$a = $theme_a[$orderby];
|
||||
$b = $theme_b[$orderby];
|
||||
|
||||
if ( $a == $b )
|
||||
return 0;
|
||||
|
||||
if ( 'DESC' == $order )
|
||||
return ( $a < $b ) ? 1 : -1;
|
||||
else
|
||||
return ( $a < $b ) ? -1 : 1;
|
||||
}
|
||||
|
||||
function no_items() {
|
||||
global $themes;
|
||||
|
||||
if ( !empty( $themes['all'] ) )
|
||||
_e( 'No themes found.' );
|
||||
else
|
||||
_e( 'You do not appear to have any themes available at this time.' );
|
||||
}
|
||||
|
||||
function get_columns() {
|
||||
global $status;
|
||||
|
||||
return array(
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'name' => __( 'Theme' ),
|
||||
'description' => __( 'Description' ),
|
||||
);
|
||||
}
|
||||
|
||||
function get_sortable_columns() {
|
||||
return array(
|
||||
'name' => 'name',
|
||||
);
|
||||
}
|
||||
|
||||
function get_views() {
|
||||
global $totals, $status;
|
||||
|
||||
$status_links = array();
|
||||
foreach ( $totals as $type => $count ) {
|
||||
if ( !$count )
|
||||
continue;
|
||||
|
||||
switch ( $type ) {
|
||||
case 'all':
|
||||
$text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'themes' );
|
||||
break;
|
||||
case 'enabled':
|
||||
$text = _n( 'Enabled <span class="count">(%s)</span>', 'Enabled <span class="count">(%s)</span>', $count );
|
||||
break;
|
||||
case 'disabled':
|
||||
$text = _n( 'Disabled <span class="count">(%s)</span>', 'Disabled <span class="count">(%s)</span>', $count );
|
||||
break;
|
||||
case 'upgrade':
|
||||
$text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( $this->is_site_themes )
|
||||
$url = 'site-themes.php?id=' . $this->site_id;
|
||||
else
|
||||
$url = 'themes.php';
|
||||
|
||||
if ( 'search' != $type ) {
|
||||
$status_links[$type] = sprintf( "<a href='%s' %s>%s</a>",
|
||||
esc_url( add_query_arg('theme_status', $type, $url) ),
|
||||
( $type == $status ) ? ' class="current"' : '',
|
||||
sprintf( $text, number_format_i18n( $count ) )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $status_links;
|
||||
}
|
||||
|
||||
function get_bulk_actions() {
|
||||
global $status;
|
||||
|
||||
$actions = array();
|
||||
if ( 'enabled' != $status )
|
||||
$actions['enable-selected'] = $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' );
|
||||
if ( 'disabled' != $status )
|
||||
$actions['disable-selected'] = $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' );
|
||||
if ( ! $this->is_site_themes ) {
|
||||
if ( current_user_can( 'delete_themes' ) )
|
||||
$actions['delete-selected'] = __( 'Delete' );
|
||||
if ( current_user_can( 'update_themes' ) )
|
||||
$actions['update-selected'] = __( 'Update' );
|
||||
}
|
||||
return $actions;
|
||||
}
|
||||
|
||||
function bulk_actions( $which ) {
|
||||
global $status;
|
||||
parent::bulk_actions( $which );
|
||||
}
|
||||
|
||||
function current_action() {
|
||||
return parent::current_action();
|
||||
}
|
||||
|
||||
function display_rows() {
|
||||
foreach ( $this->items as $key => $theme )
|
||||
$this->single_row( $key, $theme );
|
||||
}
|
||||
|
||||
function single_row( $key, $theme ) {
|
||||
global $status, $page, $s;
|
||||
|
||||
$context = $status;
|
||||
|
||||
if ( $this->is_site_themes )
|
||||
$url = "site-themes.php?id={$this->site_id}&";
|
||||
else
|
||||
$url = 'themes.php?';
|
||||
|
||||
// preorder
|
||||
$actions = array(
|
||||
'enable' => '',
|
||||
'disable' => '',
|
||||
'edit' => '',
|
||||
'delete' => ''
|
||||
);
|
||||
|
||||
$theme_key = $theme['Stylesheet'];
|
||||
|
||||
if ( empty( $theme['enabled'] ) )
|
||||
$actions['enable'] = '<a href="' . esc_url( wp_nonce_url($url . 'action=enable&theme=' . $theme_key . '&paged=' . $page . '&s=' . $s, 'enable-theme_' . $theme_key) ) . '" title="' . esc_attr__('Enable this theme') . '" class="edit">' . ( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) ) . '</a>';
|
||||
else
|
||||
$actions['disable'] = '<a href="' . esc_url( wp_nonce_url($url . 'action=disable&theme=' . $theme_key . '&paged=' . $page . '&s=' . $s, 'disable-theme_' . $theme_key) ) . '" title="' . esc_attr__('Disable this theme') . '">' . ( $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' ) ) . '</a>';
|
||||
|
||||
if ( current_user_can('edit_themes') )
|
||||
$actions['edit'] = '<a href="' . esc_url('theme-editor.php?theme=' . urlencode( $theme['Name'] )) . '" title="' . esc_attr__('Open this theme in the Theme Editor') . '" class="edit">' . __('Edit') . '</a>';
|
||||
|
||||
if ( empty( $theme['enabled'] ) && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $theme_key != get_option( 'stylesheet' ) && $theme_key != get_option( 'template' ) )
|
||||
$actions['delete'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=delete-selected&checked[]=' . $theme_key . '&theme_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-themes' ) ) . '" title="' . esc_attr__( 'Delete this theme' ) . '" class="delete">' . __( 'Delete' ) . '</a>';
|
||||
|
||||
$actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme_key, $theme, $context );
|
||||
$actions = apply_filters( "theme_action_links_$theme_key", $actions, $theme_key, $theme, $context );
|
||||
|
||||
$class = empty( $theme['enabled'] ) ? 'inactive' : 'active';
|
||||
$checkbox_id = "checkbox_" . md5($theme['Name']);
|
||||
$checkbox = "<input type='checkbox' name='checked[]' value='" . esc_attr( $theme_key ) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $theme['Name'] . "</label>";
|
||||
|
||||
$description = '<p>' . $theme['Description'] . '</p>';
|
||||
$theme_name = $theme['Name'];
|
||||
|
||||
$id = sanitize_title( $theme_name );
|
||||
|
||||
echo "<tr id='$id' class='$class'>";
|
||||
|
||||
list( $columns, $hidden ) = $this->get_column_info();
|
||||
|
||||
foreach ( $columns as $column_name => $column_display_name ) {
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) )
|
||||
$style = ' style="display:none;"';
|
||||
|
||||
switch ( $column_name ) {
|
||||
case 'cb':
|
||||
echo "<th scope='row' class='check-column'>$checkbox</th>";
|
||||
break;
|
||||
case 'name':
|
||||
echo "<td class='theme-title'$style><strong>$theme_name</strong>";
|
||||
echo $this->row_actions( $actions, true );
|
||||
echo "</td>";
|
||||
break;
|
||||
case 'description':
|
||||
echo "<td class='column-description desc'$style>
|
||||
<div class='theme-description'>$description</div>
|
||||
<div class='$class second theme-version-author-uri'>";
|
||||
|
||||
$theme_meta = array();
|
||||
|
||||
if ( !empty( $theme['Version'] ) )
|
||||
$theme_meta[] = sprintf( __( 'Version %s' ), $theme['Version'] );
|
||||
|
||||
if ( !empty( $theme['Author'] ) )
|
||||
$theme_meta[] = sprintf( __( 'By %s' ), $theme['Author'] );
|
||||
|
||||
if ( !empty( $theme['Theme URI'] ) )
|
||||
$theme_meta[] = '<a href="' . $theme['Theme URI'] . '" title="' . esc_attr__( 'Visit theme homepage' ) . '">' . __( 'Visit Theme Site' ) . '</a>';
|
||||
|
||||
$theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $theme_key, $theme, $status );
|
||||
echo implode( ' | ', $theme_meta );
|
||||
|
||||
echo "</div></td>";
|
||||
break;
|
||||
|
||||
default:
|
||||
echo "<td class='$column_name column-$column_name'$style>";
|
||||
do_action( 'manage_themes_custom_column', $column_name, $theme_key, $theme );
|
||||
echo "</td>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</tr>";
|
||||
|
||||
if ( $this->is_site_themes )
|
||||
remove_action( "after_theme_row_$theme_key", 'wp_theme_update_row' );
|
||||
do_action( 'after_theme_row', $theme_key, $theme, $status );
|
||||
do_action( "after_theme_row_$theme_key", $theme_key, $theme, $status );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,276 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Multisite Users List Table class.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
*/
|
||||
class WP_MS_Users_List_Table extends WP_List_Table {
|
||||
|
||||
function ajax_user_can() {
|
||||
return current_user_can( 'manage_network_users' );
|
||||
}
|
||||
|
||||
function prepare_items() {
|
||||
global $usersearch, $role, $wpdb, $mode;
|
||||
|
||||
$usersearch = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
|
||||
|
||||
$users_per_page = $this->get_items_per_page( 'users_network_per_page' );
|
||||
|
||||
$role = isset( $_REQUEST['role'] ) ? $_REQUEST['role'] : '';
|
||||
|
||||
$paged = $this->get_pagenum();
|
||||
|
||||
$args = array(
|
||||
'number' => $users_per_page,
|
||||
'offset' => ( $paged-1 ) * $users_per_page,
|
||||
'search' => $usersearch,
|
||||
'blog_id' => 0,
|
||||
'fields' => 'all_with_meta'
|
||||
);
|
||||
|
||||
$args['search'] = ltrim($args['search'], '*');
|
||||
|
||||
if ( $role == 'super' ) {
|
||||
$logins = implode( "', '", get_super_admins() );
|
||||
$args['include'] = $wpdb->get_col( "SELECT ID FROM $wpdb->users WHERE user_login IN ('$logins')" );
|
||||
}
|
||||
|
||||
// If the network is large and a search is not being performed, show only the latest users with no paging in order
|
||||
// to avoid expensive count queries.
|
||||
if ( !$usersearch && ( get_blog_count() >= 10000 ) ) {
|
||||
if ( !isset($_REQUEST['orderby']) )
|
||||
$_GET['orderby'] = $_REQUEST['orderby'] = 'id';
|
||||
if ( !isset($_REQUEST['order']) )
|
||||
$_GET['order'] = $_REQUEST['order'] = 'DESC';
|
||||
$args['count_total'] = false;
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['orderby'] ) )
|
||||
$args['orderby'] = $_REQUEST['orderby'];
|
||||
|
||||
if ( isset( $_REQUEST['order'] ) )
|
||||
$args['order'] = $_REQUEST['order'];
|
||||
|
||||
$mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
|
||||
|
||||
// Query the user IDs for this page
|
||||
$wp_user_search = new WP_User_Query( $args );
|
||||
|
||||
$this->items = $wp_user_search->get_results();
|
||||
|
||||
$this->set_pagination_args( array(
|
||||
'total_items' => $wp_user_search->get_total(),
|
||||
'per_page' => $users_per_page,
|
||||
) );
|
||||
}
|
||||
|
||||
function get_bulk_actions() {
|
||||
$actions = array();
|
||||
if ( current_user_can( 'delete_users' ) )
|
||||
$actions['delete'] = __( 'Delete' );
|
||||
$actions['spam'] = _x( 'Mark as Spam', 'user' );
|
||||
$actions['notspam'] = _x( 'Not Spam', 'user' );
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
function no_items() {
|
||||
_e( 'No users found.' );
|
||||
}
|
||||
|
||||
function get_views() {
|
||||
global $wp_roles, $role;
|
||||
|
||||
$total_users = get_user_count();
|
||||
$super_admins = get_super_admins();
|
||||
$total_admins = count( $super_admins );
|
||||
|
||||
$current_role = false;
|
||||
$class = $role != 'super' ? ' class="current"' : '';
|
||||
$role_links = array();
|
||||
$role_links['all'] = "<a href='" . network_admin_url('users.php') . "'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
|
||||
$class = $role == 'super' ? ' class="current"' : '';
|
||||
$role_links['super'] = "<a href='" . network_admin_url('users.php?role=super') . "'$class>" . sprintf( _n( 'Super Admin <span class="count">(%s)</span>', 'Super Admins <span class="count">(%s)</span>', $total_admins ), number_format_i18n( $total_admins ) ) . '</a>';
|
||||
|
||||
return $role_links;
|
||||
}
|
||||
|
||||
function pagination( $which ) {
|
||||
global $mode;
|
||||
|
||||
parent::pagination ( $which );
|
||||
|
||||
if ( 'top' == $which )
|
||||
$this->view_switcher( $mode );
|
||||
}
|
||||
|
||||
function get_columns() {
|
||||
$users_columns = array(
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'username' => __( 'Username' ),
|
||||
'name' => __( 'Name' ),
|
||||
'email' => __( 'E-mail' ),
|
||||
'registered' => _x( 'Registered', 'user' ),
|
||||
'blogs' => __( 'Sites' )
|
||||
);
|
||||
$users_columns = apply_filters( 'wpmu_users_columns', $users_columns );
|
||||
|
||||
return $users_columns;
|
||||
}
|
||||
|
||||
function get_sortable_columns() {
|
||||
return array(
|
||||
'username' => 'login',
|
||||
'name' => 'name',
|
||||
'email' => 'email',
|
||||
'registered' => 'id',
|
||||
);
|
||||
}
|
||||
|
||||
function display_rows() {
|
||||
global $current_site, $mode;
|
||||
|
||||
$alt = '';
|
||||
$super_admins = get_super_admins();
|
||||
foreach ( $this->items as $user ) {
|
||||
$alt = ( 'alternate' == $alt ) ? '' : 'alternate';
|
||||
|
||||
$status_list = array( 'spam' => 'site-spammed', 'deleted' => 'site-deleted' );
|
||||
|
||||
foreach ( $status_list as $status => $col ) {
|
||||
if ( $user->$status )
|
||||
$alt .= " $col";
|
||||
}
|
||||
|
||||
?>
|
||||
<tr class="<?php echo $alt; ?>">
|
||||
<?php
|
||||
|
||||
list( $columns, $hidden ) = $this->get_column_info();
|
||||
|
||||
foreach ( $columns as $column_name => $column_display_name ) :
|
||||
$class = "class='$column_name column-$column_name'";
|
||||
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) )
|
||||
$style = ' style="display:none;"';
|
||||
|
||||
$attributes = "$class$style";
|
||||
|
||||
|
||||
switch ( $column_name ) {
|
||||
case 'cb': ?>
|
||||
<th scope="row" class="check-column">
|
||||
<input type="checkbox" id="blog_<?php echo $user->ID ?>" name="allusers[]" value="<?php echo esc_attr( $user->ID ) ?>" />
|
||||
</th>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'username':
|
||||
$avatar = get_avatar( $user->user_email, 32 );
|
||||
if ( get_current_user_id() == $user->ID ) {
|
||||
$edit_link = esc_url( network_admin_url( 'profile.php' ) );
|
||||
} else {
|
||||
$edit_link = esc_url( network_admin_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), 'user-edit.php?user_id=' . $user->ID ) ) );
|
||||
}
|
||||
|
||||
echo "<td $attributes>"; ?>
|
||||
<?php echo $avatar; ?><strong><a href="<?php echo $edit_link; ?>" class="edit"><?php echo stripslashes( $user->user_login ); ?></a><?php
|
||||
if ( in_array( $user->user_login, $super_admins ) )
|
||||
echo ' - ' . __( 'Super Admin' );
|
||||
?></strong>
|
||||
<br/>
|
||||
<?php
|
||||
$actions = array();
|
||||
$actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
|
||||
|
||||
if ( current_user_can( 'delete_user', $user->ID) && ! in_array( $user->user_login, $super_admins ) ) {
|
||||
$actions['delete'] = '<a href="' . $delete = esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'edit.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
|
||||
}
|
||||
|
||||
echo $this->row_actions( $actions );
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'name':
|
||||
echo "<td $attributes>$user->first_name $user->last_name</td>";
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
echo "<td $attributes><a href='mailto:$user->user_email'>$user->user_email</a></td>";
|
||||
break;
|
||||
|
||||
case 'registered':
|
||||
if ( 'list' == $mode )
|
||||
$date = 'Y/m/d';
|
||||
else
|
||||
$date = 'Y/m/d \<\b\r \/\> g:i:s a';
|
||||
|
||||
echo "<td $attributes>" . mysql2date( $date, $user->user_registered ) . "</td>";
|
||||
break;
|
||||
|
||||
case 'blogs':
|
||||
$blogs = get_blogs_of_user( $user->ID, true );
|
||||
echo "<td $attributes>";
|
||||
if ( is_array( $blogs ) ) {
|
||||
foreach ( (array) $blogs as $key => $val ) {
|
||||
if ( !can_edit_network( $val->site_id ) )
|
||||
continue;
|
||||
|
||||
$path = ( $val->path == '/' ) ? '' : $val->path;
|
||||
echo '<span class="site-' . $val->site_id . '" >';
|
||||
echo '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>';
|
||||
echo ' <small class="row-actions">';
|
||||
$actions = array();
|
||||
$actions['edit'] = '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . __( 'Edit' ) . '</a>';
|
||||
|
||||
$class = '';
|
||||
if ( get_blog_status( $val->userblog_id, 'spam' ) == 1 )
|
||||
$class .= 'site-spammed ';
|
||||
if ( get_blog_status( $val->userblog_id, 'mature' ) == 1 )
|
||||
$class .= 'site-mature ';
|
||||
if ( get_blog_status( $val->userblog_id, 'deleted' ) == 1 )
|
||||
$class .= 'site-deleted ';
|
||||
if ( get_blog_status( $val->userblog_id, 'archived' ) == 1 )
|
||||
$class .= 'site-archived ';
|
||||
|
||||
$actions['view'] = '<a class="' . $class . '" href="' . esc_url( get_home_url( $val->userblog_id ) ) . '">' . __( 'View' ) . '</a>';
|
||||
|
||||
$actions = apply_filters('ms_user_list_site_actions', $actions, $val->userblog_id);
|
||||
|
||||
$i=0;
|
||||
$action_count = count( $actions );
|
||||
foreach ( $actions as $action => $link ) {
|
||||
++$i;
|
||||
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
|
||||
echo "<span class='$action'>$link$sep</span>";
|
||||
}
|
||||
echo '</small></span><br/>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
default:
|
||||
echo "<td $attributes>";
|
||||
echo apply_filters( 'manage_users_custom_column', '', $column_name, $user->ID );
|
||||
echo "</td>";
|
||||
break;
|
||||
}
|
||||
endforeach
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,237 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Installer List Table class.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
*/
|
||||
class WP_Plugin_Install_List_Table extends WP_List_Table {
|
||||
|
||||
function ajax_user_can() {
|
||||
return current_user_can('install_plugins');
|
||||
}
|
||||
|
||||
function prepare_items() {
|
||||
include( ABSPATH . 'wp-admin/includes/plugin-install.php' );
|
||||
|
||||
global $tabs, $tab, $paged, $type, $term;
|
||||
|
||||
wp_reset_vars( array( 'tab' ) );
|
||||
|
||||
$paged = $this->get_pagenum();
|
||||
|
||||
$per_page = 30;
|
||||
|
||||
// These are the tabs which are shown on the page
|
||||
$tabs = array();
|
||||
$tabs['dashboard'] = __( 'Search' );
|
||||
if ( 'search' == $tab )
|
||||
$tabs['search'] = __( 'Search Results' );
|
||||
$tabs['upload'] = __( 'Upload' );
|
||||
$tabs['featured'] = _x( 'Featured','Plugin Installer' );
|
||||
$tabs['popular'] = _x( 'Popular','Plugin Installer' );
|
||||
$tabs['new'] = _x( 'Newest','Plugin Installer' );
|
||||
$tabs['updated'] = _x( 'Recently Updated','Plugin Installer' );
|
||||
|
||||
$nonmenu_tabs = array( 'plugin-information' ); //Valid actions to perform which do not have a Menu item.
|
||||
|
||||
$tabs = apply_filters( 'install_plugins_tabs', $tabs );
|
||||
$nonmenu_tabs = apply_filters( 'install_plugins_nonmenu_tabs', $nonmenu_tabs );
|
||||
|
||||
// If a non-valid menu tab has been selected, And its not a non-menu action.
|
||||
if ( empty( $tab ) || ( !isset( $tabs[ $tab ] ) && !in_array( $tab, (array) $nonmenu_tabs ) ) )
|
||||
$tab = key( $tabs );
|
||||
|
||||
$args = array( 'page' => $paged, 'per_page' => $per_page );
|
||||
|
||||
switch ( $tab ) {
|
||||
case 'search':
|
||||
$type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : '';
|
||||
$term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
|
||||
|
||||
switch ( $type ) {
|
||||
case 'tag':
|
||||
$args['tag'] = sanitize_title_with_dashes( $term );
|
||||
break;
|
||||
case 'term':
|
||||
$args['search'] = $term;
|
||||
break;
|
||||
case 'author':
|
||||
$args['author'] = $term;
|
||||
break;
|
||||
}
|
||||
|
||||
add_action( 'install_plugins_table_header', 'install_search_form' );
|
||||
break;
|
||||
|
||||
case 'featured':
|
||||
case 'popular':
|
||||
case 'new':
|
||||
case 'updated':
|
||||
$args['browse'] = $tab;
|
||||
break;
|
||||
|
||||
default:
|
||||
$args = false;
|
||||
}
|
||||
|
||||
if ( !$args )
|
||||
return;
|
||||
|
||||
$api = plugins_api( 'query_plugins', $args );
|
||||
|
||||
if ( is_wp_error( $api ) )
|
||||
wp_die( $api->get_error_message() . '</p> <p class="hide-if-no-js"><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' );
|
||||
|
||||
$this->items = $api->plugins;
|
||||
|
||||
$this->set_pagination_args( array(
|
||||
'total_items' => $api->info['results'],
|
||||
'per_page' => $per_page,
|
||||
) );
|
||||
}
|
||||
|
||||
function no_items() {
|
||||
_e( 'No plugins match your request.' );
|
||||
}
|
||||
|
||||
function get_views() {
|
||||
global $tabs, $tab;
|
||||
|
||||
$display_tabs = array();
|
||||
foreach ( (array) $tabs as $action => $text ) {
|
||||
$class = ( $action == $tab ) ? ' class="current"' : '';
|
||||
$href = self_admin_url('plugin-install.php?tab=' . $action);
|
||||
$display_tabs['plugin-install-'.$action] = "<a href='$href'$class>$text</a>";
|
||||
}
|
||||
|
||||
return $display_tabs;
|
||||
}
|
||||
|
||||
function display_tablenav( $which ) {
|
||||
if ( 'top' == $which ) { ?>
|
||||
<div class="tablenav top">
|
||||
<div class="alignleft actions">
|
||||
<?php do_action( 'install_plugins_table_header' ); ?>
|
||||
</div>
|
||||
<?php $this->pagination( $which ); ?>
|
||||
<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
|
||||
<br class="clear" />
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="tablenav bottom">
|
||||
<?php $this->pagination( $which ); ?>
|
||||
<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
|
||||
<br class="clear" />
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
function get_table_classes() {
|
||||
extract( $this->_args );
|
||||
|
||||
return array( 'widefat', $plural );
|
||||
}
|
||||
|
||||
function get_columns() {
|
||||
return array(
|
||||
'name' => __( 'Name' ),
|
||||
'version' => __( 'Version' ),
|
||||
'rating' => __( 'Rating' ),
|
||||
'description' => __( 'Description' ),
|
||||
);
|
||||
}
|
||||
|
||||
function display_rows() {
|
||||
$plugins_allowedtags = array(
|
||||
'a' => array( 'href' => array(),'title' => array(), 'target' => array() ),
|
||||
'abbr' => array( 'title' => array() ),'acronym' => array( 'title' => array() ),
|
||||
'code' => array(), 'pre' => array(), 'em' => array(),'strong' => array(),
|
||||
'ul' => array(), 'ol' => array(), 'li' => array(), 'p' => array(), 'br' => array()
|
||||
);
|
||||
|
||||
list( $columns, $hidden ) = $this->get_column_info();
|
||||
|
||||
$style = array();
|
||||
foreach ( $columns as $column_name => $column_display_name ) {
|
||||
$style[ $column_name ] = in_array( $column_name, $hidden ) ? 'style="display:none;"' : '';
|
||||
}
|
||||
|
||||
foreach ( (array) $this->items as $plugin ) {
|
||||
if ( is_object( $plugin ) )
|
||||
$plugin = (array) $plugin;
|
||||
|
||||
$title = wp_kses( $plugin['name'], $plugins_allowedtags );
|
||||
//Limit description to 400char, and remove any HTML.
|
||||
$description = strip_tags( $plugin['description'] );
|
||||
if ( strlen( $description ) > 400 )
|
||||
$description = mb_substr( $description, 0, 400 ) . '…';
|
||||
//remove any trailing entities
|
||||
$description = preg_replace( '/&[^;\s]{0,6}$/', '', $description );
|
||||
//strip leading/trailing & multiple consecutive lines
|
||||
$description = trim( $description );
|
||||
$description = preg_replace( "|(\r?\n)+|", "\n", $description );
|
||||
//\n => <br>
|
||||
$description = nl2br( $description );
|
||||
$version = wp_kses( $plugin['version'], $plugins_allowedtags );
|
||||
|
||||
$name = strip_tags( $title . ' ' . $version );
|
||||
|
||||
$author = $plugin['author'];
|
||||
if ( ! empty( $plugin['author'] ) )
|
||||
$author = ' <cite>' . sprintf( __( 'By %s' ), $author ) . '.</cite>';
|
||||
|
||||
$author = wp_kses( $author, $plugins_allowedtags );
|
||||
|
||||
$action_links = array();
|
||||
$action_links[] = '<a href="' . self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] .
|
||||
'&TB_iframe=true&width=600&height=550' ) . '" class="thickbox" title="' .
|
||||
esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '">' . __( 'Details' ) . '</a>';
|
||||
|
||||
if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) {
|
||||
$status = install_plugin_install_status( $plugin );
|
||||
|
||||
switch ( $status['status'] ) {
|
||||
case 'install':
|
||||
if ( $status['url'] )
|
||||
$action_links[] = '<a class="install-now" href="' . $status['url'] . '" title="' . esc_attr( sprintf( __( 'Install %s' ), $name ) ) . '">' . __( 'Install Now' ) . '</a>';
|
||||
break;
|
||||
case 'update_available':
|
||||
if ( $status['url'] )
|
||||
$action_links[] = '<a href="' . $status['url'] . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $status['version'] ) ) . '">' . sprintf( __( 'Update Now' ), $status['version'] ) . '</a>';
|
||||
break;
|
||||
case 'latest_installed':
|
||||
case 'newer_installed':
|
||||
$action_links[] = '<span title="' . esc_attr__( 'This plugin is already installed and is up to date' ) . ' ">' . __( 'Installed' ) . '</span>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
|
||||
?>
|
||||
<tr>
|
||||
<td class="name column-name"<?php echo $style['name']; ?>><strong><?php echo $title; ?></strong>
|
||||
<div class="action-links"><?php if ( !empty( $action_links ) ) echo implode( ' | ', $action_links ); ?></div>
|
||||
</td>
|
||||
<td class="vers column-version"<?php echo $style['version']; ?>><?php echo $version; ?></td>
|
||||
<td class="vers column-rating"<?php echo $style['rating']; ?>>
|
||||
<div class="star-holder" title="<?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $plugin['num_ratings'] ), number_format_i18n( $plugin['num_ratings'] ) ) ?>">
|
||||
<div class="star star-rating" style="width: <?php echo esc_attr( $plugin['rating'] ) ?>px"></div>
|
||||
<div class="star star5"><img src="<?php echo admin_url( 'images/star.gif' ); ?>" alt="<?php _e( '5 stars' ) ?>" /></div>
|
||||
<div class="star star4"><img src="<?php echo admin_url( 'images/star.gif' ); ?>" alt="<?php _e( '4 stars' ) ?>" /></div>
|
||||
<div class="star star3"><img src="<?php echo admin_url( 'images/star.gif' ); ?>" alt="<?php _e( '3 stars' ) ?>" /></div>
|
||||
<div class="star star2"><img src="<?php echo admin_url( 'images/star.gif' ); ?>" alt="<?php _e( '2 stars' ) ?>" /></div>
|
||||
<div class="star star1"><img src="<?php echo admin_url( 'images/star.gif' ); ?>" alt="<?php _e( '1 star' ) ?>" /></div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="desc column-description"<?php echo $style['description']; ?>><?php echo $description, $author; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,453 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugins List Table class.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage List_Table
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
*/
|
||||
class WP_Plugins_List_Table extends WP_List_Table {
|
||||
|
||||
function WP_Plugins_List_Table() {
|
||||
global $status, $page;
|
||||
|
||||
$default_status = get_user_option( 'plugins_last_view' );
|
||||
if ( empty( $default_status ) )
|
||||
$default_status = 'all';
|
||||
$status = isset( $_REQUEST['plugin_status'] ) ? $_REQUEST['plugin_status'] : $default_status;
|
||||
if ( !in_array( $status, array( 'all', 'active', 'inactive', 'recently_activated', 'upgrade', 'network', 'mustuse', 'dropins', 'search' ) ) )
|
||||
$status = 'all';
|
||||
if ( $status != $default_status && 'search' != $status )
|
||||
update_user_meta( get_current_user_id(), 'plugins_last_view', $status );
|
||||
|
||||
$page = $this->get_pagenum();
|
||||
|
||||
parent::WP_List_Table( array(
|
||||
'plural' => 'plugins',
|
||||
) );
|
||||
}
|
||||
|
||||
function get_table_classes() {
|
||||
return array( 'widefat', $this->_args['plural'] );
|
||||
}
|
||||
|
||||
function ajax_user_can() {
|
||||
if ( is_multisite() ) {
|
||||
$menu_perms = get_site_option( 'menu_items', array() );
|
||||
|
||||
if ( empty( $menu_perms['plugins'] ) && ! is_super_admin() )
|
||||
return false;
|
||||
}
|
||||
|
||||
return current_user_can('activate_plugins');
|
||||
}
|
||||
|
||||
function prepare_items() {
|
||||
global $status, $plugins, $totals, $page, $orderby, $order, $s;
|
||||
|
||||
wp_reset_vars( array( 'orderby', 'order', 's' ) );
|
||||
|
||||
$plugins = array(
|
||||
'all' => apply_filters( 'all_plugins', get_plugins() ),
|
||||
'search' => array(),
|
||||
'active' => array(),
|
||||
'inactive' => array(),
|
||||
'recently_activated' => array(),
|
||||
'upgrade' => array(),
|
||||
'mustuse' => array(),
|
||||
'dropins' => array()
|
||||
);
|
||||
|
||||
$screen = get_current_screen();
|
||||
|
||||
if ( ! is_multisite() || ( $screen->is_network && current_user_can('manage_network_plugins') ) ) {
|
||||
if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) )
|
||||
$plugins['mustuse'] = get_mu_plugins();
|
||||
if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) )
|
||||
$plugins['dropins'] = get_dropins();
|
||||
|
||||
$current = get_site_transient( 'update_plugins' );
|
||||
foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
|
||||
if ( isset( $current->response[ $plugin_file ] ) )
|
||||
$plugins['upgrade'][ $plugin_file ] = $plugin_data;
|
||||
}
|
||||
}
|
||||
|
||||
set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), 86400 );
|
||||
|
||||
$recently_activated = get_option( 'recently_activated', array() );
|
||||
|
||||
$one_week = 7*24*60*60;
|
||||
foreach ( $recently_activated as $key => $time )
|
||||
if ( $time + $one_week < time() )
|
||||
unset( $recently_activated[$key] );
|
||||
update_option( 'recently_activated', $recently_activated );
|
||||
|
||||
foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
|
||||
// Filter into individual sections
|
||||
if ( is_multisite() && is_network_only_plugin( $plugin_file ) && !$screen->is_network ) {
|
||||
unset( $plugins['all'][ $plugin_file] );
|
||||
} elseif ( is_plugin_active_for_network($plugin_file) && !$screen->is_network ) {
|
||||
unset( $plugins['all'][ $plugin_file ] );
|
||||
} elseif ( is_multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins' ) ) {
|
||||
$plugins['network'][ $plugin_file ] = $plugin_data;
|
||||
} elseif ( ( !$screen->is_network && is_plugin_active( $plugin_file ) )
|
||||
|| ( $screen->is_network && is_plugin_active_for_network( $plugin_file ) ) ) {
|
||||
$plugins['active'][ $plugin_file ] = $plugin_data;
|
||||
} else {
|
||||
if ( !$screen->is_network && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
|
||||
$plugins['recently_activated'][ $plugin_file ] = $plugin_data;
|
||||
$plugins['inactive'][ $plugin_file ] = $plugin_data;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !current_user_can( 'update_plugins' ) )
|
||||
$plugins['upgrade'] = array();
|
||||
|
||||
if ( $s ) {
|
||||
$status = 'search';
|
||||
$plugins['search'] = array_filter( $plugins['all'], array( &$this, '_search_callback' ) );
|
||||
}
|
||||
|
||||
$totals = array();
|
||||
foreach ( $plugins as $type => $list )
|
||||
$totals[ $type ] = count( $list );
|
||||
|
||||
if ( empty( $plugins[ $status ] ) && !in_array( $status, array( 'all', 'search' ) ) )
|
||||
$status = 'all';
|
||||
|
||||
$this->items = array();
|
||||
foreach ( $plugins[ $status ] as $plugin_file => $plugin_data ) {
|
||||
// Translate, Don't Apply Markup, Sanitize HTML
|
||||
$this->items[$plugin_file] = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, false, true );
|
||||
}
|
||||
|
||||
$total_this_page = $totals[ $status ];
|
||||
|
||||
if ( $orderby ) {
|
||||
$orderby = ucfirst( $orderby );
|
||||
$order = strtoupper( $order );
|
||||
|
||||
uasort( $this->items, array( &$this, '_order_callback' ) );
|
||||
}
|
||||
|
||||
$plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ) );
|
||||
|
||||
$start = ( $page - 1 ) * $plugins_per_page;
|
||||
|
||||
if ( $total_this_page > $plugins_per_page )
|
||||
$this->items = array_slice( $this->items, $start, $plugins_per_page );
|
||||
|
||||
$this->set_pagination_args( array(
|
||||
'total_items' => $total_this_page,
|
||||
'per_page' => $plugins_per_page,
|
||||
) );
|
||||
}
|
||||
|
||||
function _search_callback( $plugin ) {
|
||||
static $term;
|
||||
if ( is_null( $term ) )
|
||||
$term = stripslashes( $_REQUEST['s'] );
|
||||
|
||||
foreach ( $plugin as $value )
|
||||
if ( stripos( $value, $term ) !== false )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function _order_callback( $plugin_a, $plugin_b ) {
|
||||
global $orderby, $order;
|
||||
|
||||
$a = $plugin_a[$orderby];
|
||||
$b = $plugin_b[$orderby];
|
||||
|
||||
if ( $a == $b )
|
||||
return 0;
|
||||
|
||||
if ( 'DESC' == $order )
|
||||
return ( $a < $b ) ? 1 : -1;
|
||||
else
|
||||
return ( $a < $b ) ? -1 : 1;
|
||||
}
|
||||
|
||||
function no_items() {
|
||||
global $plugins;
|
||||
|
||||
if ( !empty( $plugins['all'] ) )
|
||||
_e( 'No plugins found.' );
|
||||
else
|
||||
_e( 'You do not appear to have any plugins available at this time.' );
|
||||
}
|
||||
|
||||
function get_columns() {
|
||||
global $status;
|
||||
|
||||
return array(
|
||||
'cb' => !in_array( $status, array( 'mustuse', 'dropins' ) ) ? '<input type="checkbox" />' : '',
|
||||
'name' => __( 'Plugin' ),
|
||||
'description' => __( 'Description' ),
|
||||
);
|
||||
}
|
||||
|
||||
function get_sortable_columns() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function display_tablenav( $which ) {
|
||||
global $status;
|
||||
|
||||
if ( !in_array( $status, array( 'mustuse', 'dropins' ) ) )
|
||||
parent::display_tablenav( $which );
|
||||
}
|
||||
|
||||
function get_views() {
|
||||
global $totals, $status;
|
||||
|
||||
$status_links = array();
|
||||
foreach ( $totals as $type => $count ) {
|
||||
if ( !$count )
|
||||
continue;
|
||||
|
||||
switch ( $type ) {
|
||||
case 'all':
|
||||
$text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins' );
|
||||
break;
|
||||
case 'active':
|
||||
$text = _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', $count );
|
||||
break;
|
||||
case 'recently_activated':
|
||||
$text = _n( 'Recently Active <span class="count">(%s)</span>', 'Recently Active <span class="count">(%s)</span>', $count );
|
||||
break;
|
||||
case 'inactive':
|
||||
$text = _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', $count );
|
||||
break;
|
||||
case 'network':
|
||||
$text = _n( 'Network <span class="count">(%s)</span>', 'Network <span class="count">(%s)</span>', $count );
|
||||
break;
|
||||
case 'mustuse':
|
||||
$text = _n( 'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', $count );
|
||||
break;
|
||||
case 'dropins':
|
||||
$text = _n( 'Drop-ins <span class="count">(%s)</span>', 'Drop-ins <span class="count">(%s)</span>', $count );
|
||||
break;
|
||||
case 'upgrade':
|
||||
$text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( 'search' != $type ) {
|
||||
$status_links[$type] = sprintf( "<a href='%s' %s>%s</a>",
|
||||
add_query_arg('plugin_status', $type, 'plugins.php'),
|
||||
( $type == $status ) ? ' class="current"' : '',
|
||||
sprintf( $text, number_format_i18n( $count ) )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $status_links;
|
||||
}
|
||||
|
||||
function get_bulk_actions() {
|
||||
global $status;
|
||||
|
||||
$actions = array();
|
||||
|
||||
$screen = get_current_screen();
|
||||
|
||||
if ( 'active' != $status ) {
|
||||
$action = $screen->is_network ? 'network-activate-selected' : 'activate-selected';
|
||||
$actions[ $action ] = __( 'Activate' );
|
||||
}
|
||||
|
||||
if ( 'inactive' != $status && 'recent' != $status )
|
||||
$actions['deactivate-selected'] = __( 'Deactivate' );
|
||||
|
||||
if ( !is_multisite() || $screen->is_network ) {
|
||||
if ( current_user_can( 'update_plugins' ) )
|
||||
$actions['update-selected'] = __( 'Update' );
|
||||
if ( current_user_can( 'delete_plugins' ) && ( 'active' != $status ) )
|
||||
$actions['delete-selected'] = __( 'Delete' );
|
||||
}
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
function bulk_actions( $which ) {
|
||||
global $status;
|
||||
|
||||
if ( in_array( $status, array( 'mustuse', 'dropins' ) ) )
|
||||
return;
|
||||
|
||||
parent::bulk_actions( $which );
|
||||
}
|
||||
|
||||
function extra_tablenav( $which ) {
|
||||
global $status;
|
||||
|
||||
if ( 'recently_activated' == $status ) { ?>
|
||||
<div class="alignleft actions">
|
||||
<?php submit_button( __( 'Clear List' ), 'secondary', 'clear-recent-list', false ); ?>
|
||||
</div>
|
||||
<?php }
|
||||
}
|
||||
|
||||
function current_action() {
|
||||
if ( isset($_POST['clear-recent-list']) )
|
||||
return 'clear-recent-list';
|
||||
|
||||
return parent::current_action();
|
||||
}
|
||||
|
||||
function display_rows() {
|
||||
global $status;
|
||||
|
||||
$screen = get_current_screen();
|
||||
|
||||
if ( is_multisite() && !$screen->is_network && in_array( $status, array( 'mustuse', 'dropins' ) ) )
|
||||
return;
|
||||
|
||||
foreach ( $this->items as $plugin_file => $plugin_data )
|
||||
$this->single_row( $plugin_file, $plugin_data );
|
||||
}
|
||||
|
||||
function single_row( $plugin_file, $plugin_data ) {
|
||||
global $status, $page, $s;
|
||||
|
||||
$context = $status;
|
||||
|
||||
$screen = get_current_screen();
|
||||
|
||||
// preorder
|
||||
$actions = array(
|
||||
'network_deactivate' => '', 'deactivate' => '',
|
||||
'network_only' => '', 'activate' => '',
|
||||
'network_activate' => '',
|
||||
'edit' => '',
|
||||
'delete' => '',
|
||||
);
|
||||
|
||||
if ( 'mustuse' == $context ) {
|
||||
$is_active = true;
|
||||
} elseif ( 'dropins' == $context ) {
|
||||
$dropins = _get_dropins();
|
||||
$plugin_name = $plugin_file;
|
||||
if ( $plugin_file != $plugin_data['Name'] )
|
||||
$plugin_name .= '<br/>' . $plugin_data['Name'];
|
||||
if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant
|
||||
$is_active = true;
|
||||
$description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
|
||||
} elseif ( constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true
|
||||
$is_active = true;
|
||||
$description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
|
||||
} else {
|
||||
$is_active = false;
|
||||
$description = '<p><strong>' . $dropins[ $plugin_file ][0] . ' <span class="attention">' . __('Inactive:') . '</span></strong> ' . sprintf( __( 'Requires <code>%s</code> in <code>wp-config.php</code>.' ), "define('" . $dropins[ $plugin_file ][1] . "', true);" ) . '</p>';
|
||||
}
|
||||
if ( $plugin_data['Description'] )
|
||||
$description .= '<p>' . $plugin_data['Description'] . '</p>';
|
||||
} else {
|
||||
$is_active_for_network = is_plugin_active_for_network($plugin_file);
|
||||
if ( $screen->is_network )
|
||||
$is_active = $is_active_for_network;
|
||||
else
|
||||
$is_active = is_plugin_active( $plugin_file );
|
||||
|
||||
if ( $is_active_for_network && !is_super_admin() && !$screen->is_network )
|
||||
return;
|
||||
|
||||
if ( $screen->is_network ) {
|
||||
if ( $is_active_for_network ) {
|
||||
if ( current_user_can( 'manage_network_plugins' ) )
|
||||
$actions['network_deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
|
||||
} else {
|
||||
if ( current_user_can( 'manage_network_plugins' ) )
|
||||
$actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
|
||||
if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) )
|
||||
$actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
|
||||
}
|
||||
} else {
|
||||
if ( $is_active ) {
|
||||
$actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
|
||||
} else {
|
||||
$actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
|
||||
|
||||
if ( ! is_multisite() && current_user_can('delete_plugins') )
|
||||
$actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
|
||||
} // end if $is_active
|
||||
} // end if $screen->is_network
|
||||
|
||||
if ( ( ! is_multisite() || $screen->is_network ) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
|
||||
$actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . esc_attr__('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
|
||||
} // end if $context
|
||||
|
||||
$prefix = $screen->is_network ? 'network_admin_' : '';
|
||||
$actions = apply_filters( $prefix . 'plugin_action_links', array_filter( $actions ), $plugin_file, $plugin_data, $context );
|
||||
$actions = apply_filters( $prefix . "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
|
||||
|
||||
$class = $is_active ? 'active' : 'inactive';
|
||||
$checkbox_id = "checkbox_" . md5($plugin_data['Name']);
|
||||
$checkbox = in_array( $status, array( 'mustuse', 'dropins' ) ) ? '' : "<input type='checkbox' name='checked[]' value='" . esc_attr( $plugin_file ) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $plugin_data['Name'] . "</label>";
|
||||
if ( 'dropins' != $context ) {
|
||||
$description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : ' ' ) . '</p>';
|
||||
$plugin_name = $plugin_data['Name'];
|
||||
}
|
||||
|
||||
$id = sanitize_title( $plugin_name );
|
||||
|
||||
echo "<tr id='$id' class='$class'>";
|
||||
|
||||
list( $columns, $hidden ) = $this->get_column_info();
|
||||
|
||||
foreach ( $columns as $column_name => $column_display_name ) {
|
||||
$style = '';
|
||||
if ( in_array( $column_name, $hidden ) )
|
||||
$style = ' style="display:none;"';
|
||||
|
||||
switch ( $column_name ) {
|
||||
case 'cb':
|
||||
echo "<th scope='row' class='check-column'>$checkbox</th>";
|
||||
break;
|
||||
case 'name':
|
||||
echo "<td class='plugin-title'$style><strong>$plugin_name</strong>";
|
||||
echo $this->row_actions( $actions, true );
|
||||
echo "</td>";
|
||||
break;
|
||||
case 'description':
|
||||
echo "<td class='column-description desc'$style>
|
||||
<div class='plugin-description'>$description</div>
|
||||
<div class='$class second plugin-version-author-uri'>";
|
||||
|
||||
$plugin_meta = array();
|
||||
if ( !empty( $plugin_data['Version'] ) )
|
||||
$plugin_meta[] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
|
||||
if ( !empty( $plugin_data['Author'] ) ) {
|
||||
$author = $plugin_data['Author'];
|
||||
if ( !empty( $plugin_data['AuthorURI'] ) )
|
||||
$author = '<a href="' . $plugin_data['AuthorURI'] . '" title="' . esc_attr__( 'Visit author homepage' ) . '">' . $plugin_data['Author'] . '</a>';
|
||||
$plugin_meta[] = sprintf( __( 'By %s' ), $author );
|
||||
}
|
||||
if ( ! empty( $plugin_data['PluginURI'] ) )
|
||||
$plugin_meta[] = '<a href="' . $plugin_data['PluginURI'] . '" title="' . esc_attr__( 'Visit plugin site' ) . '">' . __( 'Visit plugin site' ) . '</a>';
|
||||
|
||||
$plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status );
|
||||
echo implode( ' | ', $plugin_meta );
|
||||
|
||||
echo "</div></td>";
|
||||
break;
|
||||
default:
|
||||
echo "<td class='$column_name column-$column_name'$style>";
|
||||
do_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data );
|
||||
echo "</td>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</tr>";
|
||||
|
||||
do_action( 'after_plugin_row', $plugin_file, $plugin_data, $status );
|
||||
do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $status );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||