Current Dir: /var/www/html/wp-admin/includes/
[FILE] ajax-actions.php [ edit | delete | rename ]
[FILE] bookmark.php [ edit | delete | rename ]
[FILE] class-automatic-upgrader-skin.php [ edit | delete | rename ]
[FILE] class-bulk-plugin-upgrader-skin.php [ edit | delete | rename ]
[FILE] class-bulk-theme-upgrader-skin.php [ edit | delete | rename ]
[FILE] class-bulk-upgrader-skin.php [ edit | delete | rename ]
[FILE] class-custom-background.php [ edit | delete | rename ]
[FILE] class-custom-image-header.php [ edit | delete | rename ]
[FILE] class-file-upload-upgrader.php [ edit | delete | rename ]
[FILE] class-ftp-sockets.php [ edit | delete | rename ]
[FILE] class-language-pack-upgrader-skin.php [ edit | delete | rename ]
[FILE] class-language-pack-upgrader.php [ edit | delete | rename ]
[FILE] class-pclzip.php [ edit | delete | rename ]
[FILE] class-plugin-upgrader-skin.php [ edit | delete | rename ]
[FILE] class-plugin-upgrader.php [ edit | delete | rename ]
[FILE] class-theme-installer-skin.php [ edit | delete | rename ]
[FILE] class-theme-upgrader-skin.php [ edit | delete | rename ]
[FILE] class-theme-upgrader.php [ edit | delete | rename ]
[FILE] class-walker-category-checklist.php [ edit | delete | rename ]
[FILE] class-walker-nav-menu-checklist.php [ edit | delete | rename ]
[FILE] class-walker-nav-menu-edit.php [ edit | delete | rename ]
[FILE] class-wp-ajax-upgrader-skin.php [ edit | delete | rename ]
[FILE] class-wp-application-passwords-list-table.php [ edit | delete | rename ]
[FILE] class-wp-comments-list-table.php [ edit | delete | rename ]
[FILE] class-wp-community-events.php [ edit | delete | rename ]
[FILE] class-wp-filesystem-direct.php [ edit | delete | rename ]
[FILE] class-wp-filesystem-ftpsockets.php [ edit | delete | rename ]
[FILE] class-wp-filesystem-ssh2.php [ edit | delete | rename ]
[FILE] class-wp-internal-pointers.php [ edit | delete | rename ]
[FILE] class-wp-list-table-compat.php [ edit | delete | rename ]
[FILE] class-wp-list-table.php [ edit | delete | rename ]
[FILE] class-wp-media-list-table.php [ edit | delete | rename ]
[FILE] class-wp-ms-sites-list-table.php [ edit | delete | rename ]
[FILE] class-wp-ms-themes-list-table.php [ edit | delete | rename ]
[FILE] class-wp-plugin-install-list-table.php [ edit | delete | rename ]
[FILE] class-wp-plugins-list-table.php [ edit | delete | rename ]
[FILE] class-wp-post-comments-list-table.php [ edit | delete | rename ]
[FILE] class-wp-posts-list-table.php [ edit | delete | rename ]
[FILE] class-wp-privacy-data-export-requests-list-table.php [ edit | delete | rename ]
[FILE] class-wp-privacy-data-removal-requests-list-table.php [ edit | delete | rename ]
[FILE] class-wp-privacy-policy-content.php [ edit | delete | rename ]
[FILE] class-wp-privacy-requests-table.php [ edit | delete | rename ]
[FILE] class-wp-screen.php [ edit | delete | rename ]
[FILE] class-wp-site-health-auto-updates.php [ edit | delete | rename ]
[FILE] class-wp-site-health.php [ edit | delete | rename ]
[FILE] class-wp-site-icon.php [ edit | delete | rename ]
[FILE] class-wp-terms-list-table.php [ edit | delete | rename ]
[FILE] class-wp-theme-install-list-table.php [ edit | delete | rename ]
[FILE] class-wp-themes-list-table.php [ edit | delete | rename ]
[FILE] class-wp-upgrader-skin.php [ edit | delete | rename ]
[FILE] class-wp-upgrader-skins.php [ edit | delete | rename ]
[FILE] class-wp-upgrader.php [ edit | delete | rename ]
[FILE] class-wp-users-list-table.php [ edit | delete | rename ]
[FILE] comment.php [ edit | delete | rename ]
[FILE] continents-cities.php [ edit | delete | rename ]
[FILE] credits.php [ edit | delete | rename ]
[FILE] dashboard.php [ edit | delete | rename ]
[FILE] deprecated.php [ edit | delete | rename ]
[FILE] edit-tag-messages.php [ edit | delete | rename ]
[FILE] export.php [ edit | delete | rename ]
[FILE] file.php [ edit | delete | rename ]
[FILE] image-edit.php [ edit | delete | rename ]
[FILE] image.php [ edit | delete | rename ]
[FILE] import.php [ edit | delete | rename ]
[FILE] list-table.php [ edit | delete | rename ]
[FILE] menu.php [ edit | delete | rename ]
[FILE] meta-boxes.php [ edit | delete | rename ]
[FILE] misc.php [ edit | delete | rename ]
[FILE] ms-admin-filters.php [ edit | delete | rename ]
[FILE] ms.php [ edit | delete | rename ]
[FILE] nav-menu.php [ edit | delete | rename ]
[FILE] network.php [ edit | delete | rename ]
[FILE] options.php [ edit | delete | rename ]
[FILE] plugin-install.php [ edit | delete | rename ]
[FILE] post.php [ edit | delete | rename ]
[FILE] revision.php [ edit | delete | rename ]
[FILE] schema.php [ edit | delete | rename ]
[FILE] screen.php [ edit | delete | rename ]
[FILE] taxonomy.php [ edit | delete | rename ]
[FILE] template.php [ edit | delete | rename ]
[FILE] theme-install.php [ edit | delete | rename ]
[FILE] theme.php [ edit | delete | rename ]
[FILE] translation-install.php [ edit | delete | rename ]
[FILE] update-core.php [ edit | delete | rename ]
[FILE] update.php [ edit | delete | rename ]
[FILE] upgrade.php [ edit | delete | rename ]
[FILE] user.php [ edit | delete | rename ]
[FILE] widgets.php [ edit | delete | rename ]
Viewing: /var/www/html/wp-admin/includes/class-wp-internal-pointers.php
<?php
/**
* Administration API: WP_Internal_Pointers class
*
* @package WordPress
* @subpackage Administration
* @since 4.4.0
*/
/**
* Core class used to implement an internal admin pointers API.
*
* @since 3.3.0
*/
#[AllowDynamicProperties]
final class WP_Internal_Pointers {
/**
* Initializes the new feature pointers.
*
* @since 3.3.0
*
* All pointers can be disabled using the following:
* remove_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) );
*
* Individual pointers (e.g. wp390_widgets) can be disabled using the following:
*
* function yourprefix_remove_pointers() {
* remove_action(
* 'admin_print_footer_scripts',
* array( 'WP_Internal_Pointers', 'pointer_wp390_widgets' )
* );
* }
* add_action( 'admin_enqueue_scripts', 'yourprefix_remove_pointers', 11 );
*
* @param string $hook_suffix The current admin page.
*/
public static function enqueue_scripts( $hook_suffix ) {
/*
* Register feature pointers
*
* Format:
* array(
* hook_suffix => pointer callback
* )
*
* Example:
* array(
* 'themes.php' => 'wp390_widgets'
* )
*/
$registered_pointers = array(
// None currently.
);
// Check if screen related pointer is registered.
if ( empty( $registered_pointers[ $hook_suffix ] ) ) {
return;
}
$pointers = (array) $registered_pointers[ $hook_suffix ];
/*
* Specify required capabilities for feature pointers
*
* Format:
* array(
* pointer callback => Array of required capabilities
* )
*
* Example:
* array(
* 'wp390_widgets' => array( 'edit_theme_options' )
* )
*/
$caps_required = array(
// None currently.
);
// Get dismissed pointers.
$dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
$got_pointers = false;
foreach ( array_diff( $pointers, $dismissed ) as $pointer ) {
if ( isset( $caps_required[ $pointer ] ) ) {
foreach ( $caps_required[ $pointer ] as $cap ) {
if ( ! current_user_can( $cap ) ) {
continue 2;
}
}
}
// Bind pointer print function.
add_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_' . $pointer ) );
$got_pointers = true;
}
if ( ! $got_pointers ) {
return;
}
// Add pointers script and style to queue.
wp_enqueue_style( 'wp-pointer' );
wp_enqueue_script( 'wp-pointer' );
}
/**
* Prints the pointer JavaScript data.
*
* @since 3.3.0
*
* @param string $pointer_id The pointer ID.
* @param string $selector The HTML elements, on which the pointer should be attached.
* @param array $args Arguments to be passed to the pointer JS (see wp-pointer.js).
*/
private static function print_js( $pointer_id, $selector, $args ) {
if ( empty( $pointer_id ) || empty( $selector ) || empty( $args ) || empty( $args['content'] ) ) {
return;
}
?>
<script type="text/javascript">
(function($){
var options = <?php echo wp_json_encode( $args ); ?>, setup;
if ( ! options )
return;
options = $.extend( options, {
close: function() {
$.post( ajaxurl, {
pointer: '<?php echo $pointer_id; ?>',
action: 'dismiss-wp-pointer'
});
}
});
setup = function() {
$('<?php echo $selector; ?>').first().pointer( options ).pointer('open');
};
if ( options.position && options.position.defer_loading )
$(window).bind( 'load.wp-pointers', setup );
else
$( function() {
setup();
} );
})( jQuery );
</script>
<?php
}
public static function pointer_wp330_toolbar() {}
public static function pointer_wp330_media_uploader() {}
public static function pointer_wp330_saving_widgets() {}
public static function pointer_wp340_customize_current_theme_link() {}
public static function pointer_wp340_choose_image_from_library() {}
public static function pointer_wp350_media() {}
public static function pointer_wp360_revisions() {}
public static function pointer_wp360_locks() {}
public static function pointer_wp390_widgets() {}
public static function pointer_wp410_dfw() {}
public static function pointer_wp496_privacy() {}
/**
* Prevents new users from seeing existing 'new feature' pointers.
*
* @since 3.3.0
*
* @param int $user_id User ID.
*/
public static function dismiss_pointers_for_new_users( $user_id ) {
add_user_meta( $user_id, 'dismissed_wp_pointers', '' );
}
}