Changeset 943863
- Timestamp:
- 07/06/2014 09:42:34 AM (12 years ago)
- Location:
- really-simple-related-posts/trunk
- Files:
-
- 3 edited
-
admin/admin.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
really-simple-related-posts.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
really-simple-related-posts/trunk/admin/admin.php
r943278 r943863 1 1 <?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 7 6 8 7 … … 34 33 35 34 $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"); 40 38 41 39 echo '<div class="wrap">'; … … 79 77 $show_tag_link = 0; 80 78 81 82 foreach($option_data as $key=> $option){79 if(is_array($option_data)){ 80 foreach($option_data as $key=> $option){ 83 81 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 } 91 90 } 92 } 91 } else { 92 $show_post_type = ''; 93 $show_cat_link = ''; 94 $show_tag_link = ''; 95 } 96 97 93 98 94 99 ?> -
really-simple-related-posts/trunk/readme.txt
r943289 r943863 4 4 Tags: posts, 5 5 Requires at least: 3.0.0 6 Tested up to: 3. 9.17 Stable tag: 1.0. 36 Tested up to: 3.0 7 Stable tag: 1.0.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
really-simple-related-posts/trunk/really-simple-related-posts.php
r943289 r943863 6 6 * Author URI: 7 7 * Description: Display Related Posts 8 * Version: 1.0. 38 * Version: 1.0.4 9 9 * License: GPL2+ 10 10 * Text Domain: related-posts … … 26 26 */ 27 27 28 //error_reporting(E_ALL); 29 //ini_set('display_errors', True); 30 28 31 //style sheet 29 add_action( 'wp_enqueue_scripts', ' safely_add_stylesheet' );32 add_action( 'wp_enqueue_scripts', 'rja_safely_add_stylesheet' ); 30 33 31 34 /** 32 35 * Add stylesheet to the page 33 36 */ 34 function safely_add_stylesheet() {37 function rja_safely_add_stylesheet() { 35 38 wp_enqueue_style( 'really-simple-related-posts', plugins_url( 'css/rsrp_styles.css', __FILE__ ), array() ); 36 39 … … 57 60 if($disable_related_posts == 1){ 58 61 return $the_content; 59 } 62 } 60 63 61 64 … … 65 68 66 69 $cat_post_type=array(); 67 70 71 68 72 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 } 76 82 } 77 } 83 } 78 84 } 79 85
Note: See TracChangeset
for help on using the changeset viewer.