Are widget arguments always set inside My_Widget::widget()?

This is mostly a case of trusting the arguments. Or not trusting. You can assume that you have received meaningful arguments, ready to be used. You can assume they are arbitrary and possibly grossly invalid. I would say in this specific case it hangs if the code is public or private. In private site you … Read more

Registration form not registering First and Last name

You’re not handling the names the same way as the other fields: //// VERIFIES CREDENTIALS $username = isset($_POST[‘username’]) ? trim($_POST[‘username’]) : ”; $first_name = isset($fields[‘user_first_name’]) ? sanitize_text_field(trim($fields[‘user_first_name’])) : ”; $last_name = isset($fields[‘user_last_name’]) ? sanitize_text_field(trim($fields[‘user_last_name’])) : ”; $email = isset($_POST[’email’]) ? trim($_POST[’email’]) : ”; Notice how you use $_POST[’email’] and $_POST[‘username’], but then you use $fields[‘user_last_name’], … Read more

WordPress rating by views [closed]

First of all you have to start log views of each post. You can do it by yourself or by a plugin. Here you have an example how you can track this number without any plugin. Add this code to the theme’s functions.php file function prefix_get_post_views( $post_id ){ $count_key = ‘post_views_count’; $count = get_post_meta( $post_id, … Read more