PluginProbe
Activity Logs, User Activity Tracking, Multisite Activity Log from Logtivity / trunk
Activity Logs, User Activity Tracking, Multisite Activity Log from Logtivity vtrunk
3.3.9 3.3.8 trunk 1.0 1.1.0 1.10.0 1.11.0 1.11.1 1.12.0 1.13.0 1.14.0 1.15.0 1.16.0 1.17.0 1.17.1 1.18.0 1.19.0 1.2.0 1.20.0 1.20.1 1.3.0 1.3.1 1.4.0 1.5.0 1.6.0 All 67 releases
logtivity / Loggers / Easy_Digital_Downloads / Base / Logtivity_Abstract_Easy_Digital_Downloads.php

Logtivity_Abstract_Easy_Digital_Downloads.php in Activity Logs, User Activity Tracking, Multisite Activity Log from Logtivity trunk, at Loggers/Easy_Digital_Downloads/Base/Logtivity_Abstract_Easy_Digital_Downloads.php

52 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * @package Logtivity
5 * @contact logtivity.io, [email protected]
6 * @copyright 2024-2026 Logtivity. All rights reserved
7 * @license https://www.gnu.org/licenses/gpl.html GNU/GPL
8 *
9 * This file is part of Logtivity.
10 *
11 * Logtivity is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * Logtivity is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with Logtivity. If not, see <https://www.gnu.org/licenses/>.
23 */
24
25 abstract class Logtivity_Abstract_Easy_Digital_Downloads
26 {
27 public function getDownloadTitle($licenseOrSubscriptionOrDownloadId, $price_id = null)
28 {
29 $priceOptionName = false;
30
31 if ($licenseOrSubscriptionOrDownloadId instanceof EDD_Subscription) {
32 $download_id = $licenseOrSubscriptionOrDownloadId->product_id;
33 $price_id = $licenseOrSubscriptionOrDownloadId->price_id;
34 } elseif($licenseOrSubscriptionOrDownloadId instanceof EDD_SL_License) {
35 $download_id = $licenseOrSubscriptionOrDownloadId->download_id;
36 $price_id = $licenseOrSubscriptionOrDownloadId->price_id;
37 } else {
38 $download_id = $licenseOrSubscriptionOrDownloadId;
39 }
40
41 $prices = edd_get_variable_prices($download_id);
42
43 if ($prices && count($prices) && $price_id) {
44 if (isset($prices[$price_id])) {
45 $priceOptionName = $prices[$price_id]['name'];
46 }
47 }
48
49 return logtivity_get_the_title($download_id) . ( $priceOptionName ? ' - ' .$priceOptionName : '');
50 }
51 }
52