PluginProbe ʕ •ᴥ•ʔ
Admin Columns / 3.0.2
Admin Columns v3.0.2
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
181 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, support documentation, 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', $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 * Returns row actions for the WP_List_Tables
92 *
93 * @return AC_Column_ActionColumnHelper
94 */
95 function ac_action_column_helper() {
96 return AC_Column_ActionColumnHelper::instance();
97 }
98
99 /**
100 * Manually set the columns for a list screen
101 * This overrides the database settings and thus renders the settings screen for this list screen useless
102 *
103 * If you like to register a column of your own please have a look at our documentation.
104 * We also have a free start-kit available, which contains all the necessary files.
105 *
106 * Documentation: https://www.admincolumns.com/documentation/developer-docs/creating-new-column-type/
107 * Starter-kit: https://github.com/codepress/ac-column-template/
108 *
109 * @since 2.2
110 *
111 * @param string|array $list_screen_key List screen key or keys
112 * @param array $column_data
113 */
114 function ac_register_columns( $list_screen_keys, $column_data ) {
115 AC()->api()->load_columndata( $list_screen_keys, $column_data );
116 }
117
118 /**
119 * Deprecated functions
120 */
121
122 /**
123 * Is doing ajax
124 *
125 * @since 2.3.4
126 */
127 function cac_is_doing_ajax() {
128 _deprecated_function( __FUNCTION__, '3.0' );
129
130 return AC()->table_screen()->get_list_screen_when_doing_quick_edit() || ( AC()->is_doing_ajax() && isset( $_REQUEST['list_screen'] ) );
131 }
132
133 /**
134 * Is WordPress doing ajax
135 *
136 * @since 2.5
137 */
138 function cac_wp_is_doing_ajax() {
139 _deprecated_function( __FUNCTION__, '3.0' );
140
141 return AC()->table_screen()->get_list_screen_when_doing_quick_edit();
142 }
143
144 /**
145 * Whether the current screen is the Admin Columns settings screen
146 *
147 * @since 2.4.8
148 *
149 * @param string $slug Specifies a page screen (optional)
150 *
151 * @return bool True if the current screen is the settings screen, false otherwise
152 */
153 function cac_is_setting_screen( $slug = '' ) {
154 _deprecated_function( __FUNCTION__, '3.0', 'AC()->admin()->is_current_page( $slug )' );
155
156 return AC()->admin()->is_current_page( $slug );
157 }
158
159 /**
160 * Returns true if the installed version of WooCommerce is version X or greater
161 *
162 * @since 2.3.4
163 * @deprecated 3.0
164 * @return boolean true if the installed version of WooCommerce is version X or greater
165 */
166 function cpac_is_wc_version_gte( $version = '1.0' ) {
167 _deprecated_function( __FUNCTION__, '3.0' );
168
169 return false;
170 }
171
172 /**
173 * @deprecated 3.0
174 * @return bool True when Admin Columns Pro plugin is activated.
175 */
176 function cpac_is_pro_active() {
177 _deprecated_function( __FUNCTION__, '3.0', 'ac_is_pro_active' );
178
179 return ac_is_pro_active();
180 }
181