3 * Deprecated functions from past YOURLS versions. Don't use them, as they may be
4 * removed in a later version. Use the newer alternatives instead.
6 * Note to devs: when deprecating a function, move it here. Then check all the places
7 * in core that might be using it, including core plugins.
11 * Return word or words if more than one
14 function yourls_plural( $word, $count=1 ) {
15 yourls_deprecated_function( __FUNCTION__, '1.6', 'yourls_n' );
16 return $word . ($count > 1 ? 's' : '');
20 * Return list of all shorturls associated to the same long URL. Returns NULL or array of keywords.
23 function yourls_get_duplicate_keywords( $longurl ) {
24 yourls_deprecated_function( __FUNCTION__, '1.7', 'yourls_get_longurl_keywords' );
25 if( !yourls_allow_duplicate_longurls() )
27 return yourls_apply_filter( 'get_duplicate_keywords', yourls_get_longurl_keywords ( $longurl ), $longurl );
31 * Make sure a integer is safe
33 * Note: this function is dumb and dumbly named since it does not intval(). DO NOT USE.
36 function yourls_intval( $in ) {
37 yourls_deprecated_function( __FUNCTION__, '1.7', 'yourls_sanitize_int' );
38 return yourls_escape( $in );
42 * Get remote content via a GET request using best transport available
45 function yourls_get_remote_content( $url, $maxlen = 4096, $timeout = 5 ) {
46 yourls_deprecated_function( __FUNCTION__, '1.7', 'yourls_http_get_body' );
47 return yourls_http_get_body( $url );
51 * Alias for yourls_apply_filter because I never remember if it's _filter or _filters
53 * At first I thought it made semantically more sense but thinking about it, I was wrong. It's one filter.
54 * There may be several function hooked into it, but it still the same one filter.
59 * @param string $hook the name of the YOURLS element or action
60 * @param mixed $value the value of the element before filtering
63 function yourls_apply_filters( $hook, $value = '' ) {
64 yourls_deprecated_function( __FUNCTION__, '1.7.1', 'yourls_apply_filter' );
65 return yourls_apply_filter( $hook, $value );
69 * Check if we'll need interface display function (ie not API or redirection)
72 function yourls_has_interface() {
73 yourls_deprecated_function( __FUNCTION__, '1.7.1' );
74 if( yourls_is_API() or yourls_is_GO() )
80 * Check if a proxy is defined for HTTP requests
85 * @return bool true if a proxy is defined, false otherwise
87 function yourls_http_proxy_is_defined() {
88 yourls_deprecated_function( __FUNCTION__, '1.7.1', 'yourls_http_get_proxy' );
89 return yourls_apply_filter( 'http_proxy_is_defined', defined( 'YOURLS_PROXY' ) );
93 * Displays translated string with gettext context
95 * This function has been renamed yourls_xe() for consistency with other *e() functions
101 * @param string $text Text to translate
102 * @param string $context Context information for the translators
103 * @param string $domain Optional. Domain to retrieve the translated text
104 * @return string Translated context string without pipe
106 function yourls_ex( $text, $context, $domain = 'default' ) {
107 yourls_deprecated_function( __FUNCTION__, '1.7.1', 'yourls_xe' );
108 echo yourls_xe( $text, $context, $domain );