WordPress.org

Ready to get started?Download WordPress

Forums

Trying to build a new plugin concerning wp_list_bookmarks (1 post)

  1. EntarteteMuzak
    Member
    Posted 5 years ago #

    I'm trying to build a plugin that will enable me to use shortcode instead of php if I want to add a list of bookmarks in a post or page without resorting to templates.

    Example.

    [Linklist ID=2 Desc=yes] will call for wp_list_bookmarks('category=2&show_description=1')

    I started off by peaking at the nasa_image plugin, but since this is my first attempt to build a plugin I'm stuck.
    How can I add a function to get the bookmarks, and add variables for ID and Description?
    Have patience. ;-)

    if (!function_exists('Linklist')) {
    	function Linklist($atts){
    		extract(shortcode_atts(array('ID'=>'1','Hide'=>'yes', 'Desc'=>'yes'), $atts));
    		// Set the ID to user default, default 1 if 0 and Description to yes.
    		if(!is_numeric($ID)) $ID=1;
    
    		else return;
    	}
    }
    add_shortcode('Linklist', 'Linklist');

Topic Closed

This topic has been closed to new replies.

About this Topic