PUM_Admin_Onboarding::set_up_pointers()
Sets up all guided tours for Popup Maker
Description Description
Source Source
File: classes/Admin/Onboarding.php
public static function set_up_pointers() { if ( ! current_user_can( 'manage_options' ) ) { return; } $pointers = self::get_pointers_by_screen(); // Get dismissed pointers. $dismissed = self::get_dismissed_pointers(); $valid_pointers = array(); // Cycles through pointers and only add valid ones. foreach ( $pointers as $pointer_id => $pointer ) { // Skip if pointer isn't an array. if ( ! is_array( $pointer ) ) { continue; } $pointer['pointer_id'] = $pointer_id; // Skip if pointer is not valid. if ( ! self::is_pointer_valid( $pointer ) ) { continue; } // Skip if pointer has already been dismissed. if ( in_array( $pointer_id, $dismissed ) ) continue; // Add the pointer to $valid_pointers array. $valid_pointers['pointers'][] = $pointer; } // Bail out if there are no pointers to display. if ( empty( $valid_pointers ) ) { return; } // Add pointers style to queue. wp_enqueue_style( 'wp-pointer' ); // Add pointers script to queue. Add custom script. wp_enqueue_script( 'pum-pointer', Popup_Maker::$URL . 'assets/js/admin-pointer.js', array( 'wp-pointer' ), Popup_Maker::$VER, true ); // Add pointer options to script. wp_localize_script( 'pum-pointer', 'pumPointers', $valid_pointers ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
1.11.0 | Introduced. |