[wp-trac] [WordPress Trac] #45529: Can't Remove wp496_privacy From WP_Internal_Pointers

WordPress Trac noreply at wordpress.org
Mon Jan 14 05:06:38 UTC 2019


#45529: Can't Remove wp496_privacy From WP_Internal_Pointers
------------------------------------+------------------------------
 Reporter:  daleharrison            |       Owner:  garrett-eclipse
     Type:  defect (bug)            |      Status:  assigned
 Priority:  normal                  |   Milestone:  Future Release
Component:  Privacy                 |     Version:  4.9.8
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  docs
------------------------------------+------------------------------
Changes (by garrett-eclipse):

 * keywords:  close => has-patch dev-feedback
 * owner:  (none) => garrett-eclipse
 * focuses:  administration => docs
 * status:  new => assigned
 * milestone:  Awaiting Review => Future Release


Comment:

 Hi @daleharrison

 Looking into this I found two changes the snippet you and @swissspidy
 provided;
 1. Missing `pointer_` prefix on `pointer_wp496_privacy`, all
 WP_Internal_Pointers are called with a `pointer_` prefix on their
 add_action call.
 Code Reference -
 https://github.com/WordPress/WordPress/blob/56c162fbc9867f923862f64f1b4570d885f1ff03
 /wp-admin/includes/class-wp-internal-pointers.php#L89
 2. Seems the priority on the `admin_enqueue_scripts` add_action needs to
 be 11. I've found for `remove_action`'s it's always best to increment your
 priority by 1.

 Working code sample;
 {{{#!php
 <?php
 add_action(
   'admin_enqueue_scripts',
   function() {
     remove_action( 'admin_print_footer_scripts', array(
 'WP_Internal_Pointers', 'pointer_wp496_privacy' ) );
   },
   11
 );
 }}}
 *This works from functions.php in your theme, tested on twentynineteen.

 As well I passed this information to Luciano the dev of the plugin you
 mentioned as a PR with a working version of the above code.[[BR]]
 PR - https://github.com/luciano-croce/dismiss-privacy-nag/pull/1

 @swissspidy I added 45529.diff to update the inline phpdoc as the
 suggested code doesn't function as is.

 Thank you

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45529#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list