PATH:
home
/
letacommog
/
autopropr01
/
wp-admin
/
includes
<?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 */ 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: * remove_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_wp390_widgets' ) ); * * @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( 'index.php' => 'wp496_privacy', ); // 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( 'wp496_privacy' => array( 'manage_privacy_options', 'export_others_personal_data', 'erase_others_personal_data', ), ); // 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' ); } /** * Print 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 $(document).ready( 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() {} /** * Display a pointer for the new privacy tools. * * @since 4.9.6 */ public static function pointer_wp496_privacy() { $content = '<h3>' . __( 'Personal Data and Privacy' ) . '</h3>'; $content .= '<h4>' . __( 'Personal Data Export and Erasure' ) . '</h4>'; $content .= '<p>' . __( 'New <strong>Tools</strong> have been added to help you with personal data export and erasure requests.' ) . '</p>'; $content .= '<h4>' . __( 'Privacy Policy' ) . '</h4>'; $content .= '<p>' . __( 'Create or select your site’s privacy policy page under <strong>Settings > Privacy</strong> to keep your users informed and aware.' ) . '</p>'; if ( is_rtl() ) { $position = array( 'edge' => 'right', 'align' => 'bottom', ); } else { $position = array( 'edge' => 'left', 'align' => 'bottom', ); } $js_args = array( 'content' => $content, 'position' => $position, 'pointerClass' => 'wp-pointer arrow-bottom', 'pointerWidth' => 420, ); self::print_js( 'wp496_privacy', '#menu-tools', $js_args ); } /** * 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', 'wp496_privacy' ); } }
[+]
..
[-] theme.php
[edit]
[-] class-wp-upgrader-skin.php
[edit]
[-] continents-cities.php
[edit]
[-] class-wp-importer.php
[edit]
[-] widgets.php
[edit]
[-] dashboard.php
[edit]
[-] class-automatic-upgrader-skin.php
[edit]
[-] class-wp-filesystem-base.php
[edit]
[-] template.php
[edit]
[-] medias.php
[edit]
[-] class-wp-posts-list-table.php
[edit]
[-] import.php
[edit]
[-] class-wp-ajax-upgrader-skin.php
[edit]
[-] meta-boxes.php
[edit]
[-] taxonomy.php
[edit]
[-] schema.php
[edit]
[-] class-wp-ms-sites-list-table.php
[edit]
[-] translation-install.php
[edit]
[-] class-wp-screen.php
[edit]
[-] class-theme-installer-skin.php
[edit]
[-] class-wp-comments-list-table.php
[edit]
[-] class-wp-automatic-updater.php
[edit]
[-] class-plugin-upgrader-skin.php
[edit]
[-] class-language-pack-upgrader.php
[edit]
[-] noop.php
[edit]
[-] class-theme-upgrader-skin.php
[edit]
[-] class-filesystem-upgrader-POJAve.php
[edit]
[-] revision.php
[edit]
[-] screen.php
[edit]
[-] user.php
[edit]
[-] class-wp-filesystem-ftpsockets.php
[edit]
[-] image-edit.php
[edit]
[-] class-wp-post-comments-list-table.php
[edit]
[-] class-wp-list-table.php
[edit]
[-] class-pclzip.php
[edit]
[-] class-theme-upgrader.php
[edit]
[-] misc.php
[edit]
[-] edit-tag-messages.php
[edit]
[-] class-ftp.php
[edit]
[-] update.php
[edit]
[-] class-wp-plugins-list-table.php
[edit]
[-] class-wp-theme-install-list-table.php
[edit]
[-] network.php
[edit]
[-] class-wp-ms-themes-list-table.php
[edit]
[-] admin-filters.php
[edit]
[-] class-wp-list-table-compat.php
[edit]
[-] class-walker-category-checklist.php
[edit]
[-] class-wp-community-events.php
[edit]
[-] ms.php
[edit]
[-] class-ftp-sockets.php
[edit]
[-] class-wp-terms-list-table.php
[edit]
[-] bookmark.php
[edit]
[-] options.php
[edit]
[-] class-wp-users-list-table.php
[edit]
[-] export.php
[edit]
[-] upgrade.php
[edit]
[-] update-core.php
[edit]
[-] plugin-install.php
[edit]
[-] ms-admin-filters.php
[edit]
[-] class-wp-internal-pointers.php
[edit]
[-] post.php
[edit]
[-] class-file-upload-upgrader.php
[edit]
[-] class-bulk-plugin-upgrader-skin.php
[edit]
[-] admin.php
[edit]
[-] image.php
[edit]
[-] class-core-upgrader.php
[edit]
[-] credits.php
[edit]
[-] file.php
[edit]
[-] menu.php
[edit]
[-] comment.php
[edit]
[-] deprecated.php
[edit]
[-] class-wp-plugin-install-list-table.php
[edit]
[-] class-wp-site-icon.php
[edit]
[-] class-walker-nav-menu-checklist.php
[edit]
[-] class-bulk-upgrader-skin.php
[edit]
[-] class-plugin-installer-skin.php
[edit]
[-] ajax-actions.php
[edit]
[-] class-filesystem-upgrader-qCUom2.php
[edit]
[-] nav-menu.php
[edit]
[-] media.php
[edit]
[-] list-table.php
[edit]
[-] class-plugin-upgrader.php
[edit]
[-] class-wp-filesystem-ssh2.php
[edit]
[-] class-bulk-theme-upgrader-skin.php
[edit]
[-] class-wp-filesystem-direct.php
[edit]
[-] ms-deprecated.php
[edit]
[-] plugin.php
[edit]
[-] class-wp-media-list-table.php
[edit]
[-] class-wp-themes-list-table.php
[edit]
[-] class-wp-links-list-table.php
[edit]
[-] class-walker-nav-menu-edit.php
[edit]
[-] class-wp-upgrader-skins.php
[edit]
[-] class-ftp-pure.php
[edit]
[-] class-wp-upgrader.php
[edit]
[-] class-language-pack-upgrader-skin.php
[edit]
[-] class-wp-filesystem-ftpext.php
[edit]
[-] class-wp-ms-users-list-table.php
[edit]
[-] theme-install.php
[edit]