Make WordPress Core

Changeset 5981


Ignore:
Timestamp:
08/29/2007 11:01:48 PM (17 years ago)
Author:
ryan
Message:

mt_keywords support. Props westi and josephscott. fixes #900

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r5898 r5981  
    990990      $post_more = $content_struct['mt_text_more'];
    991991
     992        $tags_input = $content_struct['mt_keywords'];
     993
    992994        if(isset($content_struct["mt_allow_comments"])) {
    993995            if(!is_numeric($content_struct["mt_allow_comments"])) {
     
    10841086
    10851087      // We've got all the data -- post it:
    1086       $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');
     1088      $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');
    10871089
    10881090      $post_ID = wp_insert_post($postdata);
     
    12771279      $post_status = $publish ? 'publish' : 'draft';
    12781280
     1281      $tags_input = $content_struct['mt_keywords'];
     1282
    12791283      if ( ('publish' == $post_status) ) {
    12801284        if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') )
     
    13041308
    13051309      // We've got all the data -- post it:
    1306       $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');
     1310      $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');
    13071311
    13081312      $result = wp_update_post($newpost);
     
    13451349          $categories[] = get_cat_name($catid);
    13461350        }
     1351
     1352        $tagnames = array();
     1353        $tags = wp_get_post_tags( $post_ID );
     1354        if ( !empty( $tags ) ) {
     1355            foreach ( $tags as $tag ) {
     1356                $tagnames[] = $tag->name;
     1357            }
     1358            $tagnames = implode( ', ', $tagnames );
     1359        } else {
     1360            $tagnames = '';
     1361        }
    13471362
    13481363        $post = get_extended($postdata['post_content']);
     
    13701385          'mt_allow_comments' => $allow_comments,
    13711386          'mt_allow_pings' => $allow_pings,
     1387          'mt_keywords' => $tagnames,
    13721388          'wp_slug' => $postdata['post_name'],
    13731389          'wp_password' => $postdata['post_password'],
     
    14141430            foreach($catids as $catid) {
    14151431                $categories[] = get_cat_name($catid);
     1432            }
     1433
     1434            $tagnames = array();
     1435            $tags = wp_get_post_tags( $entry['ID'] );
     1436            if ( !empty( $tags ) ) {
     1437                foreach ( $tags as $tag ) {
     1438                    $tagnames[] = $tag->name;
     1439                }
     1440                $tagnames = implode( ', ', $tagnames );
     1441            } else {
     1442                $tagnames = '';
    14161443            }
    14171444
     
    14401467                'mt_allow_comments' => $allow_comments,
    14411468                'mt_allow_pings' => $allow_pings,
     1469                'mt_keywords' => $tagnames,
    14421470                'wp_slug' => $entry['post_name'],
    14431471                'wp_password' => $entry['post_password'],
Note: See TracChangeset for help on using the changeset viewer.