Form using admin-post.php gives 404 after submission

First of all… Your action is called rguroo_email_verification_form, so you should use it when registering your hooks. But you use this instead: add_action( ‘admin_post_nopriv_email_verification_form’, ‘verify_and_sanitize_email_form’, $priority = 10, $accepted_args = 1 ); add_action( ‘admin_post_email_verification_form’, ‘verify_and_sanitize_email_form’, $priority = 10, $accepted_args = 1 ); It should be: add_action( ‘admin_post_nopriv_rguroo_email_verification_form’, ‘verify_and_sanitize_email_form’, $priority = 10, $accepted_args = 1 ); … Read more

Access to apache logs from plugin

If you have Try and cache block and loggin error manually than you can try this : $mylogfilepath = plugin_dir_path(__FILE__).’debug.log’; $errormessage=”SOME ERROR”.PHP_EOL; error_log($errormessage, 3, $mylogfilepath); Place debug.log file directly inside your plugin. and it will log error to that file. third attribute in error_log set path of file in which log should be recored.

How to get post image root URL?

The get_attached_file() function returns the path to a file based on the attachment ID: $FeaturedImage = get_attached_file( get_post_thumbnail_id() ); Getting the path to a specific size is more complicated. WordPress stores the filename for resized versions of the images in as attachment metadata, that can be retrieved with wp_get_attachment_metadata(). Once you have the filename of … Read more

WooCommerce Endpoints content

Dang it…must be blind….FOUND IT. The solution is, that since this is a custom hook, and most likely using JQuery, you place the end point action within the call. Instead of this: function mylistings_information_endpoint_content() { echo ‘THIS IS A TEST OF THE CONTENT’; } add_action( ‘woocommerce_account_information_endpoint’, ‘mylistings_information_endpoint_content’ ); It is this: function **mylistings**_information_endpoint_content() { echo … Read more

Change/Set Page Title and Meta Tags from Page Called within a Plugin

Attach to wp_head action hoook function that will display meta tag. Inside that function you can: add your own filter that will allow you to change the value, or change tag value depending of your query vars (sign1, sign2, …) or conditional tags. add_action( ‘wp_head’, ‘se344297_description_metatag_display’, 0 ); function se344297_description_metatag_display() { $site_descr = apply_filters( ‘description_tag_filter’, … Read more