Support » Plugins » Hacks » How to disable pointers or better yet hide with css?

  • I run a multisite and gravityforms. When using the following code (or any other code I could find) the pointer error still shows up. Is there a function that would save into db that never use pointers?

    $lumpy_disable_pointers = new lumpy_disable_pointers;
    
    class lumpy_disable_pointers {
    
    	public function __construct() {
    
    		add_action( 'wp_default_scripts', array( $this, 'no_pointer_script' ) );
    		add_action( 'wp_default_styles',  array( $this, 'no_pointer_style'  ) );
    
    	}
    
    	function no_pointer_script( $scripts ) {
    
    		$scripts->remove( 'wp-pointer' );
    
    	}
    
    	function no_pointer_style( $styles ) {
    
    		$styles->remove( 'wp-pointer' );
    
    	}
    
    }

    Been looking solutions for hours and it is driving me crazy.

    Error I get with every snippet: “Uncaught TypeError: undefined is not a function” and most of it is red.

    setup = function () {
    					$('li.toplevel_page_wpseo_dashboard').pointer(wpseo_pointer_options).pointer('open');
    										jQuery('#pointer-close').after('<a id="pointer-primary" class="button-primary">' + 'Start Tour' + '</a>');
    					jQuery('#pointer-primary').click(function () {
    						document.location="http://domain.com/test5/wp-admin/admin.php?page=wpseo_dashboard";					});
    										jQuery('#pointer-close').click(function () {
    												wpseo_setIgnore("tour", "wp-pointer-0", "c225a4f7e3");
    											});
    									};
    
    				if (wpseo_pointer_options.position && wpseo_pointer_options.position.defer_loading)
    					$(window).bind('load.wp-pointers', setup);

    Really appreciate if someone could help.

    Thanks.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    There is likely more to the pointer script than just setting up pointers, so removing the entire script may not be the best approach. I’m not familiar with gravity forms, I’m merely speculating on this part.

    If the pointers are set by script after the page is loaded, you cannot use CSS to hide them. If CSS were possible, you could hide it by changing the related element’s CSS in your browser’s CSS analyzer tool. It’s worth a try, but I doubt it’ll work.

    To prevent the pointers from being set by script, you need to identify the actual function that does it, then write a new version of the function that does not set the pointer. As long as your version is loaded after the default version it’ll override it.

Viewing 1 replies (of 1 total)
  • The topic ‘How to disable pointers or better yet hide with css?’ is closed to new replies.