Plugin Directory

Changeset 2947873


Ignore:
Timestamp:
08/04/2023 06:26:32 PM (3 years ago)
Author:
wpyog
Message:

Resolve issue and update version

Location:
wpyog-documents/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wpyog-documents/trunk/index.php

    r2936955 r2947873  
    55Author: WPYog
    66Author URI: http://wpyog.com/
    7 Version: 1.1
     7Version: 1.3
    88License:            GPLv2 or later
    99License URI:        http://www.gnu.org/licenses/gpl-2.0.html
     
    182182
    183183add_shortcode('wpyog-document-list', 'wpyog_research_document_list' );
    184 function wpyog_research_document_list($atts){
     184function wpyog_research_document_list($atts, $content=null){
    185185    global $content, $wpdb;
    186186    ob_start();
    187    
    188187    extract(shortcode_atts(array(
    189188        'searchOption' => 'top',
     
    196195        'download' => 0
    197196    ), $atts));
    198    
     197    $cat                = ! empty( $category )              ? explode(',', $category)       : '';
    199198    $args = array (
    200199        'post_type'         => 'wpyog_document',
     
    204203        'order'   => $order,
    205204    );
    206    
    207     if( $category != "" ) {
     205    if( $cat != "" ) {
    208206        $args['tax_query'] = array(
    209207            array(
    210208                'taxonomy'  => 'wpyog_document_category',
    211209                'field'     => 'term_id',
    212                 'terms'     => $category
     210                'terms'     => $cat
    213211            )
    214212        );
    215         $args = array_merge($args,array('s' => $keywords));
    216     }
    217    
     213    }
    218214    $query      = new WP_Query( $args );
    219215    $includeFile = plugin_dir_path( __FILE__ ).'templates/research-document-list.php';
    220216    include( $includeFile );
    221217    $output = ob_get_clean();
     218    $output = wpautop(trim($output));
    222219    return $output;
    223220}
     
    307304    </div>
    308305<?php endwhile; } else { ?>
    309     <p>[wpyog-document id=<?php echo $document_id;?>]</p>
     306    <p>[wpyog-document id=<?php echo implode(',',$document_id);?>]</p>
    310307<?php }
    311308    //echo "<pre>"; print_r($documentRows); exit;
     
    441438    }
    442439}
     440
     441add_action('init', 'enable_revisions');
     442function enable_revisions() {
     443    add_post_type_support('wpyog_document', 'revisions');
     444}
     445add_action('save_post', 'create_custom_post_type_revision');
     446function create_custom_post_type_revision($post_id) {
     447    $post_type = get_post_type($post_id);
     448    if ($post_type !== 'wpyog_document' || wp_is_post_revision($post_id) || wp_is_post_autosave($post_id)) {
     449        return;
     450    }
     451    wp_save_post_revision($post_id);
     452}
  • wpyog-documents/trunk/readme.txt

    r2936955 r2947873  
    2020Show only selected Documents: Choose documents selectively by ID and list them into pages, posts or any other post types.
    2121
    22 * NEW IN VERSION 1.2
     22* NEW IN VERSION 1.3
    2323    * Category Filters allows you to sort your documents easily.
    2424    * Support for post order type, which allows you to custom sort your documents.
Note: See TracChangeset for help on using the changeset viewer.