WordPress.org

Make WordPress Core

Changeset 5278


Ignore:
Timestamp:
04/17/2007 01:30:12 AM (11 years ago)
Author:
rob1n
Message:

Add mt_keywords support. Props redsweater. fixes #900

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r5215 r5278  
    990990      $post_more = $content_struct['mt_text_more'];
    991991
     992      $tags_input = $content_struct['mt_keywords'];
     993
    992994      $comment_status = (!isset($content_struct['mt_allow_comments'])) ?
    993995        get_option('default_comment_status')
     
    10281030
    10291031      // We've got all the data -- post it:
    1030       $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order');
     1032      $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input');
    10311033
    10321034      $post_ID = wp_insert_post($postdata);
     
    11721174      $post_status = $publish ? 'publish' : 'draft';
    11731175
     1176      $tags_input = $content_struct['mt_keywords'];
     1177
    11741178      if ( ('publish' == $post_status) ) {
    11751179        if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') )
     
    12031207
    12041208      // We've got all the data -- post it:
    1205       $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author');
     1209      $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input');
    12061210
    12071211      $result = wp_update_post($newpost);
     
    12431247          $categories[] = get_cat_name($catid);
    12441248        }
     1249
     1250        $tagnames = array();
     1251        $tags = get_post_tags( $post_ID );
     1252        if ( !empty( $tags ) ) {
     1253            foreach ( $tags as $tag ) {
     1254                $tagnames[] = $tag->cat_name;
     1255            }
     1256            $tagnames = implode( ', ', $tagnames );
     1257        } else {
     1258            $tagnames = '';
     1259        }
    12451260
    12461261        $post = get_extended($postdata['post_content']);
     
    12681283          'mt_allow_comments' => $allow_comments,
    12691284          'mt_allow_pings' => $allow_pings,
     1285          'mt_keywords' => $tagnames,
    12701286          'wp_slug' => $postdata['post_name'],
    12711287          'wp_password' => $postdata['post_password'],
     
    13091325            foreach($catids as $catid) {
    13101326                $categories[] = get_cat_name($catid);
     1327            }
     1328
     1329            $tagnames = array();
     1330            $tags = get_post_tags( $entry['ID'] );
     1331            if ( !empty( $tags ) ) {
     1332                foreach ( $tags as $tag ) {
     1333                    $tagnames[] = $tag->cat_name;
     1334                }
     1335                $tagnames = implode( ', ', $tagnames );
     1336            } else {
     1337                $tagnames = '';
    13111338            }
    13121339
     
    13351362                'mt_allow_comments' => $allow_comments,
    13361363                'mt_allow_pings' => $allow_pings,
     1364                'mt_keywords' => $tagnames,
    13371365                'wp_slug' => $entry['post_name'],
    13381366                'wp_password' => $entry['post_password'],
Note: See TracChangeset for help on using the changeset viewer.