Advertisement
phpface

Make Widget Title Link

Mar 23rd, 2021
1,158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var widgets = {
  2.     'my-featured-videos'    : 'http://example.com/featured-videos',
  3.     'my-music-videos'       : 'http://example.com/music-videos',
  4.     'vblog-videos'          : 'http://example.com/vblog-videos',
  5.     'test'                  : 'http://example.com/test'
  6. }
  7.  
  8. jQuery.each( widgets, function( index, value ) {
  9.  
  10.     var widget_title = jQuery( '#' + index )
  11.     .closest( '.widget-builder' )
  12.     .find( '.widget-title' );
  13.  
  14.     widget_title.html( '<a href="'+ value +'">'+ widget_title.html() +'</a>' );
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement