• Resolved lucilec

    (@lucilec)


    Hi again,
    I’m triing to add a link ‘More info’ in the tooltip and the project list item.
    1 I added a new field with ACF (I tried different types)
    2 Upload in the markers
    3 I created a custom tag with a custom plugin
    4 Add in the tooltip and nav list template

    I can’t make it work. Can you ensure me that I should work ?

    Thanks a lot

    • This topic was modified 4 years ago by lucilec.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author dgamoni

    (@dgamoni)

    Hi @lucilec
    If possible, send me ftp access
    I will help

    Thread Starter lucilec

    (@lucilec)

    Sorry I’m working in Local…

    Thread Starter lucilec

    (@lucilec)

    In my plugin I placed :

    add_action('plugins_loaded', 'init_tags_for_locate_and_filter_plugin');
    function init_tags_for_locate_and_filter_plugin() {
      
      if ( class_exists('Locate_And_Filter_Addon_Helper') ) {
       
       		new Locate_And_Filter_Addon_Helper;
    
    		Locate_And_Filter_Addon_Helper::define_custom_tags( 
    		  array( 'project_url_related' =>'project_url_related'),
    		  'all', 'getDataCallbackFn_place_tags',
    		  'project_url_related'
    		);
    		function getDataCallbackFn_place_tags( $field, $id){
    			$html = '';
    			ob_start();
    
    				$project_url_related = get_field('project_url_related', $id);
    				echo  '<a href="<?php echo esc_url( $project_url_related ); ?>">Read more</a>';
    				
    			$html .= ob_get_contents();
    			ob_end_clean();
    		 
    		    return $html;   
    		}
    
      } else {
        add_action('admin_notices', 'wc_not_loaded');
      }
    }
    
    function wc_not_loaded() {
        printf(
          '<div class="error"><p>%s</p></div>',
          __('Sorry cannot create tag because Locate_And_Filter is not loaded')
        );
    }

    Does it look right ?

    Plugin Author dgamoni

    (@dgamoni)

    you have mistake – echo into echo
    https://prntscr.com/vma7bz
    try this
    echo '<a href="' . esc_url( $project_url_related ) . '">Read more</a>';

    • This reply was modified 4 years ago by dgamoni.
    Thread Starter lucilec

    (@lucilec)

    You are right. I need a link tough…
    echo '<a href="'.$project_url_related.'" target="_blank">Test</a>';

    I’ve tried this but it doesn’t look right eather.

    Thanks a lot for your help, it’s very kind of you.

    Thread Starter lucilec

    (@lucilec)

    The problem came from ‘Allow cache’ in the options.
    Thanks again for your help

    Plugin Author dgamoni

    (@dgamoni)

    closed

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Triing to add a link in the tooltip’ is closed to new replies.