mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Death to trailing tabs. Props Mark J. fixes #2405
git-svn-id: https://develop.svn.wordpress.org/trunk@3517 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+15
-15
@@ -14,7 +14,7 @@ function get_others_drafts( $user_id ) {
|
||||
$level_key = $wpdb->prefix . 'user_level';
|
||||
|
||||
$editable = get_editable_user_ids( $user_id );
|
||||
|
||||
|
||||
if( !$editable ) {
|
||||
$other_drafts = '';
|
||||
} else {
|
||||
@@ -42,9 +42,9 @@ function get_editable_authors( $user_id ) {
|
||||
|
||||
function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
|
||||
global $wpdb;
|
||||
|
||||
|
||||
$user = new WP_User( $user_id );
|
||||
|
||||
|
||||
if ( ! $user->has_cap('edit_others_posts') ) {
|
||||
if ( $user->has_cap('edit_posts') || $exclude_zeros == false )
|
||||
return array($user->id);
|
||||
@@ -57,7 +57,7 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
|
||||
$query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key'";
|
||||
if ( $exclude_zeros )
|
||||
$query .= " AND meta_value != '0'";
|
||||
|
||||
|
||||
return $wpdb->get_col( $query );
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ function wp_insert_category($catarr) {
|
||||
} else {
|
||||
$wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent' WHERE cat_ID = '$cat_ID'");
|
||||
}
|
||||
|
||||
|
||||
if ( $category_nicename == '' ) {
|
||||
$category_nicename = sanitize_title($cat_name, $cat_ID );
|
||||
$wpdb->query( "UPDATE $wpdb->categories SET category_nicename = '$category_nicename' WHERE cat_ID = '$cat_ID'" );
|
||||
@@ -242,7 +242,7 @@ function wp_delete_user($id, $reassign = 'novalue') {
|
||||
|
||||
function get_link($link_id, $output = OBJECT) {
|
||||
global $wpdb;
|
||||
|
||||
|
||||
$link = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = '$link_id'");
|
||||
|
||||
if ( $output == OBJECT ) {
|
||||
@@ -258,7 +258,7 @@ function get_link($link_id, $output = OBJECT) {
|
||||
|
||||
function wp_insert_link($linkdata) {
|
||||
global $wpdb, $current_user;
|
||||
|
||||
|
||||
extract($linkdata);
|
||||
|
||||
$update = false;
|
||||
@@ -266,14 +266,14 @@ function wp_insert_link($linkdata) {
|
||||
$update = true;
|
||||
|
||||
if ( empty($link_rating) )
|
||||
$link_rating = 0;
|
||||
$link_rating = 0;
|
||||
|
||||
if ( empty($link_target) )
|
||||
$link_target = '';
|
||||
$link_target = '';
|
||||
|
||||
if ( empty($link_visible) )
|
||||
$link_visible = 'Y';
|
||||
|
||||
|
||||
if ( empty($link_owner) )
|
||||
$link_owner = $current_user->id;
|
||||
|
||||
@@ -292,7 +292,7 @@ function wp_insert_link($linkdata) {
|
||||
$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_category, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES('$link_url','$link_name', '$link_image', '$link_target', '$link_category', '$link_description', '$link_visible', '$link_owner', '$link_rating', '$link_rel', '$link_notes', '$link_rss')");
|
||||
$link_id = $wpdb->insert_id;
|
||||
}
|
||||
|
||||
|
||||
if ( $update )
|
||||
do_action('edit_link', $link_id);
|
||||
else
|
||||
@@ -305,12 +305,12 @@ function wp_update_link($linkdata) {
|
||||
global $wpdb;
|
||||
|
||||
$link_id = (int) $linkdata['link_id'];
|
||||
|
||||
|
||||
$link = get_link($link_id, ARRAY_A);
|
||||
|
||||
|
||||
// Escape data pulled from DB.
|
||||
$link = add_magic_quotes($link);
|
||||
|
||||
|
||||
// Merge old and new fields with new fields overwriting old ones.
|
||||
$linkdata = array_merge($link, $linkdata);
|
||||
|
||||
@@ -321,7 +321,7 @@ function wp_delete_link($link_id) {
|
||||
global $wpdb;
|
||||
|
||||
do_action('delete_link', $link_id);
|
||||
return $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
|
||||
return $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
|
||||
}
|
||||
|
||||
function post_exists($title, $content = '', $post_date = '') {
|
||||
|
||||
Reference in New Issue
Block a user