This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Unique excerpt for Category Posts Widget | |
Plugin URI: http://mkrdip.me/category-posts-widget | |
Description: Adds a meta box for all posts in which the user can edit the excerpt that will be displayed at the category posts widget | |
*/ | |
/** | |
* Register meta box(es). | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This gist shows how to use the "number" attribute of a widget object to target a specific widget | |
* You can find the number associate with a specific widget by inspecting the generated HTML for it, | |
* it is the suffix of the id attribute of the element wrapping the widget | |
* | |
* @param string $excerpt The current excerpt | |
* @param WP_Widget $widget the widget object from which it is possible to get the information of its type an dID number | |
* @param int $length the configured request length for an excerpt. A zero is passed if no value is actually configured | |
* | |
* @return the widget number appended to the excerpt |