Plugin Directory

Changeset 2142298


Ignore:
Timestamp:
08/20/2019 04:06:35 AM (7 years ago)
Author:
designwall
Message:

Release new version 1.5.7

Location:
dw-question-answer
Files:
182 added
3 edited

Legend:

Unmodified
Added
Removed
  • dw-question-answer/trunk/dw-question-answer.php

    r2051011 r2142298  
    55 *  Author: DesignWall
    66 *  Author URI: http://www.designwall.com
    7  *  Version: 1.5.6
     7 *  Version: 1.5.7
    88 *  Text Domain: dw-question-answer
    99 *  @since 1.4.0
     
    1313
    1414class DW_Question_Answer {
    15     private $last_update = 180720161356; //last update time of the plugin
     15    private $last_update = 180720161357; //last update time of the plugin
    1616
    1717    public function __construct() {
     
    2626        $this->stylesheet_uri = DWQA_STYLESHEET_URL;
    2727
    28         $this->version = '1.5.6';
     28        $this->version = '1.5.7';
    2929
    3030        // load posttype
  • dw-question-answer/trunk/readme.txt

    r2051011 r2142298  
    33Tags: question, answer, support, quora, stackoverflow
    44Requires at least: 3.0.1
    5 Tested up to: 4.9.7
    6 Stable tag: 1.5.6
     5Tested up to: 5.2.2
     6Stable tag: 1.5.7
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    8585
    8686== Changelog ==
     87= 1.5.7 =
     88* Fix: Upgrade new version not showing answer
    8789
    8890= 1.5.6 =
  • dw-question-answer/trunk/upgrades/upgrades.php

    r1942382 r2142298  
    77class DWQA_Upgrades {
    88    public static $db_version;
    9     private static $version = '1.3.4';
     9    private static $version = '1.3.5';
    1010
    1111    public static function init() {
     
    7777        $cursor = get_option( 'dwqa_upgrades_step', 0 );
    7878        $step = 100;
    79         $length = $wpdb->get_var( "SELECT count(*) FROM $wpdb->posts WHERE 1=1 AND post_type = 'dwqa-answer'" );
    80         if( $cursor + $step <= $length ) {
     79        $length = $wpdb->get_var( "SELECT count(*) FROM $wpdb->posts p JOIN $wpdb->postmeta pm ON p.ID = pm.post_id WHERE 1=1 AND post_type = 'dwqa-answer' AND pm.meta_key = '_question'" );
     80        if( $cursor <= $length ) {
    8181            $answers = $wpdb->get_results( $wpdb->prepare( "SELECT ID, meta_value as parent FROM $wpdb->posts p JOIN $wpdb->postmeta pm ON p.ID = pm.post_id WHERE 1=1 AND post_type = 'dwqa-answer' AND pm.meta_key = '_question' LIMIT %d, %d ", $cursor, $step ) );
    8282
    8383            if ( ! empty( $answers ) ) {
    8484                foreach ( $answers as $answer ) {
    85                     $update = wp_update_post( array( 'ID' => $answer->ID, 'post_parent' => $answer->parent, ), true );
     85                    $update = wp_update_post( array( 'ID' => $answer->ID, 'post_parent' => $answer->parent ), true );
    8686                }
    8787                $cursor += $step;
    8888                update_option( 'dwqa_upgrades_step', $cursor );
     89                return $cursor;
    8990            } else {
    9091                delete_option( 'dwqa_upgrades_step' );
     92                return 0;
    9193            }
    9294        } else {
    9395            delete_option( 'dwqa_upgrades_step' );
     96            return 0;
    9497        }
    9598    }
Note: See TracChangeset for help on using the changeset viewer.