Changeset 1181709
- Timestamp:
- 06/16/2015 08:48:49 AM (11 years ago)
- Location:
- post-shortcode/trunk
- Files:
-
- 6 edited
-
inc/pcs-ajax.php (modified) (2 diffs)
-
inc/pcs-shortcode.php (modified) (3 diffs)
-
inc/pcs-widget.php (modified) (2 diffs)
-
inc/tiny-shortcode.php (modified) (1 diff)
-
post-shortcode.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post-shortcode/trunk/inc/pcs-ajax.php
r1169087 r1181709 2 2 /** 3 3 * @since 2.0 4 * Adds ajax function. 5 */ 4 * Adds ajax function. 5 * @version 2.0.1 6 */ 6 7 add_action( 'wp_ajax_pcs_get_cat', 'pcs_get_cat_callback' ); 7 8 add_action( 'wp_ajax_nopriv_pcs_get_cat', 'pcs_get_cat_callback' ); … … 12 13 foreach ($acs as $ckey => $cvalue) { 13 14 foreach ($cvalue as $ck => $cv) { 15 $cckey = $ckey."$".$cv->slug; 14 16 ?> 15 <option value="<?php echo $c v->slug; ?>" <?php if(in_array( $cv->slug, $categories ) ) echo "selected"; ?>>16 <?php echo $cv->slug ; ?>17 <option value="<?php echo $cckey; ?>" <?php if(in_array( $cckey, $categories ) ) echo "selected"; ?>> 18 <?php echo $cv->slug." ( ".$ckey." )"; ?> 17 19 </option> 18 20 <?php -
post-shortcode/trunk/inc/pcs-shortcode.php
r1169087 r1181709 1 1 <?php 2 2 /** 3 * @since 2.0 3 * @since 2.0.0 4 4 * Add shortcode 5 5 */ … … 26 26 27 27 /** 28 * @version 2.0.1 28 29 * get output of post query 29 30 */ 30 31 function pcs_get_post_output($a){ 32 //global $wpdb; 31 33 extract($a); 32 34 $args['post_type'] = explode(",", $posttype); … … 35 37 $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; 36 38 $args['paged'] = $paged; 37 if(!empty($categories)) $args['category_name'] = $categories; 39 if(!empty($categories)): 40 $acat = explode(",", $categories); 41 foreach ($acat as $catkey => $catvalue) { 42 $actt = explode("$", $catvalue); 43 $ctkey = $actt[0]; 44 $ctvalue = $actt[1]; 45 $afctt[$ctkey][] = $ctvalue; 46 } 47 foreach ($afctt as $afckey => $afcvalue) { 48 $tax[] = array( 49 'taxonomy' => $afckey, 50 'field' => 'slug', 51 'terms' => $afcvalue, 52 ); 53 } 54 $tax_query = array( 55 'relation' => 'OR', 56 $tax 57 ); 58 $args['tax_query'] = $tax_query; 59 endif; 38 60 $args['orderby'] = $orderby; 39 61 $args['order'] = $order; 40 62 $ashowfield =explode(",", $showfield); 41 function pcs_excerpt_length( $length ) { 42 return $expertlength; 43 } 44 add_filter( 'excerpt_length', 'pcs_excerpt_length', 999 ); 45 //echo "<pre>"; print_r($args); die; 63 add_filter( 'excerpt_length', function( $length ) { return $expertlength; }, 999 ); 64 //echo "<pre>"; print_r($args); 46 65 query_posts($args); 66 //echo $wpdb->last_query; 47 67 // The Loop 48 68 if ( have_posts() ) : -
post-shortcode/trunk/inc/pcs-widget.php
r1169087 r1181709 3 3 * @since 2.0 4 4 * Adds PCS_Widget widget. 5 * @version 2.0.1 5 6 */ 6 7 class PCS_Widget extends WP_Widget { … … 175 176 foreach ($acs as $ckey => $cvalue) { 176 177 foreach ($cvalue as $ck => $cv) { 178 $cckey = $ckey."$".$cv->slug; 177 179 ?> 178 <option value="<?php echo $c v->slug; ?>" <?php if(in_array( $cv->slug, $categories ) ) echo "selected"; ?>>179 <?php echo $cv->slug ; ?>180 <option value="<?php echo $cckey; ?>" <?php if(in_array( $cckey, $categories ) ) echo "selected"; ?>> 181 <?php echo $cv->slug." ( ".$ckey." )"; ?> 180 182 </option> 181 183 <?php 182 184 } 183 ?> 184 <?php } ?> 185 } ?> 185 186 </select> 186 187 </p> -
post-shortcode/trunk/inc/tiny-shortcode.php
r1169087 r1181709 54 54 ); 55 55 56 $aCategory[ ] = get_categories( $args );56 $aCategory[$tax] = get_categories( $args ); 57 57 } 58 58 } -
post-shortcode/trunk/post-shortcode.php
r1169087 r1181709 4 4 * Plugin URI: 5 5 * Description: An post display beautifully. 6 * Version: 2.0. 06 * Version: 2.0.1 7 7 * Author: Sachin Jadhav 8 8 * Author URI: http://sachin8600.wordpress.com/ -
post-shortcode/trunk/readme.txt
r1169087 r1181709 1 1 === Plugin Name === 2 Contributors: (sachin8600)2 Contributors: sachin8600 3 3 Donate link: 4 Tags: post, custom-post, widget, shortcode, category-post4 Tags: post, custom-post, post-widget, post-shortcode, custom-taxonomy, category 5 5 Requires at least: 3.4.1 6 6 Tested up to: 4.2.2 7 Stable tag: 2.0.07 Stable tag: trunk 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 108 108 109 109 == Upgrade Notice == 110 = 1.0.1 = 110 = 2.0.1 = 111 Solving bug about category and excerpt. 112 = 2.0.0 = 111 113 This change of whole plugin its like new plugin with same name. 112 = 1.0 =113 Upgrade notices describe the reason a user should upgrade. No more than 300 characters.114 115 = 0.5 =116 This version fixes a security related bug. Upgrade immediately.
Note: See TracChangeset
for help on using the changeset viewer.