Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. function wp_124_change_shortcode_route_order() {?>
  2. <script>
  3. jQuery( document ).ready(function() {
  4. ph.hooks.addFilter('ph.dashboardShortcode.routes', 'my-custom-function', function(routes) {
  5. // make sure we have routes
  6. if ( !( routes && routes.length ) ) {
  7. return;
  8. }
  9.  
  10. // this makes mockups the default route
  11. _.each(routes, function(route){
  12. if ( route.path == "/" || route.path =="*" ) {
  13. route.redirect = "/mockups";
  14. }
  15. });
  16.  
  17. // this next part is optional - change the order to activity tab to last
  18. var activity = routes.shift();
  19. routes.push(activity);
  20.  
  21. // return
  22. return routes;
  23. });
  24. });
  25. </script>
  26. <?php
  27. }
  28. add_action( 'ph_shortcodes_enqueue_script', 'wp_124_change_shortcode_route_order' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement