Changeset 943278
- Timestamp:
- 07/04/2014 08:10:11 AM (12 years ago)
- Location:
- really-simple-related-posts/trunk
- Files:
-
- 3 edited
-
admin/admin.php (modified) (3 diffs)
-
inc/post_meta.php (modified) (1 diff)
-
really-simple-related-posts.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
really-simple-related-posts/trunk/admin/admin.php
r942703 r943278 1 1 <?php 2 /* 3 * error_reporting(E_ALL); 4 ini_set('display_errors', True); 5 * 6 */ 2 7 3 /*4 * To change this license header, choose License Headers in Project Properties.5 * To change this template file, choose Tools | Templates6 * and open the template in the editor.7 */8 8 9 9 add_action( 'admin_menu', 'rja_really_simple_related_posts_create_menu' ); … … 18 18 function rja_really_simple_related_posts_settings_page(){ 19 19 20 if ( $_POST['submit']) {20 if ( isset($_POST['submit']) ) { 21 21 22 if( !isset( $_POST['cat_post_type'] ) ) { 23 $options=array(); 24 } else { 25 $options = $_POST['cat_post_type']; 26 } 22 27 23 $options = $_POST['cat_post_type'];24 28 25 29 update_option('rja_related_posts_category_tag', $options); 30 } else { 31 $options = array(); 26 32 } 27 33 … … 74 80 75 81 76 foreach($option_data as $key=> $option){ 82 foreach($option_data as $key=> $option){ 77 83 78 84 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 82 91 } 83 92 } -
really-simple-related-posts/trunk/inc/post_meta.php
r942703 r943278 1 1 <?php 2 /* 3 error_reporting(E_ALL); 4 ini_set('display_errors', True); 5 * 6 */ 2 7 3 /*4 * To change this license header, choose License Headers in Project Properties.5 * To change this template file, choose Tools | Templates6 * and open the template in the editor.7 */8 8 9 9 /* Fire our meta box setup function on the post editor screen. */ -
really-simple-related-posts/trunk/really-simple-related-posts.php
r942703 r943278 13 13 */ 14 14 15 /* 16 This program is free software; you can redistribute it and/or 17 modify it under the terms of the GNU General Public License 18 as published by the Free Software Foundation; either version 2 19 of the License, or (at your option) any later version. 20 21 This program is distributed in the hope that it will be useful, 22 but WITHOUT ANY WARRANTY; without even the implied warranty of 23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 GNU General Public License for more details. 25 26 */ 27 15 28 //style sheet 16 29 add_action( 'wp_enqueue_scripts', 'safely_add_stylesheet' ); … … 45 58 return $the_content; 46 59 } 47 60 61 62 48 63 $option_data = get_option("rja_related_posts_category_tag"); 49 $postID = get_the_ID(); 64 $postID = get_the_ID(); 50 65 51 $cat_post_type=array();66 $cat_post_type=array(); 52 67 53 68 foreach((get_the_category()) as $cat_key =>$category) { … … 56 71 57 72 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; 60 75 61 76 } … … 67 82 68 83 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'] : ''); 70 85 if($value['type'] == "by_category"){ 71 86 … … 100 115 101 116 $posttags = get_the_tags(); 102 117 //print('<pre>'); print_r($posttags); print('</pre>'); 103 118 if ($posttags) { 104 119 foreach($posttags as $tag) { … … 136 151 //By Category 137 152 $args=array( 138 //'category' => $key,153 139 154 'category_name'=> get_the_category_by_ID( $key ), 140 155 'tag' => '',
Note: See TracChangeset
for help on using the changeset viewer.