Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #38048


Ignore:
Timestamp:
09/14/2016 01:10:52 AM (8 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #38048

    • Property Focuses ui accessibility administration removed
    • Property Component changed from General to Plugins
  • Ticket #38048 – Description

    initial v1  
    55
    66Wishlist adds a function to the list of hooks for wp_login in its main file wpm.php like so
    7  add_action('wp_login', array(&$WishListMemberInstance, 'Login'));
    8 
     7{{{
     8add_action('wp_login', array(&$WishListMemberInstance, 'Login'));
     9}}}
    910I turned off all plugins that were not needed for this and only kept the required ones, e.g. wishlist. woocommerce e.g.
    1011
    1112I put a line at the end of my functions.php with a marker file like so:
     13{{{
    1214add_action('wp', function(){ error_log("HERE_HERE_HERE_HERE"); error_log(print_r($GLOBALS['wp_filter']['wp_login'],1)); exit; } );
    13 
     15}}}
    1416I then basically accessed the "my_account" page.
    15 The php log file did NOT show an entry of wishlist in the wp_login action hook array.
     17The php log file did NOT show an entry of wishlist in the `wp_login` action hook array.
    1618
    1719I then disabled every action hook for wp_login, even mine.
    18 The php log file STILL did NOT show an entry of wishlist in the wp_login action hook array.
     20The php log file STILL did NOT show an entry of wishlist in the `wp_login` action hook array.
    1921
    2022Then I changed in the file wpm.php from
    21   add_action('wp_login', array(&$WishListMemberInstance, 'Login'));
     23{{{
     24add_action('wp_login', array(&$WishListMemberInstance, 'Login'));
     25}}}
    2226to
    23   add_action('wp_login', array(&$WishListMemberInstance, 'Login'),20,2);
     27{{{
     28add_action('wp_login', array(&$WishListMemberInstance, 'Login'),20,2);
     29}}}
    2430
    2531and sure enough it showed up, and the login time for the members changed.
     
    2834
    2935So is this a bug?
    30 Is this because of the sheer size of &$WishListMemberInstance that add_action does not want to do it?
     36Is this because of the sheer size of `&$WishListMemberInstance` that add_action does not want to do it?
    3137
    32 However, just before the class definition of WishlistMember I added a function called "MyTestFunction" and replaced the "array(&$WishListMemberInstance,'Login')" with 'MyTestFunction' and looked at the debug output and sure enough the function was added to the list of wp_login hooks.
     38However, just before the class definition of WishlistMember I added a function called `MyTestFunction` and replaced the `array(&$WishListMemberInstance,'Login')` with `MyTestFunction` and looked at the debug output and sure enough the function was added to the list of wp_login hooks.
    3339
    3440I added a ticket to wishlist as well.