Changeset 2374700
- Timestamp:
- 09/03/2020 06:18:19 PM (6 years ago)
- Location:
- wp-post-rating/trunk
- Files:
-
- 5 edited
-
readme.txt (modified) (3 diffs)
-
src/Service/ConfigService.php (modified) (1 diff)
-
src/Views/RatingView.php (modified) (4 diffs)
-
src/Views/SchemaOrgView.php (modified) (3 diffs)
-
wp-post-rating.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-post-rating/trunk/readme.txt
r2369706 r2374700 6 6 Tested up to: 5.5 7 7 Requires PHP: 7.2 8 Stable tag: 1.1.0. 28 Stable tag: 1.1.0.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 27 27 *You may customize color of stars and second color automatically generated* 28 28 29 * MultiLanguages 30 *English 31 *Russian 32 29 33 ###Functional: 30 34 * Widget for show latest (any sort) votes in sidebar (other place) … … 40 44 41 45 == Changelog == 46 = 1.1.0.3 = 47 * Fixed bug which blocked work with page builders, like as Divi, Beaver, Visual Composer, Themify, Elementor, Oxygen 42 48 = 1.1.0.2 = 43 49 * Fixed bug with ajax request -
wp-post-rating/trunk/src/Service/ConfigService.php
r2369706 r2374700 11 11 const PLUGIN_NONCE_KEY = 'WPR_rating_key'; 12 12 13 const PLUGIN_VERSION = '1.1.0. 2';13 const PLUGIN_VERSION = '1.1.0.3'; 14 14 15 15 const PLUGIN_NAME = 'wp-post-rating'; -
wp-post-rating/trunk/src/Views/RatingView.php
r2363367 r2374700 6 6 7 7 use WPR\Service\RatingService; 8 use WPR\Service\WordpressFunctionsService; 8 9 9 10 class RatingView extends AbstractView … … 18 19 */ 19 20 private $viewSchemaOrg; 21 /** 22 * @var WordpressFunctionsService 23 */ 24 private $wordpressFunctionsService; 20 25 21 public function __construct(RatingService $service, SchemaOrgView $viewSchemaOrg) 26 public function __construct( 27 RatingService $service, 28 SchemaOrgView $viewSchemaOrg, 29 WordpressFunctionsService $wordpressFunctionsService 30 ) 22 31 { 23 32 parent::__construct(); 24 33 $this->service = $service; 25 34 $this->viewSchemaOrg = $viewSchemaOrg; 35 $this->wordpressFunctionsService = $wordpressFunctionsService; 26 36 } 27 37 28 38 public function renderStars() 29 39 { 30 $id = get_the_ID();40 $id = $this->wordpressFunctionsService->getCurrentPostID(); 31 41 32 42 return $this->twig->render('star-rating.twig', [ 33 43 'postId' => $id, 34 'title' => get_the_title($id),44 'title' => \get_the_title($id), 35 45 'avgRating' => $this->service->getAvgRating($id), 36 46 'total' => $this->service->getTotalVotesByPostId($id), … … 44 54 public function getRatingAvg() 45 55 { 46 return $this->service->getAvgRating( get_the_ID());56 return $this->service->getAvgRating($this->wordpressFunctionsService->getCurrentPostID()); 47 57 } 48 58 … … 52 62 public function getRatingTotal() 53 63 { 54 return $this->service->getTotalVotesByPostId( get_the_ID());64 return $this->service->getTotalVotesByPostId($this->wordpressFunctionsService->getCurrentPostID()); 55 65 } 56 66 } -
wp-post-rating/trunk/src/Views/SchemaOrgView.php
r2369706 r2374700 7 7 use WPR\Service\RatingService; 8 8 use WPR\Service\SettingService; 9 use WPR\Service\WordpressFunctionsService; 9 10 10 11 class SchemaOrgView extends AbstractView … … 19 20 */ 20 21 private $serviceRating; 22 /** 23 * @var WordpressFunctionsService 24 */ 25 private $wordpressFunctionsService; 21 26 22 public function __construct(SettingService $settingService, RatingService $serviceRating) 23 { 27 public function __construct( 28 SettingService $settingService, 29 RatingService $serviceRating, 30 WordpressFunctionsService $wordpressFunctionsService 31 ) { 24 32 parent::__construct(); 25 33 $this->settingService = $settingService; 26 34 $this->serviceRating = $serviceRating; 35 $this->wordpressFunctionsService = $wordpressFunctionsService; 27 36 } 28 37 … … 32 41 33 42 if ($settingsEntity->isSchemaEnable()) { 34 $postId = get_the_ID();43 $postId = $this->wordpressFunctionsService->getCurrentPostID(); 35 44 36 45 return $this->twig->render('star-rating-schema.twig', [ -
wp-post-rating/trunk/wp-post-rating.php
r2369706 r2374700 4 4 Plugin URI: http://romua1d.ru/wp_post_rating 5 5 Description: Powerful post rating wordpress plugin. 6 Version: 1.1.0. 26 Version: 1.1.0.3 7 7 Author: Romua1d 8 8 Author URI: https://romua1d.ru … … 32 32 use WPR\Service\SettingFormService; 33 33 use WPR\Service\Admin\AdminMenuService; 34 use WPR\Service\WordpressFunctionsService; 34 35 35 36 ################################################# … … 48 49 SettingService::class => create(SettingService::class), 49 50 SettingFormService::class => create(SettingFormService::class), 51 WordpressFunctionsService::class => create(WordpressFunctionsService::class), 50 52 51 53 AdminMenuService::class => create(AdminMenuService::class),
Note: See TracChangeset
for help on using the changeset viewer.