Initial Commit

This commit is contained in:
Rumperuu 2018-03-21 18:19:20 +00:00
parent 4c352bf02e
commit 1ab6e5f0b0
1085 changed files with 195258 additions and 0 deletions

12
plugins/jetpack/3rd-party/3rd-party.php vendored Normal file
View file

@ -0,0 +1,12 @@
<?php
/*
* Placeholder to load 3rd party plugin tweaks until a legit system
* is architected
*/
require_once( JETPACK__PLUGIN_DIR . '3rd-party/buddypress.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/wpml.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/bitly.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/bbpress.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/woocommerce.php' );

28
plugins/jetpack/3rd-party/bbpress.php vendored Normal file
View file

@ -0,0 +1,28 @@
<?php
add_action( 'init', 'jetpack_bbpress_compat', 11 ); // Priority 11 needed to ensure sharing_display is loaded.
/**
* Adds Jetpack + bbPress Compatibility filters.
*
* @author Brandon Kraft
* @since 3.7.1
*/
function jetpack_bbpress_compat() {
if ( function_exists( 'sharing_display' ) ) {
add_filter( 'bbp_get_topic_content', 'sharing_display', 19 );
add_action( 'bbp_template_after_single_forum', 'jetpack_sharing_bbpress' );
add_action( 'bbp_template_after_single_topic', 'jetpack_sharing_bbpress' );
}
}
/**
* Display Jetpack "Sharing" buttons on bbPress 2.x forums/ topics/ lead topics/ replies.
*
* Determination if the sharing buttons should display on the post type is handled within sharing_display().
*
* @author David Decker
* @since 3.7.0
*/
function jetpack_sharing_bbpress() {
sharing_display( null, true );
}

29
plugins/jetpack/3rd-party/bitly.php vendored Normal file
View file

@ -0,0 +1,29 @@
<?php
/*
* Fixes issues with the Official Bitly for WordPress
* http://wordpress.org/plugins/bitly/
*/
if( class_exists( 'Bitly' ) ) {
if( isset( $GLOBALS['bitly'] ) ) {
remove_action( 'wp_head', array( $GLOBALS['bitly'], 'og_tags' ) );
add_action( 'wp_head', 'jetpack_bitly_og_tag', 100 );
}
}
/**
* jetpack_bitly_og_tag
*
* @return null
*/
function jetpack_bitly_og_tag() {
if( has_filter( 'wp_head', 'jetpack_og_tags') === false ) {
// Add the bitly part again back if we don't have any jetpack_og_tags added
$GLOBALS['bitly']->og_tags();
} elseif ( isset( $GLOBALS['posts'] ) && $GLOBALS['posts'][0]->ID > 0 ) {
printf( "<meta property=\"bitly:url\" content=\"%s\" /> \n", esc_attr( $GLOBALS['bitly']->get_bitly_link_for_post_id( $GLOBALS['posts'][0]->ID ) ) );
}
}

View file

@ -0,0 +1,9 @@
<?php
add_filter( 'bp_core_pre_avatar_handle_upload', 'blobphoto' );
function blobphoto( $bool ) {
add_filter( 'jetpack_photon_skip_image', '__return_true' );
return $bool;
}

View file

@ -0,0 +1,14 @@
<?php
add_action( 'woocommerce_share', 'jetpack_woocommerce_social_share_icons', 10 );
/*
* Make sure the social sharing icons show up under the product's short description
*/
function jetpack_woocommerce_social_share_icons() {
if ( function_exists( 'sharing_display' ) ) {
remove_filter( 'the_content', 'sharing_display', 19 );
remove_filter( 'the_excerpt', 'sharing_display', 19 );
echo sharing_display();
}
}

35
plugins/jetpack/3rd-party/wpml.php vendored Normal file
View file

@ -0,0 +1,35 @@
<?php
// Only load these if WPML is active.
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) :
add_action( 'jetpack_widget_get_top_posts', 'wpml_jetpack_widget_get_top_posts', 10, 3 );
function wpml_jetpack_widget_get_top_posts( $posts, $post_ids, $count ) {
global $sitepress;
foreach ( $posts as $k => $post ) {
$lang_information = wpml_get_language_information( $post['post_id'] );
$post_language = substr( $lang_information['locale'], 0, 2 );
if ( $post_language !== $sitepress->get_current_language() ) {
unset( $posts[ $k ] );
}
}
return $posts;
}
add_filter( 'grunion_contact_form_field_html', 'grunion_contact_form_field_html_filter', 10, 3 );
function grunion_contact_form_field_html_filter( $r, $field_label, $id ){
global $sitepress;
if ( function_exists( 'icl_translate' ) ) {
if ( $sitepress->get_current_language() !== $sitepress->get_default_language() ) {
$label_translation = icl_translate( 'jetpack ', $field_label . '_label', $field_label );
$r = str_replace( $field_label, $label_translation, $r );
}
}
return $r;
}
endif;