• Resolved Guido

    (@guido07111975)


    Hi,

    Nice plugin! I like the simplicity.

    I would like to suggest a new feature: a shortcode. So it’s easier to use it for other elements than headings. In that case add the shortcode where you want, such as: [anchor id="my-ID"].

    You only have to create the shortcode with a few lines of code:

    
    function anchor_shortcode($atts) {
    	$atts = shortcode_atts(array(
    		'id' => ''
    	), $atts);} 
    
    	$anchor_id = esc_attr( $atts['id'] );
    	$html = '<span id="'.$anchor_id.'"></span>';
    	return $html;
    
    }
    add_shortcode('anchor', 'anchor_shortcode');
    

    Oh, the intro text says “healings” instead of “headings” and the installation info comes from one of your others plugins ??

    Guido

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Guido

    (@guido07111975)

    Hi again,

    The code example in my previous post is quite basic, I know. It’s better to make it work with the “linker”. That’s the power of your plugin.

    But maybe I’m asking too much.

    Guido

    Plugin Author xnau webdesign

    (@xnau)

    The problem is that since the addition of the block editor, the functionality this plugin offers is outdated.

    The block editor supports adding an anchor to a heading, which once that is set, will show up in the linker.

    How To Create Anchor Links In WordPress

    Thread Starter Guido

    (@guido07111975)

    Good point… I still use the Classic Editor for most of my websites. But you’re right, supporting the Classic Editor is not that important anymore.
    I’m closing this topic ??

    Guido

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Feature request’ is closed to new replies.