Plugin Directory

Changeset 943863


Ignore:
Timestamp:
07/06/2014 09:42:34 AM (12 years ago)
Author:
austin437
Message:

2014-07-06 Commit

Location:
really-simple-related-posts/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • really-simple-related-posts/trunk/admin/admin.php

    r943278 r943863  
    11<?php
    2 /*
    3  * error_reporting(E_ALL);
    4    ini_set('display_errors', True);
    5  *
    6  */
     2
     3//error_reporting(E_ALL);
     4//ini_set('display_errors', True);
     5
    76
    87
     
    3433   
    3534    $args='';
    36     $categories = get_categories( $args );
    37        
    38     $option_data = get_option("rja_related_posts_category_tag");
    39    
     35    $categories = get_categories( $args );       
     36   
     37    $option_data = get_option("rja_related_posts_category_tag"); 
    4038   
    4139    echo '<div class="wrap">';
     
    7977                    $show_tag_link = 0;
    8078                   
    81                    
    82                     foreach($option_data  as $key=> $option){                       
     79                   if(is_array($option_data)){
     80                       foreach($option_data  as $key=> $option){                       
    8381                       
    84                         if($key == $category->term_id){
    85                            
    86                             $show_post_type = (!empty( $option['type']) ? $option['type'] : '');
    87                             $show_cat_link = (!empty( $option['show_cat_link']) ? $option['show_cat_link'] : '');
    88                             $show_tag_link = (!empty( $option['show_tag_link']) ? $option['show_tag_link'] : '');                       
    89                            
    90                            
     82                            if($key == $category->term_id){
     83
     84                                $show_post_type = (!empty( $option['type']) ? $option['type'] : '');
     85                                $show_cat_link = (!empty( $option['show_cat_link']) ? $option['show_cat_link'] : '');
     86                                $show_tag_link = (!empty( $option['show_tag_link']) ? $option['show_tag_link'] : '');                       
     87
     88
     89                            }
    9190                        }
    92                     }
     91                   } else {
     92                       $show_post_type = '';
     93                        $show_cat_link = '';
     94                        $show_tag_link = '';
     95                   }
     96                   
     97                   
    9398                   
    9499                    ?>
  • really-simple-related-posts/trunk/readme.txt

    r943289 r943863  
    44Tags: posts,
    55Requires at least: 3.0.0
    6 Tested up to: 3.9.1
    7 Stable tag: 1.0.3
     6Tested up to: 3.0
     7Stable tag: 1.0.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • really-simple-related-posts/trunk/really-simple-related-posts.php

    r943289 r943863  
    66 * Author URI:
    77 * Description: Display Related Posts
    8  * Version: 1.0.3
     8 * Version: 1.0.4
    99 * License: GPL2+
    1010 * Text Domain: related-posts
     
    2626*/
    2727
     28//error_reporting(E_ALL);
     29//ini_set('display_errors', True);
     30
    2831//style sheet
    29 add_action( 'wp_enqueue_scripts', 'safely_add_stylesheet' );
     32add_action( 'wp_enqueue_scripts', 'rja_safely_add_stylesheet' );
    3033
    3134/**
    3235 * Add stylesheet to the page
    3336 */
    34 function safely_add_stylesheet() {
     37function rja_safely_add_stylesheet() {
    3538    wp_enqueue_style( 'really-simple-related-posts', plugins_url( 'css/rsrp_styles.css', __FILE__ ), array() );   
    3639
     
    5760        if($disable_related_posts == 1){
    5861            return $the_content;
    59         }
     62        }   
    6063       
    6164       
     
    6568       
    6669        $cat_post_type=array();
    67    
     70       
     71       
    6872        foreach((get_the_category()) as $cat_key =>$category) {
    69            $catID = $category->term_id . ' ';           
    70             foreach($option_data as $opt_key => $option){
    71                
    72                 if($opt_key == $category->term_id ){
    73                    //print('<pre>'); print_r($option); print('</pre>');
    74                    $cat_post_type[$opt_key] = $option;
    75                  
     73           $catID = $category->term_id . ' ';
     74            if (is_array($option_data)){
     75                foreach($option_data as $opt_key => $option){
     76               
     77                    if($opt_key == $category->term_id ){
     78                       //print('<pre>'); print_r($option); print('</pre>');
     79                       $cat_post_type[$opt_key] = $option;
     80
     81                    }
    7682                }
    77             }
     83            }           
    7884        }
    7985   
Note: See TracChangeset for help on using the changeset viewer.