PluginProbe ʕ •ᴥ•ʔ
Admin Columns / 3.1.10
Admin Columns v3.1.10
7.0.19 2.3.5 2.4 2.4.1 2.4.10 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.6.1 2.5.6.2 2.5.6.3 2.5.6.4 3.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.7 3.1 3.1.1 3.1.10 3.1.2 3.1.3 3.1.5 3.2.3 3.2.7 3.3.1 3.4.1 3.4.6 3.4.8 4.0.1 4.0.3 4.1.6 4.2.2 4.2.5 4.3 4.3.2 4.4.1 4.4.4 4.4.5 4.5.5 4.6.1 4.7.18 4.7.19 4.7.20 4.7.7 7.0.13 7.0.14 7.0.16 trunk 1.0 1.1 1.1.3 1.2 1.2.1 1.3 1.3.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.5.1 1.4.6 1.4.6.1 1.4.6.2 1.4.6.3 1.4.6.4 1.4.7 1.4.8 1.4.9 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2 2.2.1 2.2.1.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.5.1 2.2.6 2.2.6.1 2.2.6.2 2.2.6.3 2.2.6.4 2.2.7 2.2.8 2.2.8.1 2.2.9 2.3.1 2.3.2 2.3.3
codepress-admin-columns / api.php
codepress-admin-columns Last commit date
assets 8 years ago classes 8 years ago external 8 years ago languages 8 years ago templates 8 years ago api.php 8 years ago codepress-admin-columns.php 8 years ago readme.txt 8 years ago
api.php
172 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 /**
8 * @return bool True when Admin Columns Pro plugin is activated.
9 */
10 function ac_is_pro_active() {
11 return function_exists( 'ACP' );
12 }
13
14 /**
15 * Get the url where the Admin Columns website is hosted
16 *
17 * @return string
18 */
19 function ac_get_site_url( $path = '' ) {
20 $url = 'https://www.admincolumns.com';
21
22 if ( ! empty( $path ) ) {
23 $url .= '/' . trim( $path, '/' ) . '/';
24 }
25
26 return $url;
27 }
28
29 /**
30 * Url with utm tags
31 *
32 * @param string $path
33 * @param string $utm_medium
34 * @param string $utm_content
35 *
36 * @return string
37 */
38 function ac_get_site_utm_url( $path, $utm_medium, $utm_content = null, $utm_campaign = false ) {
39 $url = ac_get_site_url( $path );
40
41 if ( ! $utm_campaign ) {
42 $utm_campaign = 'plugin-installation';
43 }
44
45 $args = array(
46 // Referrer: plugin
47 'utm_source' => 'plugin-installation',
48
49 // Specific promotions or sales
50 'utm_campaign' => $utm_campaign,
51
52 // Marketing medium: banner, documentation or email
53 'utm_medium' => $utm_medium,
54
55 // Used for differentiation of medium
56 'utm_content' => $utm_content,
57 );
58
59 $args = array_map( 'sanitize_key', array_filter( $args ) );
60
61 return add_query_arg( $args, $url );
62 }
63
64 /**
65 * Admin Columns Twitter username
66 *
67 * @return string
68 */
69 function ac_get_twitter_handle() {
70 return 'admincolumns';
71 }
72
73 /**
74 * Simple helper methods for AC_Column objects
75 *
76 * @since 3.0
77 */
78 function ac_helper() {
79 return AC()->helper();
80 }
81
82 /**
83 * @since 3.0
84 * @return bool True when a minimum version of Admin Columns Pro plugin is activated.
85 */
86 function ac_is_version_gte( $version ) {
87 return version_compare( AC()->get_version(), $version, '>=' );
88 }
89
90 /**
91 * Manually set the columns for a list screen
92 * This overrides the database settings and thus renders the settings screen for this list screen useless
93 *
94 * If you like to register a column of your own please have a look at our documentation.
95 * We also have a free start-kit available, which contains all the necessary files.
96 *
97 * Documentation: https://www.admincolumns.com/documentation/developer-docs/creating-new-column-type/
98 * Starter-kit: https://github.com/codepress/ac-column-template/
99 *
100 * @since 2.2
101 *
102 * @param string|array $list_screen_key List screen key or keys
103 * @param array $column_data
104 */
105 function ac_register_columns( $list_screen_keys, $column_data ) {
106 AC()->api()->load_columndata( $list_screen_keys, $column_data );
107 }
108
109 /**
110 * Deprecated functions
111 */
112
113 /**
114 * Is doing ajax
115 *
116 * @since 2.3.4
117 */
118 function cac_is_doing_ajax() {
119 _deprecated_function( __FUNCTION__, '3.0' );
120
121 return AC()->table_screen()->get_list_screen_when_doing_quick_edit() || ( AC()->is_doing_ajax() && isset( $_REQUEST['list_screen'] ) );
122 }
123
124 /**
125 * Is WordPress doing ajax
126 *
127 * @since 2.5
128 */
129 function cac_wp_is_doing_ajax() {
130 _deprecated_function( __FUNCTION__, '3.0' );
131
132 return AC()->table_screen()->get_list_screen_when_doing_quick_edit();
133 }
134
135 /**
136 * Whether the current screen is the Admin Columns settings screen
137 *
138 * @since 2.4.8
139 *
140 * @param string $slug Specifies a page screen (optional)
141 *
142 * @return bool True if the current screen is the settings screen, false otherwise
143 */
144 function cac_is_setting_screen( $slug = '' ) {
145 _deprecated_function( __FUNCTION__, '3.0', 'AC()->admin()->is_current_page( $slug )' );
146
147 return AC()->admin()->is_current_page( $slug );
148 }
149
150 /**
151 * Returns true if the installed version of WooCommerce is version X or greater
152 *
153 * @since 2.3.4
154 * @deprecated 3.0
155 * @return boolean true if the installed version of WooCommerce is version X or greater
156 */
157 function cpac_is_wc_version_gte( $version = '1.0' ) {
158 _deprecated_function( __FUNCTION__, '3.0' );
159
160 return false;
161 }
162
163 /**
164 * @deprecated 3.0
165 * @return bool True when Admin Columns Pro plugin is activated.
166 */
167 function cpac_is_pro_active() {
168 _deprecated_function( __FUNCTION__, '3.0', 'ac_is_pro_active' );
169
170 return ac_is_pro_active();
171 }
172