| @@ 812-822 (lines=11) @@ | ||
| 809 | * |
|
| 810 | * @return bool true if successful, false otherwise |
|
| 811 | */ |
|
| 812 | function delete_transient( $transient ) { |
|
| 813 | if ( is_multisite() && ! is_main_site() ) { |
|
| 814 | switch_to_blog( $this->get_main_blog_id() ); |
|
| 815 | $return = delete_transient( $transient ); |
|
| 816 | restore_current_blog(); |
|
| 817 | ||
| 818 | return $return; |
|
| 819 | } |
|
| 820 | ||
| 821 | return delete_transient( $transient ); |
|
| 822 | } |
|
| 823 | ||
| 824 | /** |
|
| 825 | * Wrapper for WordPress get_transient function, our version gets |
|
| @@ 832-842 (lines=11) @@ | ||
| 829 | * |
|
| 830 | * @return mixed Value of transient. |
|
| 831 | */ |
|
| 832 | function get_transient( $transient ) { |
|
| 833 | if ( is_multisite() && ! is_main_site() ) { |
|
| 834 | switch_to_blog( $this->get_main_blog_id() ); |
|
| 835 | $return = get_transient( $transient ); |
|
| 836 | restore_current_blog(); |
|
| 837 | ||
| 838 | return $return; |
|
| 839 | } |
|
| 840 | ||
| 841 | return get_transient( $transient ); |
|
| 842 | } |
|
| 843 | ||
| 844 | function get_api_host() { |
|
| 845 | if ( isset( $this->api_endpoint ) ) { |
|