Plugin Directory

Changeset 873210


Ignore:
Timestamp:
03/11/2014 04:44:44 AM (12 years ago)
Author:
nethmk
Message:

Version 0.2.1.0 ( Fix few bugs )

Location:
exxmlrpc/tags/0.2.0.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • exxmlrpc/tags/0.2.0.9/Readme.txt

    r766750 r873210  
    55Requires at least: 3.3.1
    66Tested up to: 3.5.2
    7 Stable tag: 0.2.0.9
     7Stable tag: 0.2.1.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5858Fix the search function of past articles.
    5959
     600.2.0.9
     61Fix the search function of past articles.
     62
    6063== Upgrade Notice ==
    6164
    62 0.2.0.9
     650.2.1.0
    6366Fix the search function of past articles.
    6467
  • exxmlrpc/tags/0.2.0.9/exxmlrpc.php

    r766748 r873210  
    22/*
    33Plugin Name: ExXmlRpc for WordPressPost
    4 Version: 0.2.0.9
     4Version: 0.2.1.0
    55Plugin URI:http://wpp.nethmk.com/plugin/ExXmlRpcForWPP/ExXmlRpc.zip
    66Description:ExXmlRpc(WordPressPost) is a plugin to post to WordPress from WordPressPost.
     
    99*/
    1010
    11 define("THIS_VERSION",     "0.2.0.9");
     11define("THIS_VERSION",     "0.2.1.0");
    1212
    1313
     
    4343        $this->methods['wpex.replaceString'] = 'this:wpex_replaceString';
    4444        $this->methods['wpex.getPages'] = 'this:wpex_getPages';
     45        $this->methods['wpex.saveCustomFields'] = 'this:wpxe_save_custom_fields';
    4546    }
    4647
     
    624625        $dateFrom   = isset( $args[5] ) ? $args[5] : '';
    625626        $dateTo = isset( $args[6] ) ? $args[6] : '';
    626         // mode=R:リプレイス  mode=C:チェック
     627
    627628        $mode   = isset( $args[7] ) ? $args[7] : '';
    628         // type=POST:記事  type=PAGE:固定ページ
     629
    629630        $type   = isset( $args[8] ) ? $args[8] : '';
    630631
     
    813814    }
    814815
     816/* ------------------------------------------------------------------------- */
     817/* Save Custom fields for WordPessPost                                       */
     818/* ------------------------------------------------------------------------- */
     819    function wpxe_save_custom_fields($args){
     820
     821        $this->escape($args);
     822
     823        $blog_id    = (int) $args[0];
     824        $username   = $args[1];
     825        $password   = $args[2];
     826        $post_id    = isset($args[3]) ? $args[3] : '';
     827        $wpxe_custom_fields = $args[4];
     828
     829        if ( $post_id <> '' ){
     830            foreach($wpxe_custom_fields as $wpxe_field) {
     831
     832                $wpxe_value = get_post_meta($post_id, $wpxe_field['key']);
     833                $wpex_set_value = $wpxe_field['value'];
     834               
     835                if( $wpxe_value == "" && $wpex_set_value!="" ) {
     836                    add_post_meta($post_id, $wpxe_field['key'], $wpex_set_value, true);
     837                } elseif ( $wpxe_value != $wpex_set_value && $wpex_set_value<>"" ) {
     838                    update_post_meta($post_id, $wpxe_field['key'], $wpex_set_value);
     839                } elseif ( $wpex_set_value == "" ) {
     840                    delete_post_meta( $post_id, $wpxe_field['key'] );
     841                }
     842            }
     843            return true;
     844
     845        }else{
     846            return false;
     847        }
     848    }
     849
     850
    815851}
    816852
     853
    817854?>
Note: See TracChangeset for help on using the changeset viewer.