Save in my custom admin page and redirect to the saved object

You can call them with $last_item = $wpdb->get_row( “SELECT * FROM $wpdb->wp_puzzle ORDER BY your_table_id DESC LIMIT 1”, ARRAY_A ); and put manualy every item in your inputs at the form public function puzzle_manager(){ global $wpdb; $file = file_get_contents(‘puzzle_manager.php’, FILE_USE_INCLUDE_PATH); if($file == false){ echo ‘file not found’; } else{ echo $file; } $last_item = $wpdb->get_row( … Read more

Hiding WordPress REST endpoints from public viewing using Basic Authentication

Here is my solution. Inside the callback function I validate Authorization from the header like this: function callback_function($data) { //Get HTTP request headers $auth = apache_request_headers(); //Get only Authorization header $valid = $auth[‘Authorization’]; // Validate if ($valid == ‘Basic Base64UsernamePassword’) { //Do what the function should do } else { $response=”Please use a valid authentication”; … Read more

not able to access $_POST on backend profile update

I’ve found my mistake. I was hooking twice the same code, one in the ‘edit_user_profile’ and other in ‘edit_user_profile_update’. I have separated the display code from de update code and now it works like have to: <?php function privacity_user_profile_fields() { global $user_id; $data_consent = get_user_meta($user_id, ‘gdpr_user_register_consent’, true); $data_consent_text=”He leído y entendido el cómo se tratarán … Read more

tweaking the

the answer (taken from: https://stackoverflow.com/questions/36087390/add-filterwp-title-doesnt-replace-my-title-tag-wordpress-plugin) was to do this: add_filter( ‘pre_get_document_title’, ‘vendor_module_filter_the_title’, 999, 1 ); this is due to the YOAST SEO plugin and the above is the found workaround.

Add new header/footer on landing page with plugin

You can intercept the template WordPress will be using with the template_include filter. Like this: add_filter (‘template_include’,’wpse303537_plugin_template’, 10,1); function wpse303537_plugin_template ($template) { if (is_front_page) $template = plugin_dir_path( __FILE__ ) . ‘/my-template.php’; return $template; } Alternatively, you can include an almost empty template for the landing page in your theme and fill it through the action … Read more