Changeset 1803410
- Timestamp:
- 01/15/2018 06:55:53 PM (8 years ago)
- File:
-
- 1 edited
-
dml-easy-map/trunk/dmlmap.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dml-easy-map/trunk/dmlmap.php
r1803408 r1803410 199 199 function dml_public_scripts() { 200 200 201 global $post; 202 if ( has_shortcode( $post->post_content, 'dml_emap') ) { 203 204 // register scripts with WordPress's internal library 205 wp_register_script('dmlmap-js-public', plugins_url('/js/public/dmlmap.js',__FILE__), array('jquery'),'',true); 206 $dmlPubAdminLink = admin_url(); 207 $dmlPubPluginLink = plugins_url(); 208 $dataPubToBePassed = array( 209 'UrlofPubAdmin' => __( $dmlPubAdminLink, 'default' ), 210 'UrlofPubPlugin' => __( $dmlPubPluginLink, 'default' ) 211 ); 212 wp_localize_script( 'dmlmap-js-public', 'dml_pub_php_links', $dataPubToBePassed ); 213 wp_enqueue_script('dmlmap-js-public'); 214 215 wp_register_script('dmlmap-clusterjs', plugins_url('/js/markerclusterer.js',__FILE__), array('jquery'),'',true); 216 wp_enqueue_script('dmlmap-clusterjs'); 217 218 wp_register_script('dmlmap-bootstrapjs-public', plugins_url('/js/bootstrap.min.js',__FILE__), array('jquery'),'',true); 219 wp_enqueue_script('dmlmap-bootstrapjs-public'); 220 221 wp_register_style('dmlmap-css-public', plugins_url('/css/public/dmlbootstrap.css',__FILE__)); 222 wp_enqueue_style('dmlmap-css-public'); 223 224 wp_register_style('dmlmap-mapiconscss-public', plugins_url('/css/public/map-icons.css',__FILE__)); 225 wp_enqueue_style('dmlmap-mapiconscss-public'); 226 227 wp_register_style('dmlmap-customcss-public', plugins_url('/css/public/dmlcustomstyle.css',__FILE__)); 228 wp_enqueue_style('dmlmap-customcss-public'); 229 } 230 201 if ( is_single() ) { 202 global $post; 203 if ( has_shortcode( $post->post_content, 'dml_emap') ) { 204 205 // register scripts with WordPress's internal library 206 wp_register_script('dmlmap-js-public', plugins_url('/js/public/dmlmap.js',__FILE__), array('jquery'),'',true); 207 $dmlPubAdminLink = admin_url(); 208 $dmlPubPluginLink = plugins_url(); 209 $dataPubToBePassed = array( 210 'UrlofPubAdmin' => __( $dmlPubAdminLink, 'default' ), 211 'UrlofPubPlugin' => __( $dmlPubPluginLink, 'default' ) 212 ); 213 wp_localize_script( 'dmlmap-js-public', 'dml_pub_php_links', $dataPubToBePassed ); 214 wp_enqueue_script('dmlmap-js-public'); 215 216 wp_register_script('dmlmap-clusterjs', plugins_url('/js/markerclusterer.js',__FILE__), array('jquery'),'',true); 217 wp_enqueue_script('dmlmap-clusterjs'); 218 219 wp_register_script('dmlmap-bootstrapjs-public', plugins_url('/js/bootstrap.min.js',__FILE__), array('jquery'),'',true); 220 wp_enqueue_script('dmlmap-bootstrapjs-public'); 221 222 wp_register_style('dmlmap-css-public', plugins_url('/css/public/dmlbootstrap.css',__FILE__)); 223 wp_enqueue_style('dmlmap-css-public'); 224 225 wp_register_style('dmlmap-mapiconscss-public', plugins_url('/css/public/map-icons.css',__FILE__)); 226 wp_enqueue_style('dmlmap-mapiconscss-public'); 227 228 wp_register_style('dmlmap-customcss-public', plugins_url('/css/public/dmlcustomstyle.css',__FILE__)); 229 wp_enqueue_style('dmlmap-customcss-public'); 230 } 231 } 231 232 } 232 233 // 4.2 - Add scripts to the Admin Page
Note: See TracChangeset
for help on using the changeset viewer.