firoze

Wordpress url extract

Apr 29th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. // Wordpress url extract
  2.  
  3. $wp_root_path = str_replace('/wp-content/themes', '', get_theme_root_uri());
  4.  
  5.  
  6. // uploads file file extract
  7.              <?php
  8.              $a = str_replace('/themes', '', get_theme_root_uri().'/uploads/'.date('Y/'));
  9.              $wp_root_path = str_replace($a, '', wp_get_attachment_url($id));
  10.              $f = substr($wp_root_path,3);
  11.              echo $f.'<br/>';  //  http://xparagon.com/wp-content/uploads/2017/04/ has been removed
  12.              ?>
Add Comment
Please, Sign In to add comment