wp_ajax_dismiss_wp_pointer()
Handles dismissing a WordPress pointer via AJAX.
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
wp_ajax_dismiss_wp_pointer();
Список изменений
С версии 3.1.0 | Введена. |
Код wp_ajax_dismiss_wp_pointer() wp ajax dismiss wp pointer WP 6.6.2
function wp_ajax_dismiss_wp_pointer() { $pointer = $_POST['pointer']; if ( sanitize_key( $pointer ) !== $pointer ) { wp_die( 0 ); } // check_ajax_referer( 'dismiss-pointer_' . $pointer ); $dismissed = array_filter( explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ) ); if ( in_array( $pointer, $dismissed, true ) ) { wp_die( 0 ); } $dismissed[] = $pointer; $dismissed = implode( ',', $dismissed ); update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $dismissed ); wp_die( 1 ); }