diff --git a/class.wp-help-pointers.php b/class.wp-help-pointers.php index 1ea255c..2e5f9bd 100644 --- a/class.wp-help-pointers.php +++ b/class.wp-help-pointers.php @@ -59,7 +59,19 @@ public function __construct( $pntrs = array() ) { public function register_pointers( $pntrs ) { + $pointers = $this->pointers; + foreach( $pntrs as $ptr ) { + + // show in all screens if not specified + if ( empty($ptr['screen']) ) { + $screen = get_current_screen(); + $ptr['screen'] = $screen->id; + } + // if no id is specified, generate a unique one + if ( empty($ptr['id']) ) { + $ptr['id'] = md5( $ptr['title'] . $ptr['content'] ); + } if( $ptr['screen'] == $this->screen_id ) { @@ -68,8 +80,8 @@ public function register_pointers( $pntrs ) { 'target' => $ptr['target'], 'options' => array( 'content' => sprintf( '
%s
', - __( $ptr['title'] , 'plugindomain' ), - __( $ptr['content'], 'plugindomain' ) + $ptr['title'], + $ptr['content'] ), 'position' => $ptr['position'] ) @@ -78,7 +90,7 @@ public function register_pointers( $pntrs ) { } } - $this->pointers = $pointers; + $this->pointers = $pointers; } @@ -151,4 +163,4 @@ function wp_help_pointer_open(i) { } -} // end class +} // end class \ No newline at end of file