Hot answers tagged

5 votes
Accepted

before_channel_entry_save hook

This was driving me insane but I've figured it out. You need to edit the $entry object (1st parameter of the function) in order for this to work. You can, however, use the 2nd parameter, $values, for ...
Kieran McClung's user avatar
2 votes

Get member id in ExpressionEngines session hook

First initial thought is: can you use sessions_end hook instead? Looking at the Session.php code for where the session_start is fired, this hook kicks in before the user data is set from the cookie/...
Peter Lewis's user avatar
  • 5,353
2 votes

Custom add-on accessing method from another custom add-on …

I agree with the advice provided by Brian in EECMS Slack. You can do this: require_once PATH_THIRD . 'your_addon/somefile.php' $someFile = new SomeFile(); $someFile->method();
Matt's user avatar
  • 1,232
2 votes
Accepted

Using the cp_custom_menu hook

The cp_custom_menu hook, although sounding like it will automatically add an item to the menu, in fact just adds your add-on as a new option when creating a custom menu via Settings -> Menu Manager ...
Derek Hogue's user avatar
  • 17.4k
2 votes
Accepted

Updating hooks from v2 to v4

There were certainly several extension hook changes with the arrival of EE3, possibly with EE4 too, so you may well need to update the naming of the hooks in your addon. You can find a complete list ...
JCOGS Design's user avatar
  • 3,587
1 vote

Expresso store : add on, hook store_order_complete_end creates order id+1

Using $this->extensions->last_call in the hook turned out to be redundant.
bart's user avatar
  • 21
1 vote
Accepted

How to get data from a hook?

At the end of hook "channel_form_submit_entry_end" it is using the Channel Form Class so $obj->entry['entry_id'] a class property which is not available. Good news is you can use the method $obj->...
James Raffield's user avatar
1 vote

Is there a way to get the member_id of a user that was just logged out?

Although the hook doesn't provide any information you can use, you could do a query on the exp_members table where ip_address is equal to the users ip, and sort the results by last_activity descending....
Matt Shearing's user avatar
1 vote

Hook when member updates password

These what you are after? It appears these are planned for conversion to services down the road. But should still work now. https://docs.expressionengine.com/latest/development/extension_hooks/...
Jim Wyse's user avatar
  • 1,987
1 vote

Using the cp_custom_menu hook

add this at the end of public function cp_menu_array($menu) { if ($this->EE->extensions->last_call !== FALSE) { $menu = $this->EE->extensions->...
Rogger S.'s user avatar
1 vote

Do something after hook

Well, you are killing the process when you throw a redirect. The redirect() function basically causes a die() affect, ending code termination. You know you can declare a redirect in the template with ...
jrothafer's user avatar
  • 5,900
1 vote
Accepted

How to use the SQL Manager to find which extensions use a certain hook?

Use this query... SELECT * FROM exp_extensions WHERE hook = 'hook_youre_looking_for'; The class column will indicate what Extension it belongs to, and the method column will tell you what method (...
jrothafer's user avatar
  • 5,900
1 vote

How to use the SQL Manager to find which extensions use a certain hook?

look in the exp_extensions table. you should find everything you need there
Jim Wyse's user avatar
  • 1,987
1 vote

Error on Postmaster Parcel or Hook save

What's the url of the the page that's getting the page not found error? Postmaster uses the domain you have specified in your config. This may be the problem. This is particularly true if you're using ...
Stephen's user avatar
  • 85

Only top scored, non community-wiki answers of a minimum length are eligible