Send mail from page using wp_mail

This can (and should) be achieved using the admin_post action. Take a look at the docs for an example: https://codex.wordpress.org/Plugin_API/Action_Reference/admin_post_(action) SitePoint also have a more comprehensive tutorial here: https://www.sitepoint.com/handling-post-requests-the-wordpress-way/ Hope that helps.

Create register form without a plugin

In your PHP, use wp_create_user(). With this function, you can pass username, email and `password’. Then, wp update user() to give the user the other bits of info. I would hook my user-creation function to the init hook. Also, you want to put a nonce field in your form e.g. this, between the <form> tags: … Read more

How to edit custom user meta information front end

I have solved it. In the redirect I changed if (count($error) == 0 ){ to if (count($error) < 1 ){ Also for any custom user meta fields added duplicated the following line and change the word ‘description’ to the name of the field create in your function file. if ( !empty( $_POST[‘description’] ) ) update_user_meta( … Read more

Form Data not getting stored in WordPress database

According to WordPress Codex about the template_redirect hook: This action hook executes just before WordPress determines which template page to load. So, you are redirecting the user to another page before the template is even loaded, which your form won’t load at all. You can use another hook which runs after template_redirect, such as wp_footer. … Read more

admin_post action not usable if admin access denied to user

What about (1) current_screen? action hook, or a condition for (2) get_current_screen() in your conditional and then calling wp_redirect? Both give you a WP_Screen object which has several parameters, including a $parent_base property that can give broader inclusion if needed, too. Here’s the property list from the codex: $action Any action associated with the screen. … Read more

Disable the “Skip to Toolbar” tabbing accessibility feature

It’s not possible without JavaScript. The HTML for it is output in the WP_Admin_Bar in a private and protected method with no filter. You can remove them after the page has loaded with JS like so: function wpse_287259_remove_skip_link() { echo “<script>jQuery( ‘.screen-reader-shortcut’ ).remove();</script>”; } add_action( ‘wp_after_admin_bar_render’, ‘wpse_287259_remove_skip_link’ ); I hope it goes without saying that … Read more

Ajax not working properly

Just saw it… …in your HTML, take the action out entirely. We’re not using the HTML to tell the form/submit button what to do, we’re using JS/AJAX for that. <form method=”POST” action=”<?php echo admin_url(‘admin-ajax.php’); ?>” id=”modal-form-ajax” autocomplete=”off”> Should become: <form method=”POST” id=”modal-form-ajax” autocomplete=”off”> Also, instead of targeting the form, target the submit button, so the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)