Elgg: File upload plugin hook? - elgg

I'm looking to use the File plugin to upload the files needed by the plugin I'm developing. I'd just add a specific tag to the files uploaded from my plugin, thanks to a hook.
At least that's how I wanted things to work, but I can't find any hook that would help me do that, so here comes my question:
Is there a plugin hook I could use to modify a file being uploaded using /mod/file?
If there isn't, I'd be glad to hear about any other way I could achieve what I want.

Sorry, I didnt understand your requirements correctly.
If you want to upload a file through a different plugin, use the core file upload action with in your plugin's upload action. You can then listen to an object create event and then add necessary metadata with the uploaded file.

Related

I am trying to edit index-slider.php file in busiprof theme, but it doesn't change anything

I am trying to edit index-slider.php file in busiprof theme, when I am done with changes and saved it but when i am reloading my page on the website it doesn't change, actually I tried removing some of the classes to check it's working or not but nothing has happened, What should I do? Please help
Are you trying to change the file from admin panel or using FTP or file manager?
Please user FTP or File Manager and then please check the file permission as well then try clear cache if any caching plugin installed

Upload a data file to ftp server

I am creating a jspdf. In that, I want to use an image. The data code of image is too long and occupies a lot of space. I want to upload it to my ftp server through filezilla and use that data code in my jspdf code through wordpress. I can upload it on my ftp server but when I open the page in which the code is used, it asks for username and password. How can I make it public?
WordPress and other similar CMS works differently when it comes to the headers and dependencies. You cannot simply upload the JS resource file and then use them. Even if you will try to edit your header.php or any other theme file, you are risking to make your theme stop working on WP upgrades. It is NOT recommended to do so until and unless you know what you are doing.
Now answering your question. Cycle2 has a WordPress plugin that you can install. Click here to download it. Or even simpler, go to the Plugins menu in your WP Dashboard and search for cycle2. You will find it very simple to install and activate the plugin. Follow the Plugin Documentation/Instructions on how to use it.
Visit this link to get go through the installation instructions.

Wordpress: "Sorry, this file type is not permitted for security reasons" when trying to upload standard image files

Does anyone know of any workaround for this?
I'm trying to upload .jpg and .png files, both file types allowed in standard Wordpress settings, but I get the above error.
The workarounds I've googled so far don't work as Wordpress no longer sees the files i'm uploading as images. These are the plugin: Disable Real Mime Check, and variations of code that allow unfiltered uploads in the functions.php file.
I'm sometimes able to get my images uploaded but mostly not, and I can't see a pattern to which images get uploaded and which don't.
Any advice?
You can use hook upload_mimes. See the detail explanation here.
https://www.uyond.com/resource/how-to-fix-upload-not-permitted-error-in-wordpress/
You can try editing the wp-config.php file and adding in;
define(‘ALLOW_UNFILTERED_UPLOADS’, true);
This will allow you to then upload forbidden files, however as a precaution once uploaded I would delete this edit.

why we are using the ../../../wp-load.php in wordpress?

Sorry for asking this type of stupid ques.
But i don't know I need your help
I look out the coding that they are in wordpress plugin.
require_once('../../../wp-load.php');
I really don't know what the ../../.. is perform some one know ,let me give an suggestion
I am not tell about the core file and all .that extension before the php file.
Thanks.
That loads the WordPress framework for use outside of the native environment.
For example, if you wanted to have a PHP controller that handled AJAX requests, you could load the WordPress environment to validate the current WordPress user login status.
The "../../.." tells the require function to start at the current file, go up three directories, then access wp-load.php.
Based on that path, I can guess that the file is sitting in a theme folder. wp-content/themes/yourtheme

No access to wordpress functions from plugin files

I came across this problem when I was creating a plugin. I cannot call(access ) wordpress default functions like wp_get_current_user(), $wpdb->get_results(), admin_url() etc. from my plugin files. I can access them from my main file of that plugin in which plugin description is given. But I cannot access them from other plugin files. At that time I heard that if we create a new file functions.php and put these code in that file inside a function I can access all wordpress functions. I did so. But now I cannot access that new function. How can I solve this problem? I think you guys understood what I said. Please help me.
#Jan : I got the required thing. I just put require_once('../../../wp-load.php'); in my plugin files and now can access all wp functions from there. Any ways thanks for your reply.

Resources