• Constellation Client Portal Hooks – Filters

    Constellation Client Portal Hooks

    Filters

    Invoice Filters

    Filter: ‘accp_define_invoice_statuses’

    Parameters: $statuses An array of current invoice statuses.

    Description: This filter allows invoice statuses to be added, edited, or removed.

    Note: If you have a status assigned to existing invoices, then remove that status via this hook, the invoices will still have the previous status stored to the post, but the incorrect status will show in the status select field within the invoice.

    Note: If you choose to remove default statuses, voided, refunded, and write-off are the only default statuses that can be removed. The paid and unpaid statuses cannot be removed.

    Example

    The following would be placed in functions.php within your theme.

    
    
    add_filter('accp_define_invoice_statuses', 'yourprefix_update_defined_invoice_statuses', 10, 1);
    function yourprefix_update_defined_invoice_statuses($statuses){
    
         //Add a new invoice status.
         $statuses['new-status'] = 'New Status'; //Change "new-status" and "New Status."
    
         return $statuses;
    
    }
    
    

    Filter: ‘accp_update_invoice_prohibited_product_types’

    Parameters: $prohibited_product_types An array of prohibited product type slugs ( ex. array(‘variable, ‘variable-subscritpion’) ).

    Description: This filter allows the default list of prohibited product types to be edited to account for additional product type exclusions that might be needed after installing a plugin (or other customizations that you might need). This list prevents defined product types from showing in the product select field within invoices, and is intended to remove product types that cannot be added to the cart correctly via the WooCommerce add-to-cart URL param. As an example, it’s usually not a good idea to add a parent product ID to an add-to-cart link (in the case of variable products), but instead the specific product variation ID should be added.

    Filter: ‘accp_invoice_already_added_text’

    Parameters: $message_text String – The default message text.

    $invoices_in_cart Array – An array of invoice post ID’s to be paid.

    Description: This filter allows the default “Item already added” text (that appears beside pay buttons after an item is added to the cart) to be changed.

    Filter: ‘accp_invoice_already_added_link_text’

    Parameters: $link_text String – The default links text.

    $invoices_in_cart Array – An array of invoice post ID’s to be paid.

    Description: This filter allows the default “Proceed to payment” link text (that appears beside pay buttons after an item is added to the cart) to be changed.

    File Filters

    Filter: ‘accp_define_file_statuses’

    Parameters: $statuses An array of current file statuses.

    Description: This filter allows file statuses to be added, edited, or removed.

    Note: If you have a status assigned to existing files, then remove that status via this hook, the files will still have the previous status stored to the post, but the incorrect status will show in the status select field within the file.

    Note: If you choose to remove default statuses, na, in-progress, and incomplete are the only default statuses that can be removed. The completed status cannot be removed.

    Example

    The following would be placed in functions.php within your theme.

    
    
    add_filter('accp_define_file_statuses', 'yourprefix_update_defined_file_statuses', 10, 1);
    function yourprefix_update_defined_file_statuses($statuses){
    
         //Add a new file status.
         $statuses['new-status'] = 'New Status'; //Change "new-status" and "New Status."
    
         return $statuses;
    
    }
    
    

    Invoice and File Filters

    Filter: ‘accp_past_due_text’

    Parameters: $past_due_text String – The default past due text.

    $item_id Integer – the post ID of the invoice or file. This can be used to differentiate between file and invoice post types (by checking the post type), as an example.

    Description: This filter allows the default “past due” text in past due notifications to be changed.

    Login Filters

    Filter: ‘accp_update_login_redirect_url ‘

    Parameters: $redirect_to A valid URL to redirect to.

    Parameters: $request The requested redirect destination URL passed as a parameter. See the WordPress login_redirect filter for more information.

    Parameters: $user The WP user object. See the WordPress login_redirect filter for more information.

    Description: This filter allows for the login redirect URL to be changed.

    Example

    The following would be placed in functions.php within your theme.

    
    
    add_filter('accp_update_login_redirect_url', 'yourprefix_change_login_redirect_url', 10, 3);
    function yourprefix_change_login_redirect_url($redirect_to, $request, $user){
         
         // URL of the page to redirect to.
         $redirect_to = 'https://your-site/new-page-name';
    
         return $redirect_to;
    
    }
    
    
    ARS