Plugin Directory

Changeset 778848


Ignore:
Timestamp:
09/26/2013 03:33:50 PM (13 years ago)
Author:
joshlevinson
Message:

Update to 1.1.0 - fixed comment issues.

Location:
woocommerce-product-faqs
Files:
4 edited
11 copied

Legend:

Unmodified
Added
Removed
  • woocommerce-product-faqs/tags/1.1.0/README.txt

    r768454 r778848  
    55Requires at least: 3.5.1
    66Tested up to: 3.7
    7 Stable tag: 1.0.9
     7Stable tag: 1.1.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    133133
    134134== Changelog ==
     135== 1.1.0 ==
     136* Fixed comment issues
     137
    135138= 1.0.9 =
    136139* Admin settings for tab title and priority
  • woocommerce-product-faqs/tags/1.1.0/class-woocommerce-faqs.php

    r768452 r778848  
    2626     * @var     string
    2727     */
    28     protected $version = '1.0.9';
     28    protected $version = '1.1.0';
    2929
    3030    /**
     
    123123        // Load plugin text domain
    124124        add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
     125
     126        //load upgrade functions
     127        add_action('init', array( $this, 'upgrade_actions' ) );
    125128
    126129        // Add the options page and menu item.
     
    235238    public static function deactivate( $network_wide ) {
    236239        // TODO: Define deactivation functionality here
     240    }
     241
     242    /**
     243     * Run upgrade options
     244     *
     245     * @since    1.1.0
     246     *
     247     */
     248    function upgrade_actions(){
     249
     250        $current_version = get_option( $this->option_prefix . 'plugin_version', '1.0.9' );
     251
     252        if($current_version != $this->version){
     253
     254            switch ($current_version) {
     255
     256                case '1.0.9':
     257
     258                    //update comment statuses
     259                    global $wpdb;
     260
     261                    $wpdb->update($table = $wpdb->posts, $data = array('comment_status'=>'open'), $where = array('post_type'=>$this->post_type), $format = array('%s'), $where_format = array('%s') );
     262
     263                    break;
     264
     265            }
     266
     267            update_option( $this->option_prefix . 'plugin_version', $this->version );
     268
     269        }
     270
    237271    }
    238272
     
    13251359        add_meta_box( $this->post_type . '_product', __( 'FAQ Details', $this->plugin_slug ), array( $this, 'metabox' ), $this->post_type, 'normal', 'high' );
    13261360
    1327         remove_meta_box( 'commentstatusdiv', $this->post_type, 'normal' );
     1361        //this causes comments to become disabled!
     1362        //remove_meta_box( 'commentstatusdiv', $this->post_type, 'normal' );
    13281363
    13291364    }
  • woocommerce-product-faqs/tags/1.1.0/views/loop-faqs.php

    r759547 r778848  
    181181        //faq, or allow unauthorized users to answer
    182182        if( current_user_can( $answer_caps ) && $preview != 'preview' ) {
    183 
    184             comment_form();
     183            $args = array(
     184              'id_form'           => 'commentform',
     185              'id_submit'         => 'submit',
     186              'title_reply'       => __( 'Leave an Answer', $this->plugin_slug ),
     187              'title_reply_to'    => __( 'Leave an Answer to %s', $this->plugin_slug ),
     188              'cancel_reply_link' => __( 'Cancel Answer', $this->plugin_slug ),
     189              'label_submit'      => __( 'Post Answer', $this->plugin_slug ),
     190
     191              'comment_field' =>  '<p class="comment-form-comment"><label for="comment">' . _x( 'Answer', 'noun', $this->plugin_slug ) .
     192                '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true">' .
     193                '</textarea></p>',
     194
     195              'must_log_in' => '',
     196
     197              'logged_in_as' => '',
     198
     199              'comment_notes_before' => '',
     200
     201              'comment_notes_after' => '',
     202
     203              'fields' => apply_filters( 'comment_form_default_fields', array()
     204              ),
     205            );
     206            comment_form($args);
    185207           
    186208        }
  • woocommerce-product-faqs/tags/1.1.0/woocommerce-faqs.php

    r768452 r778848  
    1313 * (Frequently Asked Questions) product-specific section that enables
    1414 * customers to ask questions, get responeses, and see other question threads
    15  * Version:     1.0.9
     15 * Version:     1.1.0
    1616 * Author:      Josh Levinson
    1717 * Author URI:  http://joshlevinson.me
  • woocommerce-product-faqs/trunk/README.txt

    r768454 r778848  
    55Requires at least: 3.5.1
    66Tested up to: 3.7
    7 Stable tag: 1.0.9
     7Stable tag: 1.1.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    133133
    134134== Changelog ==
     135== 1.1.0 ==
     136* Fixed comment issues
     137
    135138= 1.0.9 =
    136139* Admin settings for tab title and priority
  • woocommerce-product-faqs/trunk/class-woocommerce-faqs.php

    r768452 r778848  
    2626     * @var     string
    2727     */
    28     protected $version = '1.0.9';
     28    protected $version = '1.1.0';
    2929
    3030    /**
     
    123123        // Load plugin text domain
    124124        add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
     125
     126        //load upgrade functions
     127        add_action('init', array( $this, 'upgrade_actions' ) );
    125128
    126129        // Add the options page and menu item.
     
    235238    public static function deactivate( $network_wide ) {
    236239        // TODO: Define deactivation functionality here
     240    }
     241
     242    /**
     243     * Run upgrade options
     244     *
     245     * @since    1.1.0
     246     *
     247     */
     248    function upgrade_actions(){
     249
     250        $current_version = get_option( $this->option_prefix . 'plugin_version', '1.0.9' );
     251
     252        if($current_version != $this->version){
     253
     254            switch ($current_version) {
     255
     256                case '1.0.9':
     257
     258                    //update comment statuses
     259                    global $wpdb;
     260
     261                    $wpdb->update($table = $wpdb->posts, $data = array('comment_status'=>'open'), $where = array('post_type'=>$this->post_type), $format = array('%s'), $where_format = array('%s') );
     262
     263                    break;
     264
     265            }
     266
     267            update_option( $this->option_prefix . 'plugin_version', $this->version );
     268
     269        }
     270
    237271    }
    238272
     
    13251359        add_meta_box( $this->post_type . '_product', __( 'FAQ Details', $this->plugin_slug ), array( $this, 'metabox' ), $this->post_type, 'normal', 'high' );
    13261360
    1327         remove_meta_box( 'commentstatusdiv', $this->post_type, 'normal' );
     1361        //this causes comments to become disabled!
     1362        //remove_meta_box( 'commentstatusdiv', $this->post_type, 'normal' );
    13281363
    13291364    }
  • woocommerce-product-faqs/trunk/views/loop-faqs.php

    r759547 r778848  
    181181        //faq, or allow unauthorized users to answer
    182182        if( current_user_can( $answer_caps ) && $preview != 'preview' ) {
    183 
    184             comment_form();
     183            $args = array(
     184              'id_form'           => 'commentform',
     185              'id_submit'         => 'submit',
     186              'title_reply'       => __( 'Leave an Answer', $this->plugin_slug ),
     187              'title_reply_to'    => __( 'Leave an Answer to %s', $this->plugin_slug ),
     188              'cancel_reply_link' => __( 'Cancel Answer', $this->plugin_slug ),
     189              'label_submit'      => __( 'Post Answer', $this->plugin_slug ),
     190
     191              'comment_field' =>  '<p class="comment-form-comment"><label for="comment">' . _x( 'Answer', 'noun', $this->plugin_slug ) .
     192                '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true">' .
     193                '</textarea></p>',
     194
     195              'must_log_in' => '',
     196
     197              'logged_in_as' => '',
     198
     199              'comment_notes_before' => '',
     200
     201              'comment_notes_after' => '',
     202
     203              'fields' => apply_filters( 'comment_form_default_fields', array()
     204              ),
     205            );
     206            comment_form($args);
    185207           
    186208        }
  • woocommerce-product-faqs/trunk/woocommerce-faqs.php

    r768452 r778848  
    1313 * (Frequently Asked Questions) product-specific section that enables
    1414 * customers to ask questions, get responeses, and see other question threads
    15  * Version:     1.0.9
     15 * Version:     1.1.0
    1616 * Author:      Josh Levinson
    1717 * Author URI:  http://joshlevinson.me
Note: See TracChangeset for help on using the changeset viewer.