PluginProbe
MyRewards / trunk
MyRewards vtrunk
5.7.8 5.7.7 5.7.6 trunk 1.2.2 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.1 2.2.0 2.3.0 2.4.0 2.4.1 2.5.0 2.6.4 2.6.6 3.0.0.0 3.1.0 3.1.2 3.1.2.1 3.10.4 3.10.9 All 165 releases
woorewards / include / pointsflow / methods / metakey.php

metakey.php in MyRewards trunk, at include/pointsflow/methods/metakey.php

31 lines 964 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace LWS\WOOREWARDS\PointsFlow\Methods;
3
4 // don't call the file directly
5 if( !defined( 'ABSPATH' ) ) exit();
6
7 /** From User Meta database table, only need a meta_key */
8 class MetaKey extends \LWS\WOOREWARDS\PointsFlow\ExportMethod
9 {
10 /** @return (array) the json that will be send,
11 * An array with each entries as {email, points} */
12 public function export($value, $arg)
13 {
14 global $wpdb;
15 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
16 return $wpdb->get_results($wpdb->prepare("SELECT user_email as `email`, meta_value as `points` FROM {$wpdb->usermeta} INNER JOIN {$wpdb->users} ON ID=user_id WHERE `meta_key`=%s", $value));
17 }
18
19 /** @return (string) human readable name */
20 public function getTitle()
21 {
22 return __("By User Meta Key", 'woorewards-lite');
23 }
24
25 /** @return (bool) appear in method combobox */
26 public function isVisible()
27 {
28 return __CLASS__ != get_class($this);
29 }
30 }
31