summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury German <blueknight@gentoo.org>2017-01-24 23:51:34 -0500
committerYury German <blueknight@gentoo.org>2017-01-24 23:51:34 -0500
commit3c539a4713a80181af84c1fedc742436f75c92c4 (patch)
treee1896c286f3fb98337a6297465974c65f1fe8f26 /plugins/jetpack/sal
parentUpdate theme twentyfifteen to 1.7 (diff)
downloadblogs-gentoo-3c539a4713a80181af84c1fedc742436f75c92c4.tar.gz
blogs-gentoo-3c539a4713a80181af84c1fedc742436f75c92c4.tar.bz2
blogs-gentoo-3c539a4713a80181af84c1fedc742436f75c92c4.zip
updating jetpack plugin
Diffstat (limited to 'plugins/jetpack/sal')
-rw-r--r--plugins/jetpack/sal/class.json-api-site-base.php7
-rw-r--r--plugins/jetpack/sal/class.json-api-site-jetpack-base.php26
-rw-r--r--plugins/jetpack/sal/class.json-api-site-jetpack.php13
3 files changed, 27 insertions, 19 deletions
diff --git a/plugins/jetpack/sal/class.json-api-site-base.php b/plugins/jetpack/sal/class.json-api-site-base.php
index 531a4239..dea8cf91 100644
--- a/plugins/jetpack/sal/class.json-api-site-base.php
+++ b/plugins/jetpack/sal/class.json-api-site-base.php
@@ -1,12 +1,5 @@
<?php
-/*
- * WARNING: This file is distributed verbatim in Jetpack.
- * There should be nothing WordPress.com specific in this file.
- *
- * @hide-in-jetpack
- */
-
require_once dirname( __FILE__ ) . '/class.json-api-date.php';
require_once dirname( __FILE__ ) . '/class.json-api-post-base.php';
diff --git a/plugins/jetpack/sal/class.json-api-site-jetpack-base.php b/plugins/jetpack/sal/class.json-api-site-jetpack-base.php
index 10de82a3..ad40198e 100644
--- a/plugins/jetpack/sal/class.json-api-site-jetpack-base.php
+++ b/plugins/jetpack/sal/class.json-api-site-jetpack-base.php
@@ -119,6 +119,32 @@ abstract class Abstract_Jetpack_Site extends SAL_Site {
return $supported_formats;
}
+ function get_icon() {
+ $icon_id = get_option( 'site_icon' );
+ if ( empty( $icon_id ) ) {
+ $icon_id = Jetpack_Options::get_option( 'site_icon_id' );
+ }
+
+ if ( empty( $icon_id ) ) {
+ return null;
+ }
+
+ $icon = array_filter( array(
+ 'img' => wp_get_attachment_image_url( $icon_id, 'full' ),
+ 'ico' => wp_get_attachment_image_url( $icon_id, array( 16, 16 ) )
+ ) );
+
+ if ( empty( $icon ) ) {
+ return null;
+ }
+
+ if ( current_user_can( 'edit_posts', $icon_id ) ) {
+ $icon['media_id'] = (int) $icon_id;
+ }
+
+ return $icon;
+ }
+
/**
* Private methods
**/
diff --git a/plugins/jetpack/sal/class.json-api-site-jetpack.php b/plugins/jetpack/sal/class.json-api-site-jetpack.php
index 56edb000..74c97bab 100644
--- a/plugins/jetpack/sal/class.json-api-site-jetpack.php
+++ b/plugins/jetpack/sal/class.json-api-site-jetpack.php
@@ -55,7 +55,7 @@ class Jetpack_Site extends Abstract_Jetpack_Site {
}
function get_id() {
- return $this->platform->token->blog_id;
+ return $this->platform->token->blog_id;
}
function has_videopress() {
@@ -128,17 +128,6 @@ class Jetpack_Site extends Abstract_Jetpack_Site {
return get_bloginfo( 'language' );
}
- function get_icon() {
- if ( function_exists( 'get_site_icon_url' ) && function_exists( 'jetpack_photon_url' ) ) {
- return array(
- 'img' => (string) jetpack_photon_url( get_site_icon_url( 80, '', get_current_blog_id() ), array( 'w' => 80 ), 'https' ),
- 'ico' => (string) jetpack_photon_url( get_site_icon_url( 16, '', get_current_blog_id() ), array( 'w' => 16 ), 'https' ),
- );
- }
-
- return null;
- }
-
function is_jetpack() {
return true;
}