Overriding 'wp-content/plugins/dokan/classes/ajax.php' ?

  • Home
  • Forums
  • Dokan
  • Overriding 'wp-content/plugins/dokan/classes/ajax.php' ?
This topic contains 4 reply and 2 voices, and was last updated by towhid 8 years, 8 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
August 7, 2015 at 11:45 pm 65883
towhid Dear weDevs Sekander helpfully showed me how to override 'wp-content/plugins/dokan/templates/edit/attributes.php' by placing my custom version into 'wp-content/themes/dokan-child/dokan/edit/attributes.php' I notice that I must create a new 'dokan' folder inside my child theme folder and then follow the same path but remove 'templates'. I have found this works perfectly to override the dokan-plugin file with my custom file. However, I wish also to override 'wp-content/plugins/dokan/classes/ajax.php' with my own file in my 'dokan-child' theme. So far I have failed. What folder structure should I employ inside my 'dokan-child' theme? Kind regards David
August 8, 2015 at 5:58 pm 66001
towhid towhid

Hello David,

I will discuss about this with our developer team. Please allow me some time. Hope I will come back to you with a right solution.

Thanks

August 9, 2015 at 2:23 pm 66089
towhid towhid

Hello David,

You can only override the template folder’s files but nothing else.

wp-content/plugins/dokan/classes/ajax.php is root file. So you can not override.

Thanks

August 13, 2015 at 9:16 pm 66977
David David

Thank you Towhid

Is there a way I can override one of the functions within ‘wp-content/plugins/dokan/classes/ajax.php’ without hacking the code?

Specifically, I would like to override ‘function dokan_pre_define_attribute() {…}’ with my own version. I could simply type over the code in ‘wp-content/plugins/dokan/classes/ajax.php’. But this is not ideal since I would have to re-key my custom code after every Dokan update.

I would prefer to override through my child theme, ‘wp-content/themes/dokan-child’.

I have tried a function inside my child theme ‘functions.php’ but this is ignored.

Is there another way? Or must I hack the code in ‘ajax.php’?

Kind regards
David

August 16, 2015 at 12:57 pm 67262
towhid towhid

Hello David,

You must extend the class. If you do not know how to extend the class please hire a developer.

Thanks

Viewing 4 Posts - 1 through 4 (of 4 total)