Edit page slug after save, cause 404 by linked pages
Edit page slug after save, cause 404 by linked pages
Edit page slug after save, cause 404 by linked pages
You can’t, because of wp-login.php structure. Here is code with register_form hook: <form name=”registerform” id=”registerform” action=”<?php echo esc_url( site_url( ‘wp-login.php?action=register’, ‘login_post’ ) ); ?>” method=”post” novalidate=”novalidate”> <p> <label for=”user_login”><?php _e(‘Username’) ?><br /> <input type=”text” name=”user_login” id=”user_login” class=”input” value=”<?php echo esc_attr(wp_unslash($user_login)); ?>” size=”20″ /></label> </p> <p> <label for=”user_email”><?php _e(‘Email’) ?><br /> <input type=”email” name=”user_email” id=”user_email” class=”input” … Read more
It looks like a mismatch of the number of arguments. Your function has none but your action hook says it expects one.
You can modify the arguments passed to wp_nav_menu with a filter called wp_nav_menu_args. You can use this filter to add a walker class, which will modify the behaviour of wp_nav_menu. This approach is kind of hackish, because the walker class will still ‘walk’ through all the menu items, but you can control them, so decide … Read more
You are removing the hooks from the head that are normally used to register and enqueue scripts. Normally, but not necessarily. You can also skip the intermediate hook and enqueue scripts directly into wp_head like this: add_action(‘wp_head’,’wpse240186_enqueue_jquery’); function wpse240186_enqueue_jquery() { wp_register_script(‘jquery’, ‘path_to/jquery.min.js’); wp_enqueue_script(‘jquery’); } In that way you can move scripts in general to the … Read more
The edit_user_created_user will work for when adding users via user-new.php: add_action( ‘edit_user_created_user’, ‘wpse_edit_user_created_user’, 10, 2 ); //for user-new.php page new user addition function wpse_edit_user_created_user( $user_id, $notify ) { $meta = get_user_meta( $user_id, ‘my_field’, true ); } For the sake of completeness, I used the following code for testing the user meta data, which I grabbed … Read more
if page is parent page redirect to first child with hook / polylang
You can fix it through Session. try function vv_process_profile_forms() { session_start(); if ( isset( $_POST[‘action’] ) && $_POST[‘action’] == ‘profile-form’ ) { if ( ! isset( $_SESSION[‘form-submit’] ) ) { // form processing code here $_SESSION[‘form-submit’] = 1; $redirect_page = get_permalink( 586 ); wp_redirect( $redirect_page ); exit; } else { unset( $_SESSION[‘form-submit’] ); } } … Read more
At first, Data was sanitized here (line 2997). If you don’t want any plugin/theme run on action save_post. User function remove_all_actions to remove all functions hooked to action save_post. function post_save_action($post_id, $post, $update) { if ($this->is_temp_saving_post($post, $post_id)) { return; } // Check user permissions if (!current_user_can(‘edit_post’, $post_id)) return; // Update post if (!$this->is_proper_post_type($post)) { return; … Read more
Unexpected results from get_taxonomies() and {$taxonomy}_edit_form and related hook