[wp-meta] [Making WordPress.org] #7877: Share on Mastodon icon doesn't work

Making WordPress.org noreply at wordpress.org
Mon Jan 13 01:00:56 UTC 2025


#7877: Share on Mastodon icon doesn't work
--------------------------------------+---------------------
 Reporter:  sebastienserre            |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:
Component:  Make (Get Involved) / P2  |  Resolution:
 Keywords:  needs-patch 2nd-opinion   |
--------------------------------------+---------------------

Comment (by dd32):

 Replying to [comment:5 jeherve]:
 > Replying to [comment:4 dd32]:
 > > Given how long ago this change was, I think we can just hack this into
 the WordPress.org o2 implementation for now.
 >
 > If you're cool with that, that would be my vote.

 Let's just do that.

 I'm not sure what I'm doing wrong but the code I attempted to test this
 with just now doesn't work, and I'm not sure why.. If someone can point
 out my error, that'd be great.

 {{{
 function scripts() {
         // Jetpack Mastodon sharing fix. See
 https://meta.trac.wordpress.org/ticket/7877
         wp_add_inline_script(
                 'jquery-core',
                 "jQuery( 'body' ).on( 'post-load', function() {
                         var e = document.createEvent( 'CustomEvent' );
                         e.initCustomEvent( 'is.post-load', true, true,
 null );
                         document.body.dispatchEvent( e );
                 } );"
         );
 }
 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\scripts', 11 );
 }}}

 Also tried adding it in the `inline_scripts()` function directly on
 `wp_footer` and that didn't take. I'm not sure what I'm doing wrong, and
 don't have the time to debug it.

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/7877#comment:6>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list