Open shazahm1 opened 11 years ago
Take a look at the code for this: https://tommcfarlin.com/category-sticky-post/
The featured entries should be saved in the wp_options tables as a JSON encoded array. This would mimic bbPress super sticky topic.
https://github.com/wp-plugins/bbpress/blob/master/includes/topics/functions.php#L2051
The featured in category entries should be saved in the entry cn_entry_meta table as a JSON encoded array. This will match how bbpress handles sticky topic within a forum:
https://github.com/wp-plugins/bbpress/blob/master/includes/topics/functions.php#L2035
To do this I can hook into the cn_process_taxonomy-category
action to save the meta.
When displaying results, we'll need to account for the featured and featured within category results so limit and page_limit respected. For reference see how bbPress does it:
https://github.com/wp-plugins/bbpress/blob/master/includes/topics/template.php#L141
WP core seems to handle this the same way.
https://github.com/WordPress/WordPress/blob/master/wp-includes/query.php#L3552
The metabox should be a drop down (maybe radio group) with the label of "Featured" with the options:
How should the feature entries be ordered? Obviously "Feature" would display before the "Featured with Category" entry groups. Maybe the sorting should just follow what ever order by is set to.
Since these have to be queried independently, make sure to have filters available for extensions can be made where these can be ordered in a specific order or any of the other custom orders suported by order_by.
Need to make sure to build in the ability to set expiration dates:
ref: http://www.wpbeginner.com/plugins/how-to-add-an-expiration-date-to-sticky-posts-in-wordpress/ https://wordpress.org/plugins/expire-sticky-posts/
There should be two levels of featured entries, "Featured" and "Featured in Category"
Implementation:
Consider: