1

I need to show a list of links, similar to what "Bookmarks" widget does.

But Bookmarks widget is not suitable, because I need to display links (with removed "http://") instead of titles and also images of a custom size. Bookmarks widget seems not to being able to do this.

As such, I want to code it in PHP.

My question: How to enumerate all links of a specified category?

1 Answer 1

1

Recycle the core

You could simply take the widgets code from core 1), rename the class and such and alter it to your needs. OR you could simply extend the core widget class and just alter what you need changed (overwrite the methods in your extending Widget class).

Than add a plugin comment on top and activate it.

/**
 * Plugin Name: Custom Link Widget
 * Description: Altered from WP Core.
 * Version:     0.1
 * Required:    3.3
 * Author:      Your Name <[email protected]>
 * Author URI:  http://example.com
 * License:     MIT
 * License URI: http://www.opensource.org/licenses/mit-license.php
 */

1) The core widget you can find here.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.