'; } /** * Prints the field for the client's permalink base. */ function upstream_print_client_permalink_field() { $value = esc_attr( get_option( 'upstream_client_base', '' ) ); $default = esc_attr( apply_filters( 'upstream_client_base', 'client' ) ); echo ''; } /** * Validates and save permalink settings. */ function upstream_validate_permalink_settings() { $post_data = isset( $_POST ) ? wp_unslash( $_POST ) : array(); if ( ! array_key_exists( 'permalink_structure', $post_data ) ) { return; } if ( ! array_key_exists( 'upstream_nonce', $post_data ) ) { return; } if ( ! wp_verify_nonce( sanitize_text_field( $post_data['upstream_nonce'] ), 'upstream_permalink_settings' ) ) { return; } if ( array_key_exists( 'upstream_projects_base', $post_data ) ) { $option = sanitize_title( $post_data['upstream_projects_base'] ); update_option( 'upstream_projects_base', $option ); } if ( array_key_exists( 'upstream_client_base', $post_data ) ) { $option = sanitize_title( $post_data['upstream_client_base'] ); update_option( 'upstream_client_base', $option ); } } /** * Prints the output for the permalink section. */ function upstream_permalink_settings_section() { wp_nonce_field( 'upstream_permalink_settings', 'upstream_nonce' ); }