PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.1.4
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.1.4
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Core / wordpress / url.php

url.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.1.4, at back/Core/wordpress/url.php

77 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 function acym_route($url, $xhtml = true, $ssl = null)
4 {
5 return acym_baseURI().$url;
6 }
7
8 function acym_addPageParam($url, $ajax = false, $front = false)
9 {
10 preg_match('#^([a-z]+)(?:[^a-z]|$)#Uis', $url, $ctrl);
11
12 if ($front) {
13 $link = 'index.php?page='.ACYM_COMPONENT.'_front&ctrl='.$url;
14 if ($ajax) $link .= '&'.acym_noTemplate();
15 } else {
16 $link = 'admin.php?page='.ACYM_COMPONENT.'_'.$ctrl[1].'&ctrl='.$url;
17 if ($ajax) {
18 $link .= '&action='.ACYM_COMPONENT.'_router&'.acym_noTemplate();
19 }
20 }
21
22 return $link;
23 }
24
25 function acym_baseURI($pathonly = false)
26 {
27 if (acym_isAdmin()) {
28 return admin_url();
29 }
30
31 return acym_rootURI();
32 }
33
34 function acym_rootURI($pathonly = false, $path = 'siteurl')
35 {
36 $rootURI = rtrim(site_url(), '/').'/';
37
38 if (!acym_isAdmin()) {
39 $wpmlSiteUrl = apply_filters('wpml_home_url', $rootURI);
40 if ($wpmlSiteUrl !== $rootURI) {
41 $rootURI = rtrim($wpmlSiteUrl, '/').'/';
42 }
43 }
44
45 if (defined('CONTENT_DIR') && substr($rootURI, -3) === 'wp/') {
46 $rootURI = substr($rootURI, 0, -3);
47 }
48
49 return $rootURI;
50 }
51
52 function acym_completeLink($link, $popup = false, $redirect = false, $forceNoPopup = false)
53 {
54 if (($popup || acym_isNoTemplate()) && $forceNoPopup == false) {
55 $link .= '&'.acym_noTemplate();
56 }
57
58 $link = acym_addPageParam($link);
59
60 return acym_route($link);
61 }
62
63 function acym_prepareAjaxURL($url)
64 {
65 return htmlspecialchars_decode(acym_route(acym_addPageParam($url, true)));
66 }
67
68 function acym_frontendLink($link, $complete = true, $sef = true)
69 {
70 return acym_rootURI().acym_addPageParam($link, true, true);
71 }
72
73 function acym_getMenu()
74 {
75 return get_post();
76 }
77