diff options
author | Theo Chatzimichos <tampakrap@gentoo.org> | 2013-10-03 21:53:38 +0200 |
---|---|---|
committer | Theo Chatzimichos <tampakrap@gentoo.org> | 2013-10-03 21:53:38 +0200 |
commit | 61f7269ffabd11b7de56507c69191be42d7cfa60 (patch) | |
tree | 2ad81bec8d0c124019b23c841d80882c303801bc /plugins/jetpack/modules/likes.php | |
parent | forgot to include new files of jetpack (diff) | |
download | blogs-gentoo-61f7269ffabd11b7de56507c69191be42d7cfa60.tar.gz blogs-gentoo-61f7269ffabd11b7de56507c69191be42d7cfa60.tar.bz2 blogs-gentoo-61f7269ffabd11b7de56507c69191be42d7cfa60.zip |
update jetpack
Diffstat (limited to 'plugins/jetpack/modules/likes.php')
-rw-r--r-- | plugins/jetpack/modules/likes.php | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/plugins/jetpack/modules/likes.php b/plugins/jetpack/modules/likes.php index ab8b7b7a..24e83ae2 100644 --- a/plugins/jetpack/modules/likes.php +++ b/plugins/jetpack/modules/likes.php @@ -5,6 +5,7 @@ * First Introduced: 2.2 * Sort Order: 4 * Requires Connection: Yes + * Auto Activate: No */ class Jetpack_Likes { var $version = '20130620a'; @@ -520,11 +521,11 @@ class Jetpack_Likes { .fixed .column-likes .post-com-count { background-image: none; } .fixed .column-likes .comment-count { background-color: #888; } .fixed .column-likes .comment-count:hover { background-color: #D54E21; } - .admin-color-mp6 .fixed .column-likes .post-com-count::after { border: none !important; } - .admin-color-mp6 .fixed .column-likes .comment-count { background-color: #bbb; } - .admin-color-mp6 .fixed .column-likes .comment-count:hover { background-color: #2ea2cc; } - .admin-color-mp6 .fixed .column-likes .vers img { display: none; } - .admin-color-mp6 .fixed .column-likes .vers:before {font:20px/1 dashicons;content: '\f155';-webkit-font-smoothing:antialiased;} + .mp6 .fixed .column-likes .post-com-count::after { border: none !important; } + .mp6 .fixed .column-likes .comment-count { background-color: #bbb; } + .mp6 .fixed .column-likes .comment-count:hover { background-color: #2ea2cc; } + .mp6 .fixed .column-likes .vers img { display: none; } + .mp6 .fixed .column-likes .vers:before {font:20px/1 dashicons;content: '\f155';-webkit-font-smoothing:antialiased;} </style> <?php } @@ -533,10 +534,14 @@ class Jetpack_Likes { */ function enqueue_admin_scripts() { if ( empty( $_GET['post_type'] ) || 'post' == $_GET['post_type'] || 'page' == $_GET['post_type'] ) { - if ( $this->in_jetpack ) + if ( $this->in_jetpack ) { wp_enqueue_script( 'likes-post-count', plugins_url( 'modules/likes/post-count.js', dirname( __FILE__ ) ), array( 'jquery' ), JETPACK__VERSION ); - else + wp_enqueue_script( 'likes-post-count-jetpack', plugins_url( 'modules/likes/post-count-jetpack.js', dirname( __FILE__ ) ), array( 'likes-post-count' ), JETPACK__VERSION ); + } else { + wp_enqueue_script( 'jquery.wpcom-proxy-request', "/wp-content/js/jquery/jquery.wpcom-proxy-request.js", array('jquery'), NULL, true ); wp_enqueue_script( 'likes-post-count', plugins_url( 'likes/post-count.js', dirname( __FILE__ ) ), array( 'jquery' ), JETPACK__VERSION ); + wp_enqueue_script( 'likes-post-count-wpcom', plugins_url( 'likes/post-count-wpcom.js', dirname( __FILE__ ) ), array( 'likes-post-count', 'jquery.wpcom-proxy-request' ), JETPACK__VERSION ); + } } } @@ -552,8 +557,7 @@ class Jetpack_Likes { if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { $blog_id = get_current_blog_id(); } else { - $jetpack = Jetpack::init(); - $blog_id = $jetpack->get_option( 'id' ); + $blog_id = Jetpack_Options::get_option( 'id' ); } $permalink = get_permalink( get_the_ID() ); ?> @@ -586,17 +590,12 @@ class Jetpack_Likes { if ( ! $this->is_likes_visible() ) return $content; - $protocol = 'http'; - if ( is_ssl() ) - $protocol = 'https'; - if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { $blog_id = get_current_blog_id(); $bloginfo = get_blog_details( (int) $blog_id ); $domain = $bloginfo->domain; } else { - $jetpack = Jetpack::init(); - $blog_id = $jetpack->get_option( 'id' ); + $blog_id = Jetpack_Options::get_option( 'id' ); $url = home_url(); $url_parts = parse_url( $url ); $domain = $url_parts['host']; @@ -610,7 +609,7 @@ class Jetpack_Likes { */ $uniqid = uniqid(); - $src = sprintf( '%1$s://widgets.wp.com/likes/#blog_id=%2$d&post_id=%3$d&origin=%1$s://%4$s&obj_id=%2$d-%3$d-%5$s', $protocol, $blog_id, $post->ID, $domain, $uniqid ); + $src = sprintf( '//widgets.wp.com/likes/#blog_id=%1$d&post_id=%2$d&origin=%3$s&obj_id=%1$d-%2$d-%4$s', $blog_id, $post->ID, $domain, $uniqid ); $name = sprintf( 'like-post-frame-%1$d-%2$d-%3$s', $blog_id, $post->ID, $uniqid ); $wrapper = sprintf( 'like-post-wrapper-%1$d-%2$d-%3$s', $blog_id, $post->ID, $uniqid ); @@ -638,8 +637,7 @@ class Jetpack_Likes { $bloginfo = get_blog_details( (int) $blog_id ); $domain = $bloginfo->domain; } else { - $jetpack = Jetpack::init(); - $blog_id = $jetpack->get_option( 'id' ); + $blog_id = Jetpack_Options::get_option( 'id' ); $url = home_url(); $url_parts = parse_url( $url ); $domain = $url_parts['host']; @@ -678,8 +676,7 @@ class Jetpack_Likes { $bloginfo = get_blog_details( (int) $blog_id ); $domain = $bloginfo->domain; } else { - $jetpack = Jetpack::init(); - $blog_id = $jetpack->get_option( 'id' ); + $blog_id = Jetpack_Options::get_option( 'id' ); $url = home_url(); $url_parts = parse_url( $url ); $domain = $url_parts['host']; @@ -1029,6 +1026,11 @@ class Jetpack_Likes { } } + // Check that the post is a public, published post. + if ( 'publish' != $post->post_status ) { + $enabled = false; + } + // Run through the sharing filters $enabled = apply_filters( 'sharing_show', $enabled, $post ); |