summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2016-07-28 23:29:30 -0400
committerAnthony G. Basile <blueness@gentoo.org>2016-07-28 23:29:30 -0400
commit5c4552fad98db23b2698e8a598bf20f42cb430ef (patch)
tree61fc1f692646288704376f32d914eeef152e375e /plugins/jetpack/modules/publicize/ui.php
parentUpdate plugin jecpack to 4.0.4 (diff)
downloadblogs-gentoo-5c4552fad98db23b2698e8a598bf20f42cb430ef.tar.gz
blogs-gentoo-5c4552fad98db23b2698e8a598bf20f42cb430ef.tar.bz2
blogs-gentoo-5c4552fad98db23b2698e8a598bf20f42cb430ef.zip
Update plugin jetpack to 4.1.1
Diffstat (limited to 'plugins/jetpack/modules/publicize/ui.php')
-rw-r--r--plugins/jetpack/modules/publicize/ui.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/jetpack/modules/publicize/ui.php b/plugins/jetpack/modules/publicize/ui.php
index 92551f1b..4f918739 100644
--- a/plugins/jetpack/modules/publicize/ui.php
+++ b/plugins/jetpack/modules/publicize/ui.php
@@ -23,7 +23,17 @@ class Publicize_UI {
function init() {
// Show only to users with the capability required to manage their Publicize connections.
- if ( ! current_user_can( 'publish_posts' ) ) {
+ /**
+ * Filter what user capability is required to use the publicize form on the edit post page. Useful if publish post capability has been removed from role.
+ *
+ * @module publicize
+ *
+ * @since 4.1.0
+ *
+ * @param string $capability User capability needed to use publicize
+ */
+ $capability = apply_filters( 'jetpack_publicize_capability', 'publish_posts' );
+ if ( ! current_user_can( $capability ) ) {
return;
}
@@ -312,7 +322,7 @@ class Publicize_UI {
<script type="text/javascript">
jQuery( function($) {
var wpasTitleCounter = $( '#wpas-title-counter' ),
- wpasTwitterCheckbox = $( '.wpas-submit-twitter' ).size(),
+ wpasTwitterCheckbox = $( '.wpas-submit-twitter' ).length,
wpasTitle = $('#wpas-title').keyup( function() {
var length = wpasTitle.val().length;
wpasTitleCounter.text( length );
@@ -338,7 +348,7 @@ jQuery( function($) {
$('#publicize-form').slideDown( 'fast', function() {
wpasTitle.focus();
if ( !wpasTitle.text() ) {
- var url = $('#shortlink').size() ? $('#shortlink').val() : '';
+ var url = $('#shortlink').length ? $('#shortlink').val() : '';
var defaultMessage = $.trim( '<?php printf( $default_prefix, 'url' ); printf( $default_message, '$("#title").val()', 'url' ); printf( $default_suffix, 'url' ); ?>' );