PluginProbe
Gianism / trunk
Gianism vtrunk
4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.4.0 5.0.0 5.0.1 5.0.2 5.1.0 5.2.1 5.2.2 5.3.0 6.0.0 6.0.1 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 All 65 releases
gianism / app / Gianism / Pattern / Application.php

Application.php in Gianism trunk, at app/Gianism/Pattern/Application.php

39 lines 712 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Gianism\Pattern;
4
5
6 /**
7 * Base class
8 *
9 * @package Gianism
10 * @author Takahashi Fumiki
11 * @since 2.0
12 *
13 */
14 abstract class Application extends Singleton {
15
16 use AppBase;
17
18 /**
19 * Retrieve user meta's owner ID
20 *
21 * @global \wpdb $wpdb
22 *
23 * @param string $key
24 * @param string $value
25 *
26 * @return int User ID. If not exists, return 0
27 */
28 public function get_meta_owner( $key, $value ) {
29 /** @var \wpdb $wpdb */
30 global $wpdb;
31 $sql = <<<EOS
32 SELECT user_id FROM {$wpdb->usermeta}
33 WHERE meta_key = %s AND meta_value = %s
34 EOS;
35 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
36 return (int) $wpdb->get_var( $wpdb->prepare( $sql, $key, $value ) );
37 }
38 }
39