Plugin Directory

Changeset 943278


Ignore:
Timestamp:
07/04/2014 08:10:11 AM (12 years ago)
Author:
austin437
Message:

2014-07-04 upgrade 1

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

Legend:

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

    r942703 r943278  
    11<?php
     2/*
     3 * error_reporting(E_ALL);
     4   ini_set('display_errors', True);
     5 *
     6 */
    27
    3 /*
    4  * To change this license header, choose License Headers in Project Properties.
    5  * To change this template file, choose Tools | Templates
    6  * and open the template in the editor.
    7  */
    88
    99add_action( 'admin_menu', 'rja_really_simple_related_posts_create_menu' );
     
    1818function rja_really_simple_related_posts_settings_page(){
    1919 
    20     if ( $_POST['submit'] ) {
     20    if ( isset($_POST['submit']) ) {
    2121       
     22        if( !isset( $_POST['cat_post_type'] ) ) {
     23            $options=array();
     24        } else {
     25            $options = $_POST['cat_post_type'];
     26        }
    2227       
    23         $options = $_POST['cat_post_type'];
    2428
    2529        update_option('rja_related_posts_category_tag', $options);
     30   } else {
     31       $options = array();
    2632   }
    2733   
     
    7480                   
    7581                   
    76                     foreach($option_data  as $key=> $option){
     82                    foreach($option_data  as $key=> $option){                       
    7783                       
    7884                        if($key == $category->term_id){
    79                             $show_post_type = $option['type'];
    80                             $show_cat_link = $option['show_cat_link'];
    81                             $show_tag_link = $option['show_tag_link'];
     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                           
    8291                        }
    8392                    }
  • really-simple-related-posts/trunk/inc/post_meta.php

    r942703 r943278  
    11<?php
     2/*
     3error_reporting(E_ALL);
     4   ini_set('display_errors', True);
     5 *
     6 */
    27
    3 /*
    4  * To change this license header, choose License Headers in Project Properties.
    5  * To change this template file, choose Tools | Templates
    6  * and open the template in the editor.
    7  */
    88
    99/* Fire our meta box setup function on the post editor screen. */
  • really-simple-related-posts/trunk/really-simple-related-posts.php

    r942703 r943278  
    1313 */
    1414
     15/*
     16This program is free software; you can redistribute it and/or
     17modify it under the terms of the GNU General Public License
     18as published by the Free Software Foundation; either version 2
     19of the License, or (at your option) any later version.
     20
     21This program is distributed in the hope that it will be useful,
     22but WITHOUT ANY WARRANTY; without even the implied warranty of
     23MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     24GNU General Public License for more details.
     25
     26*/
     27
    1528//style sheet
    1629add_action( 'wp_enqueue_scripts', 'safely_add_stylesheet' );
     
    4558            return $the_content;
    4659        }
    47    
     60       
     61       
     62       
    4863    $option_data = get_option("rja_related_posts_category_tag");
    49         $postID =  get_the_ID();
     64        $postID =  get_the_ID();       
    5065       
    51                 $cat_post_type=array();
     66        $cat_post_type=array();
    5267   
    5368        foreach((get_the_category()) as $cat_key =>$category) {
     
    5671               
    5772                if($opt_key == $category->term_id ){
    58                  
    59                     $cat_post_type[$opt_key] = $option;
     73                   //print('<pre>'); print_r($option); print('</pre>');
     74                   $cat_post_type[$opt_key] = $option;
    6075                 
    6176                }
     
    6782       
    6883        foreach($cat_post_type as $key => $value){
    69             $show_cat_link = $value['show_cat_link'];
     84            $show_cat_link = (!empty( $value['show_cat_link']) ? $value['show_cat_link'] : '');           
    7085            if($value['type'] == "by_category"){
    7186                               
     
    100115               
    101116                $posttags = get_the_tags();
    102              
     117                //print('<pre>'); print_r($posttags); print('</pre>');
    103118                if ($posttags) {
    104119                    foreach($posttags as $tag) {
     
    136151                //By Category
    137152                $args=array(
    138                     //'category' => $key,
     153                   
    139154                    'category_name'=> get_the_category_by_ID( $key ),
    140155                    'tag' => '',
Note: See TracChangeset for help on using the changeset viewer.