Advertisement
fauzanjeg

Custom Modules || Add Related Post to Widget List

Aug 30th, 2021
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. /** START Custom Modules || Add Related Post to Widget List */
  2. function custom_modules_config( $module_list ) {
  3.     foreach ( $module_list as $key => $value ) {
  4.         if ( $value['name'] === 'JNews_Post_Related' ) {
  5.             $module_list[ $key ]['widget'] = true;
  6.             break;
  7.         }
  8.     }
  9.  
  10.     return $module_list;
  11. }
  12. add_filter( 'jnews_module_list', 'custom_modules_config' );
  13.  
  14. function custom_module_widget() {
  15.     class JNews_Post_Related_Widget extends \JNews\Widget\Module\WidgetModuleAbstract {
  16.  
  17.     }
  18. }
  19. add_action( 'jnews_module_widget', 'custom_module_widget' );
  20. /** NB: Just for Child Theme Only, if use Parent Theme, add Hooks Filter and Action before JNews/Init */
  21. /** END Custom Modules || Add Related Post to Widget List */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement