Cherry Services List - Version 1.0.2

Version Description

  • UPD: Allow to crop description macros
Download this release

Release Info

Developer TemplateMonster 2002
Plugin Icon 128x128 Cherry Services List
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.2

cherry-services-list.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Cherry Services List
4
  * Plugin URI: http://www.templatemonster.com/wordpress-themes.php
5
  * Description: Cherry Services is a flexible WordPress plugin that lets you display your company’s services in a variety of ways.
6
- * Version: 1.0.1
7
  * Author: TemplateMonster
8
  * Author URI: TemplateMonster
9
  * Text Domain: cherry-services
@@ -83,7 +83,7 @@ if ( ! class_exists( 'Cherry_Services_List' ) ) {
83
  * @access private
84
  * @var string
85
  */
86
- private $version = '1.0.1';
87
 
88
  /**
89
  * Plugin CPT name
3
  * Plugin Name: Cherry Services List
4
  * Plugin URI: http://www.templatemonster.com/wordpress-themes.php
5
  * Description: Cherry Services is a flexible WordPress plugin that lets you display your company’s services in a variety of ways.
6
+ * Version: 1.0.2
7
  * Author: TemplateMonster
8
  * Author URI: TemplateMonster
9
  * Text Domain: cherry-services
83
  * @access private
84
  * @var string
85
  */
86
+ private $version = '1.0.2';
87
 
88
  /**
89
  * Plugin CPT name
public/includes/class-cherry-services-list-template-callbacks.php CHANGED
@@ -465,7 +465,34 @@ class Cherry_Services_List_Template_Callbacks {
465
  * @return string
466
  */
467
  public function get_desc( $args = array() ) {
468
- return $this->get_meta_html( 'descr', $args );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
469
  }
470
 
471
  /**
465
  * @return string
466
  */
467
  public function get_desc( $args = array() ) {
468
+
469
+ global $post;
470
+
471
+ $value = get_post_meta( $post->ID, 'cherry-services-descr', true );
472
+ $class = 'service-descr';
473
+
474
+ if ( empty( $args['class'] ) ) {
475
+ $args['class'] = $class;
476
+ } else {
477
+ $args['class'] .= ' ' . $class;
478
+ }
479
+
480
+ $args = wp_parse_args( $args, array(
481
+ 'base' => $meta . '_wrap',
482
+ 'crop' => 'no',
483
+ 'more' => '…',
484
+ ) );
485
+
486
+ $args['crop'] = filter_var( $args['crop'], FILTER_VALIDATE_BOOLEAN );
487
+
488
+ if ( true === $args['crop'] ) {
489
+ $length = intval( $this->atts['excerpt_length'] );
490
+ $more = esc_attr( $args['more'] );
491
+ $value = wp_trim_words( $value, $length, $more );
492
+ }
493
+
494
+ return ( ! empty( $value ) ) ? $this->meta_wrap( $value, $args ) : '';
495
+
496
  }
497
 
498
  /**
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: TemplateMonster 2002
4
  Tags: custom post type, services, service, cherry-framework
5
  Requires at least: 4.5
6
  Tested up to: 4.6.1
7
- Stable tag: 1.0.1
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -49,3 +49,7 @@ If you have Cherry Testimonials plugin installed on your website, you can also i
49
  = 1.0.1 =
50
 
51
  * SYS: Added cherry-framework tag
 
 
 
 
4
  Tags: custom post type, services, service, cherry-framework
5
  Requires at least: 4.5
6
  Tested up to: 4.6.1
7
+ Stable tag: 1.0.2
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
49
  = 1.0.1 =
50
 
51
  * SYS: Added cherry-framework tag
52
+
53
+ = 1.0.2 =
54
+
55
+ * UPD: Allow to crop description macros