get_route() ) ) { self::$quiet = true; } return $response; } /** * A post Stubli publishes: no subscriber email, no social sharing. * * @param string $new New status. * @param string $old Old status. * @param \WP_Post $post Post. */ public static function quiet_publish( $new, $old, $post ) { if ( ! self::$quiet || 'publish' !== $new || 'publish' === $old || 'post' !== $post->post_type ) { return; } update_post_meta( $post->ID, '_jetpack_dont_email_post_to_subs', 1 ); update_post_meta( $post->ID, 'jetpack_publicize_feature_enabled', false ); update_post_meta( $post->ID, '_wpas_done_all', 1 ); } /** * Jetpack asks whether to share a post that was just published. * * @param bool $should Share it. * @return bool */ public static function no_publicize( $should ) { return self::$quiet ? false : $should; } /** * @return string */ public static function disabled() { return 'disabled'; } /** * Dequeue Gravatar hovercards and Jetpack's tiled-gallery/carousel scripts on the front end. */ public static function drop_third_party_assets() { if ( is_admin() ) { return; } foreach ( array( 'grofiles-cards', 'wpgroho', 'jetpack-carousel', 'jetpack-carousel-swiper-css', 'tiled-gallery' ) as $handle ) { wp_dequeue_script( $handle ); wp_dequeue_style( $handle ); } wp_dequeue_style( 'gravatar-hovercards' ); } /** * Remove the Like and sharing output if the modules are already loaded. */ public static function drop_jetpack_modules() { remove_filter( 'the_content', 'sharing_display', 19 ); remove_filter( 'the_excerpt', 'sharing_display', 19 ); } }