Remove action from private_file_default_handlers.class.php

Accueil Forums Feature Requests Remove action from private_file_default_handlers.class.php

Mots-clés : 

16 sujets de 1 à 16 (sur un total de 16)
  • Auteur
    Messages
  • #601184
    it2b
    Participant

    How can remove this action from that file in another plugin?:

    add_action('cuar/private-content/files/render-select-method?id=ftp-folder', array(&$this, 'render_ftp_folder_form'));

    Thanks.

    #601190
    Vincent Mimoun-Prat
    Admin bbPress

    Hi,

    The best thing to do is not to remove that action, but to remove the FTP Folder method from the list of known methods.

    add_filter('cuar/private-content/files/select-methods', 'wpca_custom_select_methods');
    function wpca_custom_select_methods($methods) {
        unset($methods['ftp-folder']);
        return $methods;
    }
    
    #601233
    it2b
    Participant

    Thanks for your answer, and isn’t there a way to eliminate the action?

    I overwrite that action in the external plugin, and now I need to delete the old one so that it doesn’t appear twice

    Thanks

    #601234
    Vincent Mimoun-Prat
    Admin bbPress

    Hi,

    Currently not, as the $default_handlers which is refered to by the filter is a private member of the class CUAR_PrivateFileAddOn.

    What is your intention? Just changing the way things are displayed? Or removing it altogether?

    Regards,

    #601241
    it2b
    Participant

    Remove it completely to just call the new one

    Regards,

    #602045
    it2b
    Participant

    is there any way?

    Regards,

    #602496
    Vincent Mimoun-Prat
    Admin bbPress

    You simply want to change the UI? Don’t you?

    #602550
    it2b
    Participant

    yes, I don’t want that action to be shown

    #602830
    Vincent Mimoun-Prat
    Admin bbPress

    Then use the snippet :

    add_filter('cuar/private-content/files/select-methods', 'wpca_custom_select_methods');
    function wpca_custom_select_methods($methods) {
        unset($methods['ftp-folder']);
        return $methods;
    }
    #602922
    it2b
    Participant

    Thanks, but if I use the snippet, the custom action for ftp will not be shown

    Regards,

    #602932
    Vincent Mimoun-Prat
    Admin bbPress

    You said you did not want to show it ?!

    yes, I don’t want that action to be shown

    #602950
    it2b
    Participant

    I don’t want the plugin action to be shown, but I want the custom action that I call in the external plugin to be displayed

    #603247
    Vincent Mimoun-Prat
    Admin bbPress

    That cannot be done the way you want to do it.

    However, I suggest you read our template system documentation.

    You will see that any HTML produced by our plugin can be customized. So you can change the way the FTP folder method is rendered by simply overriding a file.

    The file you will want to target is private-attachments-add-ftp-folder-admin.template.php

    You can find the original file in the plugin folder customer-area\src\php\core-addons\private-file\templates

    You can copy that file to wp-content/customer-area/templates as indicated in the documentation.

    #603672
    it2b
    Participant

    thanks, i have already done that to show it customized, but now what i want to do is customize the render_ftp_folder_form function

    #603693
    Vincent Mimoun-Prat
    Admin bbPress

    You can’t. You can however put your code in the template file, it will get executed too.

    #603767
    it2b
    Participant

    Ok, thank you very much for your time, greetings

16 sujets de 1 à 16 (sur un total de 16)
  • Vous devez être connecté pour répondre à ce sujet.