diff options
Diffstat (limited to 'plugins/jetpack/modules/sharedaddy/sharing.php')
-rw-r--r-- | plugins/jetpack/modules/sharedaddy/sharing.php | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/plugins/jetpack/modules/sharedaddy/sharing.php b/plugins/jetpack/modules/sharedaddy/sharing.php index f6a6bebd..c6f57436 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing.php +++ b/plugins/jetpack/modules/sharedaddy/sharing.php @@ -1,12 +1,11 @@ <?php +if ( ! defined( 'WP_SHARING_PLUGIN_URL' ) ) { + define( 'WP_SHARING_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); + define( 'WP_SHARING_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); +} class Sharing_Admin { public function __construct() { - if ( ! defined( 'WP_SHARING_PLUGIN_URL' ) ) { - define( 'WP_SHARING_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); - define( 'WP_SHARING_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); - } - require_once WP_SHARING_PLUGIN_DIR . 'sharing-service.php'; add_action( 'admin_init', array( &$this, 'admin_init' ) ); @@ -32,7 +31,16 @@ class Sharing_Admin { array( 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-form' ), 2 ); - $postfix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; + + /** + * Filters the switch that if set to true allows Jetpack to use minified assets. Defaults to true + * if the SCRIPT_DEBUG constant is not set or set to false. The filter overrides it. + * + * @since 6.2.0 + * + * @param boolean $var should Jetpack use minified assets. + */ + $postfix = apply_filters( 'jetpack_should_use_minified_assets', true ) ? '.min' : ''; if ( is_rtl() ) { wp_enqueue_style( 'sharing-admin', WP_SHARING_PLUGIN_URL . 'admin-sharing-rtl' . $postfix . '.css', false, JETPACK__VERSION ); } else { @@ -422,7 +430,7 @@ class Sharing_Admin { </table> <p class="submit"> - <input type="submit" name="submit" class="button-primary" value="<?php _e( 'Save Changes', 'jetpack' ); ?>" /> + <input type="submit" name="submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes', 'jetpack' ); ?>" /> </p> <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'sharing-options' );?>" /> @@ -457,7 +465,7 @@ class Sharing_Admin { <tr valign="top" width="100"> <th scope="row"></th> <td> - <input type="submit" class="button-primary" value="<?php _e( 'Create Share Button', 'jetpack' ); ?>" /> + <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Create Share Button', 'jetpack' ); ?>" /> <img src="<?php echo admin_url( 'images/loading.gif' ); ?>" width="16" height="16" alt="loading" style="vertical-align: middle; display: none" /> </td> </tr> |