css
1 month ago
docs
3 months ago
img
3 months ago
js
3 months ago
tabs
3 months ago
api.php
3 months ago
cleanup.php
3 months ago
colors.php
1 month ago
deprecated.php
3 months ago
header.php
3 months ago
helpers.php
1 month ago
index.php
3 months ago
menu.php
3 months ago
plugins-page.php
3 months ago
post-type-help-doc-imports.php
3 months ago
post-type-help-docs.php
1 month ago
shortcodes.php
1 month ago
taxonomy-folders.php
3 months ago
deprecated.php
226 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Functions that can be used globally. |
| 4 | */ |
| 5 | |
| 6 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 7 | |
| 8 | |
| 9 | /** |
| 10 | * Check if a user has a role |
| 11 | * |
| 12 | * @deprecated Only used for access control, which now uses Helpers::user_can_edit() and Helpers::user_can_view() |
| 13 | * @return void |
| 14 | */ |
| 15 | function helpdocs_has_role() { |
| 16 | _deprecated_function( __FUNCTION__, '2.0', 'Use Helpers::user_can_edit() or Helpers::user_can_view() instead.' ); |
| 17 | return false; |
| 18 | } // End helpdocs_has_role() |
| 19 | |
| 20 | |
| 21 | /** |
| 22 | * Check if a user has permission to add/edit help sections |
| 23 | * |
| 24 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::user_can_edit() instead. |
| 25 | * @return bool |
| 26 | */ |
| 27 | function helpdocs_user_can_edit( $user_id = null ) { |
| 28 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::user_can_edit() instead.' ); |
| 29 | return \PluginRx\AdminHelpDocs\Helpers::user_can_edit( $user_id ); |
| 30 | } // End helpdocs_user_can_edit() |
| 31 | |
| 32 | |
| 33 | /** |
| 34 | * Check if a user has permission to view help sections |
| 35 | * |
| 36 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::user_can_view() instead. |
| 37 | * @return bool |
| 38 | */ |
| 39 | function helpdocs_user_can_view( $user_id = null ) { |
| 40 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::user_can_view() instead.' ); |
| 41 | return \PluginRx\AdminHelpDocs\Helpers::user_can_view( null, $user_id ); |
| 42 | } // End helpdocs_user_can_view() |
| 43 | |
| 44 | |
| 45 | /** |
| 46 | * Get current URL with query string |
| 47 | * |
| 48 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::get_current_url() instead. |
| 49 | * @return string |
| 50 | */ |
| 51 | function helpdocs_get_current_url( $params = true, $domain = true ) { |
| 52 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::get_current_url() instead.' ); |
| 53 | return \PluginRx\AdminHelpDocs\Helpers::get_current_url( $params, $domain ); |
| 54 | } // End helpdocs_get_current_url() |
| 55 | |
| 56 | |
| 57 | /** |
| 58 | * Get current admin URL with query string |
| 59 | * |
| 60 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::get_current_admin_url() instead. |
| 61 | * @param bool $params Whether to include query parameters in the returned URL |
| 62 | * @return string |
| 63 | */ |
| 64 | function helpdocs_get_current_admin_url( $params = true ) { |
| 65 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::get_current_admin_url() instead.' ); |
| 66 | return \PluginRx\AdminHelpDocs\Helpers::get_current_admin_url( $params ); |
| 67 | } // End helpdocs_get_current_admin_url() |
| 68 | |
| 69 | |
| 70 | /** |
| 71 | * Check if two urls match while ignoring order of params |
| 72 | * Also allow ignoring addtional params that $url1 has that $url2 does not |
| 73 | * |
| 74 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::do_urls_match() instead. |
| 75 | * @param string $url1 |
| 76 | * @param string $url2 |
| 77 | * @param bool $ignore_addt_params |
| 78 | * @return bool |
| 79 | */ |
| 80 | function helpdocs_do_urls_match( $url1, $url2, $ignore_addt_params = true ) { |
| 81 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::do_urls_match() instead.' ); |
| 82 | return \PluginRx\AdminHelpDocs\Helpers::do_urls_match( $url1, $url2, $ignore_addt_params ); |
| 83 | } // End helpdocs_do_urls_match() |
| 84 | |
| 85 | |
| 86 | /** |
| 87 | * Base64 Encoding |
| 88 | * |
| 89 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::base64url_encode() instead. |
| 90 | * @param $data |
| 91 | * @return string |
| 92 | */ |
| 93 | function helpdocs_base64url_encode( $data ) { |
| 94 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::base64url_encode() instead.' ); |
| 95 | return \PluginRx\AdminHelpDocs\Helpers::base64url_encode( $data ); |
| 96 | } // End helpdocs_base64url_encode() |
| 97 | |
| 98 | |
| 99 | /** |
| 100 | * Base64 Decoding |
| 101 | * |
| 102 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::base64url_decode() instead. |
| 103 | * @param $data |
| 104 | * @return string |
| 105 | */ |
| 106 | function helpdocs_base64url_decode( $data ) { |
| 107 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::base64url_decode() instead.' ); |
| 108 | return \PluginRx\AdminHelpDocs\Helpers::base64url_decode( $data ); |
| 109 | } // End helpdocs_base64url_decode() |
| 110 | |
| 111 | |
| 112 | /** |
| 113 | * Remove query strings from url without refresh |
| 114 | * |
| 115 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::remove_qs_without_refresh() instead. |
| 116 | * @param string|array $qs Query string(s) to remove |
| 117 | * @param bool $is_admin Whether the URL is an admin URL (defaults to true) |
| 118 | * @return void |
| 119 | */ |
| 120 | function helpdocs_remove_qs_without_refresh( $qs = null, $is_admin = true ) { |
| 121 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::remove_qs_without_refresh() instead.' ); |
| 122 | return \PluginRx\AdminHelpDocs\Helpers::remove_qs_without_refresh( $qs, $is_admin ); |
| 123 | } // End helpdocs_remove_qs_without_refresh() |
| 124 | |
| 125 | |
| 126 | /** |
| 127 | * Add a query string from url without refresh |
| 128 | * |
| 129 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::add_qs_without_refresh() instead. |
| 130 | * @param string|array $qs Query string(s) to add |
| 131 | * @param string|array $value Value(s) for the query string(s) |
| 132 | * @return void |
| 133 | */ |
| 134 | function helpdocs_add_qs_without_refresh( $qs, $value ) { |
| 135 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::add_qs_without_refresh() instead.' ); |
| 136 | return \PluginRx\AdminHelpDocs\Helpers::add_qs_without_refresh( $qs, $value ); |
| 137 | } // End helpdocs_add_qs_without_refresh() |
| 138 | |
| 139 | |
| 140 | /** |
| 141 | * Convert timezone |
| 142 | * |
| 143 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::convert_timezone() instead. |
| 144 | * @return string |
| 145 | */ |
| 146 | function helpdocs_convert_timezone( $date = null, $format = 'F j, Y g:i A T', $timezone = null ) { |
| 147 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::convert_timezone() instead.' ); |
| 148 | return \PluginRx\AdminHelpDocs\Helpers::convert_timezone( $date, $format, $timezone ); |
| 149 | } // End helpdocs_convert_timezone() |
| 150 | |
| 151 | |
| 152 | /** |
| 153 | * Simplified/sanitized version of $_GET |
| 154 | * |
| 155 | * @deprecated Use $_GET[] directly instead. |
| 156 | * @return false |
| 157 | */ |
| 158 | function helpdocs_get() { |
| 159 | _deprecated_function( __FUNCTION__, '2.0', 'Use $_GET[] instead.' ); |
| 160 | return false; |
| 161 | } // End helpdocs_get() |
| 162 | |
| 163 | |
| 164 | /** |
| 165 | * Click to Copy |
| 166 | * |
| 167 | * @deprecated |
| 168 | * @return string |
| 169 | */ |
| 170 | function helpdocs_click_to_copy() { |
| 171 | _deprecated_function( __FUNCTION__, '2.0', 'This function is deprecated and no longer available.' ); |
| 172 | return ''; |
| 173 | } // End helpdocs_click_to_copy() |
| 174 | |
| 175 | |
| 176 | /** |
| 177 | * Get contrast color (black or white) from hex color |
| 178 | * |
| 179 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::get_contrast_color() instead. |
| 180 | * @param string $hexColor |
| 181 | * @return string |
| 182 | */ |
| 183 | function helpdocs_get_contrast_color( $hexColor ) { |
| 184 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::get_contrast_color() instead.' ); |
| 185 | return \PluginRx\AdminHelpDocs\Helpers::get_contrast_color( $hexColor ); |
| 186 | } // End helpdocs_get_contrast_color() |
| 187 | |
| 188 | |
| 189 | /** |
| 190 | * Get just the domain without the https:// |
| 191 | * Option to capitalize the first part |
| 192 | * |
| 193 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::get_domain() instead. |
| 194 | * @param bool $capitalize Whether to capitalize the domain name |
| 195 | * @param bool $remove_ext Whether to remove the domain extension (e.g. .com) |
| 196 | * @return string |
| 197 | */ |
| 198 | function helpdocs_get_domain( $capitalize = false, $remove_ext = false ) { |
| 199 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::get_domain() instead.' ); |
| 200 | return \PluginRx\AdminHelpDocs\Helpers::get_domain( $capitalize, $remove_ext ); |
| 201 | } // End helpdocs_get_domain() |
| 202 | |
| 203 | |
| 204 | /** |
| 205 | * Check if the admin page is using gutenberg editor |
| 206 | * |
| 207 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::is_gutenberg() instead. |
| 208 | * @return boolean |
| 209 | */ |
| 210 | function is_gutenberg() { |
| 211 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::is_gutenberg() instead.' ); |
| 212 | return \PluginRx\AdminHelpDocs\Helpers::is_gutenberg(); |
| 213 | } // End is_gutenberg() |
| 214 | |
| 215 | |
| 216 | /** |
| 217 | * Convert time to elapsed string |
| 218 | * |
| 219 | * @deprecated Use \PluginRx\AdminHelpDocs\Helpers::time_elapsed_string() instead. |
| 220 | * @param string $datetime |
| 221 | * @return string |
| 222 | */ |
| 223 | function helpdocs_time_elapsed_string( $datetime ) { |
| 224 | _deprecated_function( __FUNCTION__, '2.0', 'Use \PluginRx\AdminHelpDocs\Helpers::time_elapsed_string() instead.' ); |
| 225 | return \PluginRx\AdminHelpDocs\Helpers::time_elapsed_string( $datetime ); |
| 226 | } // End helpdocs_time_elapsed_string() |