Пример #1
0
 /**
  * Adds needed hooks.
  *
  * @access private
  */
 function add_hooks()
 {
     // Step1a: Add root dependencies
     add_action('wp_print_scripts', array($this, 'js_maps_global'));
     add_action('wp_print_scripts', array($this, 'js_plugin_url'));
     add_action('wp_print_styles', array($this, 'css_load_styles'));
     // Step1b: Add Google Maps dependencies
     add_action('wp_print_scripts', array($this, 'js_google_maps_api'));
     // Step 1c: Additiona styles
     add_action('wp_head', array($this, 'css_additional_styles'));
     // Step2: Register custom fields processing
     $opts = apply_filters('agm_google_maps-options', get_option('agm_google_maps'));
     if (@$opts['use_custom_fields']) {
         add_filter('the_content', array($this, 'process_post_meta'), 1);
         // Note the order
     }
     // Step3: Process map tags
     $rpl = AgmMarkerReplacer::register();
     //add_filter('the_content', array($rpl, 'process_tags'), 99);
 }
 /**
  * Adds needed hooks.
  *
  * @access private
  */
 function add_hooks()
 {
     // Step 1: Additional styles
     add_action('wp_head', array($this, 'css_additional_styles'));
     // Step2: Register custom fields processing
     $opts = apply_filters('agm_google_maps-options', get_option('agm_google_maps'));
     if (@$opts['use_custom_fields']) {
         add_filter('the_content', array($this, 'process_post_meta'), 1);
         // Note the order
     }
     // Step3: Process map tags
     $rpl = AgmMarkerReplacer::register();
 }