Plugin Directory

Changeset 1438922


Ignore:
Timestamp:
06/18/2016 03:38:06 AM (10 years ago)
Author:
kowack
Message:

crosspost error

Location:
vkontakte-api/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • vkontakte-api/trunk/classes/parent.class.php

    r1438681 r1438922  
    120120
    121121        $result = curl_exec( $ch );
    122         curl_close( $ch );
    123122
    124123        if ( $result === false ) {
    125124            $this->_notice_error_curl( $ch );
    126125        }
     126
     127        curl_close( $ch );
    127128
    128129        return $result;
  • vkontakte-api/trunk/includes/crosspost.php

    r1438681 r1438922  
    487487
    488488        $params                 = array();
     489        $params['v'] = '3.0';
    489490        $params['from_group']   = 1;
    490491        $params['access_token'] = get_option( 'vkapi_at' );
     
    498499        // mini-test
    499500
    500         if ( mb_strlen( $params['attachments'] ) === 0 && mb_strlen( $params['message'] ) === 0 ) {
     501        if ( !isset( $params['attachments'] ) && mb_strlen( $params['message'] ) === 0 ) {
    501502            $this->_notice_error( 'crosspost', - 1, 'Ни текста ни медиа-приложений' );
    502503
  • vkontakte-api/trunk/includes/login.php

    r1438681 r1438922  
    260260     */
    261261    private function _vk_wpuser_get( $id ) {
    262         return reset( get_users( array(
     262        return call_user_func( 'reset', get_users( array(
    263263            'meta_key'    => 'vkapi_uid',
    264264            'meta_value'  => $id,
    265265            'number'      => 1,
    266266            'count_total' => false
    267         ) ) );
     267        ) ));
    268268    }
    269269
  • vkontakte-api/trunk/readme.txt

    r1438727 r1438922  
    55Requires at least: 3.5.1
    66Tested up to: 4.5.2
    7 Stable tag: 3.32.2
     7Stable tag: 3.32.3
    88
    99Добавляет функционал API сайта VKontakte.ru(vk.com) на ваш блог. Комментарии, кнопки, виджеты...
  • vkontakte-api/trunk/vkontakte-api.php

    r1438727 r1438922  
    44Plugin URI: https://darx.net/projects/vkontakte-api
    55Description: Add API functions from vk.com in your own blog.
    6 Version: 3.32.2
     6Version: 3.32.3
    77Author: kowack
    88Author URI: https://darx.net
     
    3333
    3434    public function _update() {
    35         $version_current = '3.32.2';
     35        $version_current = '3.32.3';
    3636        $version_old     = intval( get_option( 'vkapi_version' ) );
    3737
     
    133133
    134134    static public function install() {
    135         if ( ! wp_next_scheduled( 'vkapi_cron_hourly' ) ) {
    136             wp_schedule_event( time(), 'hourly', 'vkapi_cron_hourly' );
    137         }
    138         if ( ! wp_next_scheduled( 'vkapi_cron_daily' ) ) {
    139             wp_schedule_event( time(), 'daily', 'vkapi_cron_daily' );
    140         }
     135        wp_clear_scheduled_hook( 'vkapi_cron_hourly' );
     136        wp_clear_scheduled_hook( 'vkapi_cron_daily' );
     137        wp_schedule_event( time(), 'hourly', 'vkapi_cron_hourly' );
     138        wp_schedule_event( time(), 'daily', 'vkapi_cron_daily' );
    141139        // init platform
    142140        add_option( 'vkapi_appid' );
     
    204202    }
    205203
     204    // todo: what? how? Один не самый адекватный сказал что ловит 500 ошибку при деактивации
    206205    static function pause() {
    207         wp_clear_scheduled_hook( 'vkapi_cron_hourly' );
    208         wp_clear_scheduled_hook( 'vkapi_cron_daily' );
     206        if ( function_exists( 'wp_clear_scheduled_hook' ) ) {
     207            wp_clear_scheduled_hook( 'vkapi_cron_hourly' );
     208            wp_clear_scheduled_hook( 'vkapi_cron_daily' );
     209        }
    209210    }
    210211
Note: See TracChangeset for help on using the changeset viewer.