Skip to content

Tag: plugins

WordPress custom endpoint – rest_invalid_handler

I am completely new with PHP and WordPress, however I start to write my first plugin that should be able to expose a custom endpoint. I managed to register and activate the plugin and the route, but when I am trying to access this endpoint I am getting the following error: If I access the: http://localhost/my…

Function get_plugins() cannot be execute

I’m trying to code simple php script which will return all plugins of WordPress. My code: And my output is: I used official example from: https://codex.wordpress.org/Function_Reference/get_plugins I did: change of PHP version from 7.2 to 5.6 set right permission of files install WordPres once again So m…

How to use custom exception from cakephp plugin?

I have some custom exception for my application. I placed them to app where it is running well. Now I want to move them to one of my plugin and use exception from their. I have implemented custom exception as mentioned here: http://book.cakephp.org/2.0/en/development/exceptions.html But, I am looking for same…

How can I call a WordPress shortcode within a template?

There’s a plugin for the Contact us form. To activate the form, all you have to do is to place [CONTACT-US-FORM] in the page… My page is calling a page template. Is it possible to add the [CONTACT-US-FORM] shortcode in the PHP template? I tried it and it did not work. The WordPress page worked, bu…

PHP – Uploading multiple files

I’m working on a plugin for wordpress and I want to be able to upload multiple pictures from a form. Right now when I have a form for two pictures and submit it empty, my $_FILES array looks like this: Now the problem is that I want to use wordpress’ upload handler, wp_handle_upload. It expects th…