Plugin Directory

Changeset 1982801


Ignore:
Timestamp:
11/29/2018 07:41:27 PM (7 years ago)
Author:
navigationnorth
Message:

updates for v0.6.7

Location:
wp-oer/trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • wp-oer/trunk/open-educational-resources.php

    r1973228 r1982801  
    44 Plugin URI:   https://www.wp-oer.com
    55 Description:  Open Educational Resource management and curation, metadata publishing, and alignment to Common Core State Standards.
    6  Version:      0.6.6
     6 Version:      0.6.7
    77 Author:       Navigation North
    88 Author URI:   https://www.navigationnorth.com
     
    1111 License URI:  https://www.gnu.org/licenses/gpl-3.0.html
    1212
    13  Copyright (C) 2017 Navigation North
     13 Copyright (C) 2018 Navigation North
    1414
    1515 This program is free software: you can redistribute it and/or modify
     
    3737define( 'OER_PLUGIN_NAME', 'WP OER Plugin' );
    3838define( 'OER_ADMIN_PLUGIN_NAME', 'WP OER Plugin');
    39 define( 'OER_VERSION', '0.6.6' );
     39define( 'OER_VERSION', '0.6.7' );
    4040
    4141include_once(OER_PATH.'includes/oer-functions.php');
     
    279279        $file = $theme_file;
    280280    } else {
    281         $file = OER_PATH . '/oer_template/' . $template;
     281        $file = OER_PATH . 'oer_template/' . $template;
    282282    }
    283283
     
    324324    // Get Current Object if it belongs to Resource Category taxonomy
    325325    $resource_term = get_term_by( 'id' , $_id , 'resource-subject-area' );
    326 
     326    //var_dump($resource_term);
    327327    //Check if the loaded resource is a category
    328328    if ($resource_term && !is_wp_error( $resource_term )) {
     
    354354    if ($resource_tag && !is_wp_error( $resource_tag )) {
    355355        return oer_get_template_hierarchy('tag-resource');
     356    } elseif (is_post_type_archive('resource')) {
     357        return oer_get_template_hierarchy('archive-resource');
    356358    } else {
    357359        return $template;
    358360    }
     361 }
     362
     363 /**
     364 * Add filter to use plugin default archive template
     365 **/
     366add_filter( 'archive_template' , 'oer_custom_archive_template' );
     367
     368/**
     369 * Function to choose template for the resource archive
     370 **/
     371function oer_custom_archive_template( $template ) {
     372    global $wp_query;
     373
     374    if (is_post_type_archive('resource')) {
     375        $template = realpath(oer_get_template_hierarchy('archive-resource'));
     376    }
     377
     378    return $template;
    359379 }
    360380
Note: See TracChangeset for help on using the changeset viewer.