Hi there. You could call the wp_delete_user_account_delete_button( 'Button Text' ) function in a custom container, and style it accordingly. If your button is outside the post content, such as in a theme template, you’ll need to enable the assets on the frontend using the wp_delete_user_accounts_load_assets_on_frontend filter.
Thanks for the reply
Im not very good at file modification, I take it the loading of front end assets is via the Function.PHP.
Saying that I use Elementor for page building – elementor has the ability to allow HTML & script to be loaded via widgets for individual pages and custom CSS to be loaded as well.
Would there be a way to load the delete function via script as Im able to allocate a class to the button via its settings. Thereby using the buttons class to initiate the delete.
-
This reply was modified 6 years, 6 months ago by
wordtalk112.
The easiest way would be to add the following line to your functions.php file:
add_filter( 'wp_delete_user_accounts_load_assets_on_frontend', '__return_true' );
Note that this loads the assets on every page. You’d need to add some logic for loading it only where needed.
Thanks for the reply, I wouldn’t have a clue how to add a logic form to load assets, I understand adding the filter to Function .PHP.
I dont know if you would be able to create a silent shortcode (that doesnt display any content but acts as the logic for loading the assets) or url link that could be added to a element (button, icon, image) in any of your future plugin revisions.
That would be handy and make the functionality of the plugin a lot better for people like me, who know nothing about coding terminology.
Either way your plugin is the best designed I’ve seen so far.
Thank you for the feedback! 😁
I’ll explore some ideas that might make things like this easier. I appreciate you sharing your thoughts.