Changeset 1128362
- Timestamp:
- 04/05/2015 09:55:37 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
shortcode-reference/trunk/lib/ShortcodeReference.php
r582536 r1128362 123 123 $is_native = strpos($relative_path, 'wp-includes/'); 124 124 $is_plugin = strpos($relative_path, 'wp-content/plugins/'); 125 $is_theme = strpos($relative_path, 'wp-content/themes/'); 125 126 if ($is_native !== false){ 126 127 return 'WordPress function'; 127 } else if ($is_plugin !== false){ 128 129 } else if ($is_plugin !== false){ 128 130 $plugin_path = explode('/',str_replace('wp-content/plugins/','',$relative_path)); 129 131 return 'Plugin: '.$plugin_path[0]; 130 } 132 133 } else if ($is_theme !== false){ 134 $theme_path = explode('/',str_replace('wp-content/themes/','',$relative_path)); 135 return 'Theme: '.$theme_path[0]; 136 } 131 137 } 132 138 return 'PHP native'; … … 180 186 if (!$this->_url){ 181 187 182 $is_plugin = strpos($this->getReference(),'Plugin:'); 188 $is_plugin = strpos($this->getReference(),'Plugin: '); 189 $is_theme = strpos($this->getReference(),'Theme: '); 183 190 if ($this->getReference() == 'WordPress function'){ 184 185 191 $this->_url ='http://codex.wordpress.org/index.php?title=Special:Search&search='.$this->_shortcode.'_Shortcode'; 192 186 193 } else if ($is_plugin !== false){ 187 194 $plugin_info = get_plugin_data($this->_filepath); … … 203 210 $this->_url = 'http://www.google.com/search?q=Wordpress+'.$plugin_path.'+'.$this->_shortcode; 204 211 } 212 213 } else if ($is_theme !== false){ 214 // $theme_name = strtolower(str_replace('Theme: ','',$this->getReference())); 215 $theme_root = get_theme_root(); 216 $theme = wp_get_theme(null, $theme_root); 217 $this->_url = $theme->get('ThemeURI'); 218 205 219 } else { 206 220 $this->_url = 'http://www.php.net/'.$this->_shortcode;
Note: See TracChangeset
for help on using the changeset viewer.