-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_licenses_2_helpers_8php_source.html
94 lines (92 loc) · 14.2 KB
/
_licenses_2_helpers_8php_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GravityView: Helpers.php Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="custom-doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GravityView
 <span id="projectnumber">2.17</span>
</div>
<div id="projectbrief">The best, easiest way to display Gravity Forms entries on your website.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_c18ef6374e5a604878aeced0c5671a4f.html">vendor_prefixed</a></li><li class="navelem"><a class="el" href="dir_86b19f5df6747de098149f7d19a9f494.html">gravitykit</a></li><li class="navelem"><a class="el" href="dir_cef91bdb3eb284f59d80e56ba3584b5f.html">foundation</a></li><li class="navelem"><a class="el" href="dir_43934aaf9842616eb4dc1cec03c6d866.html">src</a></li><li class="navelem"><a class="el" href="dir_80e37e0f6a2cd9d5c47166d75818752a.html">Licenses</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Licenses/Helpers.php</div> </div>
</div><!--header-->
<div class="contents">
<a href="_licenses_2_helpers_8php.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <?php<span class="comment"></span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">/**</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * @license GPL-2.0-or-later</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * Modified by gravityview on 13-January-2023 using Strauss.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * @see https://github.com/BrianHenryIE/strauss</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> */</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> </div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="keyword">namespace </span><a class="code" href="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses.html">GravityKit\GravityView\Foundation\Licenses</a>;</div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> </div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> use <a class="code" href="namespace_exception.html">Exception</a>;</div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> </div><div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_helpers.html"> 13</a></span> <span class="keyword">class </span><a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_helpers.html">Helpers</a> {<span class="comment"></span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> /**</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * Performs remote call to GravityKit's EDD API.</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> *</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * @sice 1.0</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> *</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> * @param string $url</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> * @param array $args</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> *</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> * @throws Exception</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> *</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"> * @return array|null Response body.</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment"> */</span></div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_helpers.html#a22cd5177237699ccc3fb619f730ddbaf"> 26</a></span>  <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_helpers.html#a22cd5177237699ccc3fb619f730ddbaf">query_api</a>( <a class="code" href="post__image_8php.html#acf215f34a917d014776ce684a9ee8909">$url</a>, array <a class="code" href="search-field-submit_8php.html#a67e94494731d99ed23b123e95175bc10">$args</a> = [] ) {</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  $request_parameters = [</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  <span class="stringliteral">'timeout'</span> => 15,</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <span class="stringliteral">'sslverify'</span> => <span class="keyword">false</span>,</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <span class="stringliteral">'body'</span> => <a class="code" href="search-field-submit_8php.html#a67e94494731d99ed23b123e95175bc10">$args</a>,</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  ];</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  $response = wp_remote_post(</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <a class="code" href="post__image_8php.html#acf215f34a917d014776ce684a9ee8909">$url</a>,</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  $request_parameters</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  );</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <span class="keywordflow">if</span> ( is_wp_error( $response ) ) {</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( $response->get_error_message() );</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  }</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  $body = wp_remote_retrieve_body( $response );</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keywordflow">if</span> ( is_wp_error( $body ) ) {</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( $response->get_error_message() );</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  }</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> </div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  $response = json_decode( $body, <span class="keyword">true</span> );</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  } <span class="keywordflow">catch</span> ( <a class="code" href="namespace_exception.html">Exception</a> $e ) {</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="namespace_exception.html">Exception</a>( esc_html__( <span class="stringliteral">'Unable to process remote request. Invalid response body.'</span>, <span class="stringliteral">'gk-gravityview'</span> ) );</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  }</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keywordflow">return</span> $response;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  }</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> }</div><div class="ttc" id="post__image_8php_html_acf215f34a917d014776ce684a9ee8909"><div class="ttname"><a href="post__image_8php.html#acf215f34a917d014776ce684a9ee8909">$url</a></div><div class="ttdeci">$url</div><div class="ttdef"><b>Definition:</b> <a href="post__image_8php_source.html#l00025">post_image.php:25</a></div></div>
<div class="ttc" id="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_html"><div class="ttname"><a href="namespace_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses.html">GravityKit\GravityView\Foundation\Licenses</a></div><div class="ttdoc">GPL-2.0-or-later </div><div class="ttdef"><b>Definition:</b> <a href="_e_d_d_8php_source.html#l00009">EDD.php:9</a></div></div>
<div class="ttc" id="namespace_exception_html"><div class="ttname"><a href="namespace_exception.html">Exception</a></div></div>
<div class="ttc" id="search-field-submit_8php_html_a67e94494731d99ed23b123e95175bc10"><div class="ttname"><a href="search-field-submit_8php.html#a67e94494731d99ed23b123e95175bc10">$args</a></div><div class="ttdeci">$args</div><div class="ttdef"><b>Definition:</b> <a href="search-field-submit_8php_source.html#l00015">search-field-submit.php:15</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_helpers_html_a22cd5177237699ccc3fb619f730ddbaf"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_helpers.html#a22cd5177237699ccc3fb619f730ddbaf">GravityKit\GravityView\Foundation\Licenses\Helpers\query_api</a></div><div class="ttdeci">static query_api( $url, array $args=[])</div><div class="ttdoc">Performs remote call to GravityKit&#39;s EDD API. </div><div class="ttdef"><b>Definition:</b> <a href="_licenses_2_helpers_8php_source.html#l00026">Licenses/Helpers.php:26</a></div></div>
<div class="ttc" id="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_helpers_html"><div class="ttname"><a href="class_gravity_kit_1_1_gravity_view_1_1_foundation_1_1_licenses_1_1_helpers.html">GravityKit\GravityView\Foundation\Licenses\Helpers</a></div><div class="ttdef"><b>Definition:</b> <a href="_licenses_2_helpers_8php_source.html#l00013">Licenses/Helpers.php:13</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/>
<script type="text/javascript">
jQuery( document ).ready( function( $ ) {
$( 'a.anchor[id^=_filters],a.anchor[id^=_actions]' ).each( function() {
$( this )
.text('#')
.attr( 'href', function() {
return '#' + $( this ).attr( 'id' );
}).prependTo( $( this ).parent('dt' ).next('dd') );
});
});
</script>
</body>
</html>